From: <ir...@us...> - 2013-04-15 11:22:12
|
Revision: 11384 http://sourceforge.net/p/xoops/svn/11384 Author: irmtfan Date: 2013-04-15 11:22:09 +0000 (Mon, 15 Apr 2013) Log Message: ----------- improve: add anon users to topic poster and last poster in NewbbTopicRenderer class (used in block and list.topic.php) newbb/class/topic.renderer.php, newbb/xoops_version.php, newbb/list.topic.php, newbb/blocks/list_topic.php Modified Paths: -------------- XoopsModules/newbb/branches/irmtfan/newbb/blocks/list_topic.php XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt XoopsModules/newbb/branches/irmtfan/newbb/class/topic.renderer.php XoopsModules/newbb/branches/irmtfan/newbb/xoops_version.php Modified: XoopsModules/newbb/branches/irmtfan/newbb/blocks/list_topic.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/blocks/list_topic.php 2013-04-15 10:52:09 UTC (rev 11383) +++ XoopsModules/newbb/branches/irmtfan/newbb/blocks/list_topic.php 2013-04-15 11:22:09 UTC (rev 11384) @@ -28,17 +28,17 @@ mod_loadFunctions("user", "newbb"); // options[0] - Status in WHERE claus: all(by default), sticky, digest,lock, poll, voted, viewed, replied, read, (UN_) , active, pending, deleted (admin) (It is multi-select) -// options[1] - Uid in WHERE claus: uid of the topic poster : 0 - all users (by default) -// options[2] - Lastposter in WHERE claus: uid of the lastposter in topic : 0 - all users (by default) +// options[1] - Uid in WHERE claus: uid of the topic poster : -1 - all users (by default) +// options[2] - Lastposter in WHERE claus: uid of the lastposter in topic : -1 - all users (by default) // options[3] - Type in WHERE claus: topic type in the forum : 0 - none (by default) // options[4] - Sort in ORDER claus: topic, forum, poster, replies, views, lastpost(by default), lastposttime, lastposter, lastpostmsgicon, ratings, votes, publish, digest, sticky, lock, poll, type (if exist), approve(admin mode) -// options[5] - Order in ORDER claus: Descending(by default), Ascending -// options[6] - NumberToDisplay: any positive integer -// options[7] - TimeDuration: negative for hours, positive for days, for instance, -5 for 5 hours and 5 for 5 days +// options[5] - Order in ORDER claus: Descending 0(by default), Ascending 1 +// options[6] - NumberToDisplay: any positive integer - 5 by default +// options[7] - TimeDuration: negative for hours, positive for days, for instance, -5 for 5 hours and 5 for 5 days - 360 by default // options[8] - DisplayMode: all fields in sort PLUS attachment, read, pagenav // options[9] - Display Navigator: 1 (by default), 0 (No) -// options[10] - Title Length : 0 - no limit and show complete title -// options[11] - Post text Length: 0 - dont show post text +// options[10] - Title Length : 0 by default - no limit and show complete title +// options[11] - Post text Length: 0 - dont show post text - 200 by default // options[12] - SelectedForumIDs: multi-select ngative values for categories and positive values for forums: null for all(by default) function newbb_list_topic_show($options) @@ -106,19 +106,19 @@ $statusEle->setDescription(_MB_NEWBB_CRITERIA_DESC); // topic_poster element - $topicPosterRadioEle = new XoopsFormRadio(_MB_NEWBB_AUTHOR, 'options[1]', !empty($options[1])); - $topicPosterRadioEle->addOption(0,_MD_TOTALUSER); - $topicPosterRadioEle->addOption(!empty($options[1]) ? $options[1] : 1,_SELECT); // if no user in selection box it select uid=1 + $topicPosterRadioEle = new XoopsFormRadio(_MB_NEWBB_AUTHOR, 'options[1]', $options[1]); + $topicPosterRadioEle->addOption(-1,_MD_TOTALUSER); + $topicPosterRadioEle->addOption(($options[1] != -1) ? $options[1] : 0,_SELECT); // if no user in selection box it select uid=0 anon users $topicPosterRadioEle->setExtra("onchange=\"var el=document.getElementById('options[1]'); el.disabled=(this.id == 'options[1]1'); if (!el.value) {el.value= this.value}\""); // if user dont select any option it select "all" - $topicPosterSelectEle = new XoopsFormSelectUser(_MB_NEWBB_AUTHOR, 'options[1]', false, explode(',', $options[1]), 5, true); + $topicPosterSelectEle = new XoopsFormSelectUser(_MB_NEWBB_AUTHOR, 'options[1]', true, explode(',', $options[1]), 5, true); $topicPosterEle = new XoopsFormLabel(_MB_NEWBB_AUTHOR, $topicPosterRadioEle->render().$topicPosterSelectEle->render()); // lastposter element - $lastPosterRadioEle = new XoopsFormRadio(_MD_POSTER, 'options[2]', !empty($options[2])); - $lastPosterRadioEle->addOption(0,_MD_TOTALUSER); - $lastPosterRadioEle->addOption(!empty($options[2]) ? $options[2] : 1,_SELECT); // if no user in selection box it select uid=1 + $lastPosterRadioEle = new XoopsFormRadio(_MD_POSTER, 'options[2]', $options[2]); + $lastPosterRadioEle->addOption(-1,_MD_TOTALUSER); + $lastPosterRadioEle->addOption(($options[2] != -1) ? $options[2] : 0,_SELECT); // if no user in selection box it select uid=1 $lastPosterRadioEle->setExtra("onchange=\"var el=document.getElementById('options[2]'); el.disabled=(this.id == 'options[2]1'); if (!el.value) {el.value= this.value}\""); // if user dont select any option it select "all" - $lastPosterSelectEle = new XoopsFormSelectUser(_MD_POSTER, 'options[2]', false, explode(',', $options[2]), 5, true); + $lastPosterSelectEle = new XoopsFormSelectUser(_MD_POSTER, 'options[2]', true, explode(',', $options[2]), 5, true); $lastPosterEle = new XoopsFormLabel(_MD_POSTER, $lastPosterRadioEle->render().$lastPosterSelectEle->render()); // type element Modified: XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt 2013-04-15 10:52:09 UTC (rev 11383) +++ XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt 2013-04-15 11:22:09 UTC (rev 11384) @@ -1,3 +1,9 @@ +date 2013-04-15 +=================================== +1- improve: add anon users to topic poster and last poster in NewbbTopicRenderer class (used in block and list.topic.php) +newbb/class/topic.renderer.php, newbb/xoops_version.php, +newbb/list.topic.php, newbb/blocks/list_topic.php + date 2013-02-11 =================================== 1- improve: add multi topic poster and multi last poster to NewbbTopicRenderer class (used in block and list.topic.php) Modified: XoopsModules/newbb/branches/irmtfan/newbb/class/topic.renderer.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/class/topic.renderer.php 2013-04-15 10:52:09 UTC (rev 11383) +++ XoopsModules/newbb/branches/irmtfan/newbb/class/topic.renderer.php 2013-04-15 11:22:09 UTC (rev 11384) @@ -344,13 +344,13 @@ break; case "uid": // irmtfan add multi topic poster - if (!empty($val)) { + if ($val != -1) { $val = implode(",",array_map("intval", explode(",", $val))); $this->query["where"][] = "t.topic_poster IN ( ". $val ." )"; } break; case "lastposter": // irmtfan add multi lastposter - if (!empty($val)) { + if ($val != -1) { $val = implode(",",array_map("intval", explode(",", $val))); $this->query["where"][] = "p.uid IN ( ". $val ." )"; } Modified: XoopsModules/newbb/branches/irmtfan/newbb/xoops_version.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/xoops_version.php 2013-04-15 10:52:09 UTC (rev 11383) +++ XoopsModules/newbb/branches/irmtfan/newbb/xoops_version.php 2013-04-15 11:22:09 UTC (rev 11384) @@ -221,17 +221,17 @@ ); // irmtfan START add list topic block // options[0] - Status in WHERE claus: all(by default), sticky, digest,lock, poll, voted, viewed, replied, read, (UN_) , active, pending, deleted (admin) (It is multi-select) -// options[1] - Uid in WHERE claus: uid of the topic poster : 0 - all users (by default) -// options[2] - Lastposter in WHERE claus: uid of the lastposter in topic : 0 - all users (by default) +// options[1] - Uid in WHERE claus: uid of the topic poster : -1 - all users (by default) +// options[2] - Lastposter in WHERE claus: uid of the lastposter in topic : -1 - all users (by default) // options[3] - Type in WHERE claus: topic type in the forum : 0 - none (by default) // options[4] - Sort in ORDER claus: topic, forum, poster, replies, views, lastpost(by default), lastposttime, lastposter, lastpostmsgicon, ratings, votes, publish, digest, sticky, lock, poll, type (if exist), approve(admin mode) -// options[5] - Order in ORDER claus: Descending(by default), Ascending -// options[6] - NumberToDisplay: any positive integer -// options[7] - TimeDuration: negative for hours, positive for days, for instance, -5 for 5 hours and 5 for 5 days +// options[5] - Order in ORDER claus: Descending 0(by default), Ascending 1 +// options[6] - NumberToDisplay: any positive integer - 5 by default +// options[7] - TimeDuration: negative for hours, positive for days, for instance, -5 for 5 hours and 5 for 5 days - 360 by default // options[8] - DisplayMode: all fields in sort PLUS attachment, read, pagenav // options[9] - Display Navigator: 1 (by default), 0 (No) -// options[10] - Title Length : 0 - no limit and show complete title -// options[11] - Post text Length: 0 - dont show post text +// options[10] - Title Length : 0 by default - no limit and show complete title +// options[11] - Post text Length: 0 - dont show post text - 200 by default // options[12] - SelectedForumIDs: multi-select ngative values for categories and positive values for forums: null for all(by default) $modversion['blocks'][] = array( @@ -239,7 +239,7 @@ 'name' => _MI_NEWBB_BLOCK_LIST_TOPIC, 'description' => "Shows a list of topics (advance renderer)", 'show_func' => "newbb_list_topic_show", - 'options' => "all|0|0|0|lastpost|0|5|360|topic,forum,replies,lastpost,lastposttime,lastposter,lastpostmsgicon,publish|1|0|200|0", + 'options' => "all|-1|-1|0|lastpost|0|5|360|topic,forum,replies,lastpost,lastposttime,lastposter,lastpostmsgicon,publish|1|0|200|0", 'edit_func' => "newbb_list_topic_edit", 'template' => 'newbb_block_list_topic.html'); // irmtfan END add list topic block |