I wanted on my page, that the Sub-Admins, which are able to submit news, don't have to approve them. News should be directly shown after the poster submits it.
I searched board for a sloution but havent found one really, so I looked for my own.
Check under modules\Submit_News\ the index.php file.
In Line 297 you should have a Code like this:
$column = &$pntable['queue_column'];
$newid = $dbconn->GenId($pntable['queue']);
$result =& $dbconn->Execute("INSERT INTO $pntable[queue] (
$column[qid],
$column[uid],
$column[arcd],
$column[uname],
$column[subject],
$column[story],
$column[timestamp],
$column[topic],
$column[alanguage],
$column[bodytext])
VALUES (" . pnVarPrepForStore($newid). ",
'" . pnVarPrepForStore($uid) . "',
'0',
'" . pnVarPrepForStore($name) . "',
'" . pnVarPrepForStore($subject) . "',
'" . pnVarPrepForStore($storytext) . "',
now(),
'" . pnVarPrepForStore($topic) . "',
'" . pnVarPrepForStore($alanguage) . "',
'" . pnVarPrepForStore($bodytext) . "')");
This posts the News in the queue where its waiting for a Administrator to approve it.
I rewrote the
SQL Command just to post it directly into the News Table.
$column = &$pntable['stories_column'];
$newid = $dbconn->GenId($pntable['stories']);
$result =& $dbconn->Execute("INSERT INTO $pntable[stories] (
$column[sid],
$column[catid],
$column[aid],
$column[counter],
$column[title],
$column[time],
$column[hometext],
$column[bodytext],
$column[topic],
$column[informant],
$column[language])
VALUES (" . pnVarPrepForStore($newid). ",
'0',
'2',
'0',
'" . pnVarPrepForStore($subject) . "',
now(),
'" . pnVarPrepForStore($storytext) . "',
'" . pnVarPrepForStore($bodytext) . "',
'" . pnVarPrepForStore($topic) . "',
'" . pnVarPrepForStore($name) . "',
'" . pnVarPrepForStore($alanguage) . "')");
I don't work with any categorys at my news. I just need them to for the main page. I know there is an issue now, that the Users are able to post a news without selecting any category.
You modify the code so they MUST select a category... as for me... I am lazy ^^ I just fixed it by going to line 80 in index.php where it reads
echo '<option value="">'._SELECTTOPIC.
"</option>\n";
I have only one category with the ID 0...
just make it
echo '<option value="0">'._SELECTTOPIC.
"</option>\n";
[/code
And it will be automaticly this category
if no other is selected.
Administrators can correct the news or the category after posting...
And a last thing to make the shown text look correct.
Go into Line
343... the code reads
[code
] .
'<br />'._WEHAVESUB.
" $waiting "._WAITING;
If you change this to
only, the "We have X submissions waiting" line will be gone.
you can now edit the language file and add a text you like...
line 48 is the headline define('_SUBSENT',YOUR TEXT HERE');
line 49 is the line under the headline define('YOUR TEXT HERE');
------------------------
This has been changed and tested with the Submit_News Module delivered in the original download package of
PostNuke 0.7.6.1 and works for me just fine. Always make a backup of the file, and to be sure of the Database before you change it. I give no guarantee that it works for you as well as me :wink:
Thank you Francisco Burzi for this Module, hope you don't mind I improved it a bit for my needs