The standard workflow for a news article is that the user writes it, submits it for approval by the administrator, the administrator reads it, approves and publishes it on the site. This has some
advantages:
Everybody can post, even anonymous users.
Since the posts are checked, there is no risk of getting flooded with garbage posts.
But it also has some disadvantages too:
Users have to wait to see their post published. This may not be what they expect, if actuality of content is highly important for the topics of your site.
The administrators have to spend time on approving news articles. Waiting content (Figure 18-11) can be quite an administrative
headache, if the site receives many user submissions a day (see, for example phpnuke.org, where there are dozens of submissions awaiting approval at any given time).
Figure 18-11. Waiting Content block.
Waiting Content block.
Fortunately, to bypass article approval, the solution is relatively simple (see Automatic Article Posting):
For versions before PHP-Nuke 6.5:
In the modules/Submit_News, in the function submitStory(), find this
The story will get posted immediately, so you will want to make the Submit_News module only available to Users. Also, you will notice that it will now say "Posted By Some_user", and it will no
longer show in italics.
For PHP-Nuke 6.5 and later, the solution is slightly different. Replace this:
You will also want to change the language file "defines", or edit these lines in the function submitStory (this is what is displayed when the submission is sent.
If you want to make the "Posted By Some_user" also be a link to the User's profile, then you can edit the function formatAidHeader in your mainfile.php. The following refers to PHP-Nuke 6.5 and above.
The function is simple: it takes an argument, the author id $aid, searches the nuke_authors table for that author id and, if found, it prints a link to the web page of the author. Only if the web
page link fiels of nuke_authors is empty for that author, it prints a link to the author's e-mail (which is always there):
You could easily change this behaviour. For example, you could take out the check against the $url and leave only the e-mail part, if you wanted the "Posted By Some_user" to be an e-mail link,
rather than a link to a web page (see Change Posted by... Name (Website) to Name (Email)):
function formatAidHeader($aid) {
global $prefix, $db;
$sql = "SELECT url, email FROM ".$prefix."_authors WHERE aid='$aid'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$url = $row[url];
$email = $row[email];
if (isset($email)) {
$aid = "<a href=\"mailto:$email\">$aid</a>";
} else {
$aid = $aid;
}
echo "$aid";
}
You could make it even more sophisticated, by making "Posted By Some_user" a link to the user's profile (see Section 18.6.2 for the
related subject of user profile redirection). The formatAidHeader function should then be: