From: <be...@us...> - 2012-07-30 11:25:23
|
Revision: 9948 http://xoops.svn.sourceforge.net/xoops/?rev=9948&view=rev Author: beckmi Date: 2012-07-30 11:25:09 +0000 (Mon, 30 Jul 2012) Log Message: ----------- Adding changes by Irmtfan Modified Paths: -------------- XoopsModules/newbb/branches/irmtfan/newbb/class/icon.php XoopsModules/newbb/branches/irmtfan/newbb/class/permission.php XoopsModules/newbb/branches/irmtfan/newbb/class/post.php XoopsModules/newbb/branches/irmtfan/newbb/class/user.php XoopsModules/newbb/branches/irmtfan/newbb/docs/changelog.txt XoopsModules/newbb/branches/irmtfan/newbb/include/functions.render.php XoopsModules/newbb/branches/irmtfan/newbb/include/plugin.php XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_thread.html XoopsModules/newbb/branches/irmtfan/newbb/templates/style.css XoopsModules/newbb/branches/irmtfan/newbb/xoops_version.php Added Paths: ----------- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev9883.txt XoopsModules/newbb/branches/irmtfan/newbb/language/persian/ XoopsModules/newbb/branches/irmtfan/newbb/language/persian/admin.php XoopsModules/newbb/branches/irmtfan/newbb/language/persian/blocks.php XoopsModules/newbb/branches/irmtfan/newbb/language/persian/index.html XoopsModules/newbb/branches/irmtfan/newbb/language/persian/mail_template/ XoopsModules/newbb/branches/irmtfan/newbb/language/persian/mail_template/forum_newpost_notify.tpl XoopsModules/newbb/branches/irmtfan/newbb/language/persian/mail_template/forum_newthread_notify.tpl XoopsModules/newbb/branches/irmtfan/newbb/language/persian/mail_template/global_digest_notify.tpl XoopsModules/newbb/branches/irmtfan/newbb/language/persian/mail_template/global_newforum_notify.tpl XoopsModules/newbb/branches/irmtfan/newbb/language/persian/mail_template/global_newfullpost_notify.tpl XoopsModules/newbb/branches/irmtfan/newbb/language/persian/mail_template/global_newpost_notify.tpl XoopsModules/newbb/branches/irmtfan/newbb/language/persian/mail_template/thread_newpost_notify.tpl XoopsModules/newbb/branches/irmtfan/newbb/language/persian/main.php XoopsModules/newbb/branches/irmtfan/newbb/language/persian/modinfo.php XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/ XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/index.html XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/new_forum.gif XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/new_forum.png XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/new_subforum.gif XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/new_subforum.png XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/offline.gif XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/offline.png XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/online-a.gif XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/online.png XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/p_bann.png XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/p_delete-a.gif XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/p_delete.png XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/p_edit-a.gif XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/p_edit.png XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/p_quote-a.gif XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/p_quote.png XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/p_reply-a.gif XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/p_reply.png XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/p_report-a.gif XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/p_report.png XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/p_up-a.gif XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/p_up.png XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/t_new-a.gif XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/t_new.png XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/t_poll-a.gif XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/t_poll.png XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/t_qr-a.gif XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/t_qr.png XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/t_reply-a.gif XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/t_reply.png Added: XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev9883.txt =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev9883.txt (rev 0) +++ XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev9883.txt 2012-07-30 11:25:09 UTC (rev 9948) @@ -0,0 +1,16 @@ +Changelog from rev.9883 +date: 2012-07-30 +================================================ +1- bug fix: edit not record when the reason is not filled (irmtfan) +2- bug fix: only the last edit is recorded. (irmtfan/alfred) +in newbb/class/post.php +3- bug fix: 'noapprove' permission incorrectly recorded in database. (irmtfan) +in newbb/class/permission.php +4- bug fix: load user ranks has been hardcoded. it works in old/upgraded websites but not works in new installed websites. a new getting rank introduced. (black_beard/irmtfan) +in newbb/class/user.php, newbb/templates/newbb_thread.html +5- minor bug fix: mysql 5.1 was incorrectly needed (irmtfan) +in newbb/xoops_version.php +6- hardcode: some style.css color hardcodes has been removed. (irmtfan) +in newbb/templates/style.css +7- feature added: text links instead of buttons. (deka98/irmtfan) +in newbb/class/icon.php , newbb/include/functions.render.php , newbb/include/plugin.php Modified: XoopsModules/newbb/branches/irmtfan/newbb/class/icon.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/class/icon.php 2012-07-30 11:20:19 UTC (rev 9947) +++ XoopsModules/newbb/branches/irmtfan/newbb/class/icon.php 2012-07-30 11:25:09 UTC (rev 9948) @@ -150,7 +150,9 @@ function assignImage($image, $alt = "", $extra = "") { $this->setImage($image, $alt, $extra); - return true; + // START hacked by iemrfan + return $alt; + // END hacked by iemrfan } function assignImages($images) Modified: XoopsModules/newbb/branches/irmtfan/newbb/class/permission.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/class/permission.php 2012-07-30 11:20:19 UTC (rev 9947) +++ XoopsModules/newbb/branches/irmtfan/newbb/class/permission.php 2012-07-30 11:25:09 UTC (rev 9948) @@ -90,8 +90,14 @@ $groups = is_object($xoopsUser) ? $xoopsUser->getGroups() : array(XOOPS_GROUP_ANONYMOUS); if ( !$groups ) return false; if ( !$allowed_groups = $this->getGroups("{$type}_{$gperm_name}", $id) ) return false; - - return count(array_intersect($allowed_groups, $groups)); + // START hacked by irmtfan + // approved=1 or 0 - $post_obj->setVar('approved', $approved); + if( count(array_intersect($allowed_groups, $groups)) ) { + return true; + } else { + return false; + } + // END hacked by irmtfan } function &getCategories($perm_name = "access") Modified: XoopsModules/newbb/branches/irmtfan/newbb/class/post.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/class/post.php 2012-07-30 11:20:19 UTC (rev 9947) +++ XoopsModules/newbb/branches/irmtfan/newbb/class/post.php 2012-07-30 11:25:09 UTC (rev 9948) @@ -242,9 +242,14 @@ $edit_time = intval($postedit['edit_time']); $edit_user = $myts->stripSlashesGPC($postedit['edit_user']); $edit_msg = (!empty($postedit['edit_msg'])) ? $myts->stripSlashesGPC($postedit['edit_msg']) : ''; - if ($edit_msg != "") { - $post_edit = _MD_EDITEDBY . " " . $edit_user . " " . _MD_ON . " " . formatTimestamp(intval($edit_time)) . " "._MD_EDITEDMSG . " " .$edit_msg."<br />"; + // START hacked by irmtfan + // display/save all edit records. + $post_edit .= _MD_EDITEDBY . " " . $edit_user . " " . _MD_ON . " " . formatTimestamp(intval($edit_time))."<br />"; + // if reason is not empty + if ($edit_msg != "") { + $post_edit .= _MD_EDITEDMSG . " " .$edit_msg."<br />"; } + // START hacked by irmtfan } } return $post_edit; Modified: XoopsModules/newbb/branches/irmtfan/newbb/class/user.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/class/user.php 2012-07-30 11:20:19 UTC (rev 9947) +++ XoopsModules/newbb/branches/irmtfan/newbb/class/user.php 2012-07-30 11:25:09 UTC (rev 9948) @@ -1,318 +1,298 @@ -<?php -/** - * CBB 4.0, or newbb, the forum module for XOOPS project - * - * @copyright The XOOPS Project http://xoops.sf.net - * @license http://www.fsf.org/copyleft/gpl.html GNU public license - * @author Taiwen Jiang (phppp or D.J.) <ph...@us...> - * @since 4.00 - * @version $Id $ - * @package module::newbb - */ - -if (!defined("XOOPS_ROOT_PATH")) { - exit(); -} - -defined("NEWBB_FUNCTIONS_INI") || include XOOPS_ROOT_PATH.'/modules/newbb/include/functions.ini.php'; - -function newbb_calculateLevel($RPG, $RPGDIFF) -{ - - //$RPG = $user->getVar('posts'); - //$RPGDIFF = $user->getVar('user_regdate'); - - $today = time(); - $diff = $today - $RPGDIFF; - $exp = round($diff / 86400,0); - if ($exp <= 0) { $exp = 1; } - $ppd= round($RPG / $exp, 0); - $level = pow (log10 ($RPG), 3); - $ep = floor (100 * ($level - floor ($level))); - $showlevel = floor ($level + 1); - $hpmulti =round ($ppd / 6, 1); - if ($hpmulti > 1.5) { $hpmulti = 1.5; } - if ($hpmulti < 1) { $hpmulti = 1; } - $maxhp = $level * 25 * $hpmulti; - $hp= $ppd / 5; - if ($hp >= 1) { - $hp= $maxhp; - } else { - $hp= floor ($hp * $maxhp); - } - $hp= floor ($hp); - $maxhp= floor ($maxhp); - if ($maxhp <= 0) { - $zhp = 1; - } else { - $zhp = $maxhp; - } - $hpf= floor (100 * ($hp / $zhp)) - 1; - $maxmp= ($exp * $level) / 5; - $mp= $RPG / 3; - if ($mp >= $maxmp) { $mp = $maxmp; } - $maxmp = floor ($maxmp); - $mp = floor ($mp); - if ($maxmp <= 0) { - $zmp = 1; - } else { - $zmp = $maxmp; - } - $mpf= floor (100 * ($mp / $zmp)) - 1; - if ( $hpf >= 98 ) { $hpf = $hpf - 2; } - if ( $ep >= 98 ) { $ep = $ep - 2; } - if ( $mpf >= 98 ) { $mpf = $mpf - 2; } - - $level = array(); - $level['level'] = $showlevel ; - $level['exp'] = $ep; - $level['exp_width'] = $ep.'%'; - $level['hp'] = $hp; - $level['hp_max'] = $maxhp; - $level['hp_width'] = $hpf.'%'; - $level['mp'] = $mp; - $level['mp_max'] = $maxmp; - $level['mp_width'] = $mpf.'%'; - - return $level; -} - -class newbbUser { - var $user = null; - - function User() - { - } - - function getUserbar() - { - global $xoopsModuleConfig, $xoopsUser, $isadmin; - - $userbar = array(); - if (empty($xoopsModuleConfig['userbar_enabled'])) return $userbar; - - $user = $this->user; - $userbar["profile"] = array("link" => XOOPS_URL . "/userinfo.php?uid=" . $user->getVar("uid"), "name" => _PROFILE); - - if (is_object($xoopsUser)) { - $userbar["pm"] = array("link" => "javascript:void openWithSelfMain('" . XOOPS_URL . "/pmlite.php?send2=1&to_userid=" . $user->getVar("uid") . "', 'pmlite', 450, 380);", "name" => _MD_PM); - } - if ($user->getVar('user_viewemail') || $isadmin) { - $userbar["email"] = array("link" => "javascript:void window.open('mailto:" . $user->getVar('email') . "', 'new');", "name" => _MD_EMAIL); - } - if ($url = $user->getVar('url')) { - $userbar["url"] = array("link" => "javascript:void window.open('" . $url . "', 'new');", "name" => _MD_WWW); - } - if ($icq = $user->getVar('user_icq')) { - $userbar["icq"] = array("link" => "javascript:void window.open('http://wwp.icq.com/scripts/search.dll?to=" . $icq."', 'new');", "name" => _MD_ICQ); - } - if ($aim = $user->getVar('user_aim')) { - $userbar["aim"]= array("link" => "javascript:void window.open('aim:goim?screenname=" . $aim . "&message=Hi+" . $aim . "+Are+you+there?" . "', 'new');", "name" => _MD_AIM); - } - if ($yim = $user->getVar('user_yim')) { - $userbar["yim"] = array("link" => "javascript:void window.open('http://edit.yahoo.com/config/send_webmesg?.target=" . $yim . "&.src=pg" . "', 'new');", "name" => _MD_YIM); - } - if ($msn = $user->getVar('user_msnm')) { - $userbar["msnm"] = array("link" => "javascript:void window.open('http://members.msn.com?mem=" . $msn . "', 'new');", "name" => _MD_MSNM); - } - - return $userbar; - } - - function getLevel() - { - global $xoopsModuleConfig, $forumUrl; - - $level = newbb_calculateLevel($this->user->getVar("posts"), $this->user->getVar("user_regdate")); - $info=''; - if ($xoopsModuleConfig['user_level'] == 2) { - static $rpg_images; - if (!isset($rpg_images)) { - $icon_handler = newbb_getIconHandler(); - $rpg_path = $icon_handler->getPath("rpg"); - foreach (array("img_left", "img_backing", "img_right", "blue", "green", "orange") as $img) { - $rpg_images[$img] = XOOPS_URL . '/' . $rpg_path . '/'.$img.'.gif'; - } - } - $table = "<table class='userlevel'><tr><td class='end'><img src='" . $rpg_images['img_left'] . "' alt='' /></td><td class='center' background='" . $rpg_images['img_backing'] . "'><img src='%s' width='%d' alt='' align='left' /></td><td><img src='" . $rpg_images['img_right'] . "' alt='' /></td></tr></table>"; - - $info = _MD_LEVEL . " " . $level['level'] . "<br />" . _MD_HP . " " . $level['hp'] . " / " . $level['hp_max'] . "<br />". - sprintf($table, $rpg_images["orange"], $level['hp_width']); - $info .= _MD_MP . " " . $level['mp'] . " / " . $level['mp_max'] . "<br />". - sprintf($table, $rpg_images["green"], $level['mp_width']); - $info .= _MD_EXP . " " . $level['exp'] . "<br />". - sprintf($table, $rpg_images["blue"], $level['exp_width']); - } else { - $info = _MD_LEVEL . " " . $level['level'] . "; ". _MD_EXP . " " . $level['exp'] . "<br />"; - $info .= _MD_HP . " " . $level['hp'] . " / " . $level['hp_max'] . "<br />"; - $info .= _MD_MP . " " . $level['mp'] . " / " . $level['mp_max']; - } - return $info; - } - - function getInfo(&$user) - { - global $xoopsModuleConfig, $myts; - static $name_anonymous; - - if ( !(is_object($user)) || !($user->isActive()) ) { - if (!isset($name_anonymous)) { - $name_anonymous = $myts->HtmlSpecialChars($GLOBALS["xoopsConfig"]['anonymous']); - } - return array("name" => $name_anonymous, "link" => $name_anonymous); - } - - $this->user = $user; - - $userinfo["uid"] = $user->getVar("uid"); - - $name = empty($xoopsModuleConfig['show_realname']) ? $user->getVar('uname') : $user->getVar('name'); - $userinfo["name"] = $name ? $name : $user->getVar('uname'); - - $userinfo["link"] = "<a href=\"".XOOPS_URL . "/userinfo.php?uid=" . $user->getVar("uid") ."\">".$userinfo["name"]."</a>"; - - $userinfo["avatar"] = $user->getVar('user_avatar'); - - $userinfo["from"] = $user->getVar('user_from'); - - mod_loadFunctions("time", "newbb"); - $userinfo["regdate"] = newbb_formatTimestamp($user->getVar('user_regdate'), 'reg'); - - $userinfo["posts"] = $user->getVar('posts'); - - if (!empty($xoopsModuleConfig['user_level'])) { - $userinfo["level"] = $this->getLevel(); - } - - if (!empty($xoopsModuleConfig['userbar_enabled'])) { - $userinfo["userbar"] = $this->getUserbar(); - } - - $userinfo["signature"] = $user->getVar('user_sig'); - return $userinfo; - } -} - -class NewbbUserHandler -{ - var $enableGroup; - var $enableOnline; - var $userlist = array(); - var $users = array(); - //var $online = array(); - - function NewbbUserHandler($enableGroup = true, $enableOnline = true) - { - $this->enableGroup = $enableGroup; - $this->enableOnline = $enableOnline; - } - - function loadUserInfo() - { - @include_once XOOPS_ROOT_PATH."/modules/".$GLOBALS["xoopsModule"]->getVar("dirname", "n")."/language/".$GLOBALS["xoopsConfig"]["language"]."/user.php"; - if (class_exists("User_language")) { - $handler = new User_language(); - } else { - $handler = new newbbUser(); - } - foreach (array_keys($this->users) as $uid) { - $this->userlist[$uid] = $handler->getInfo($this->users[$uid]); - } - } - - function loadUserOnline() - { - if (empty($this->users) || !$this->enableOnline) return; - mod_loadFunctions("render", "newbb"); - $image_online = newbb_displayImage('online', _MD_ONLINE); - $image_offline = newbb_displayImage('offline',_MD_OFFLINE); - - $online_handler =& xoops_getmodulehandler('online', 'newbb'); - $onlines = $online_handler->checkStatus(array_keys($this->users)); - - foreach (array_keys($this->users) as $uid) { - $this->userlist[$uid]["status"] = empty($onlines[$uid]) ? $image_offline : $image_online; - } - } - - function loadUserGroups() - { - GLOBAL $xoopsDB; - - if (empty($this->users) || !$this->enableGroup) return; - - $groups = array(); - $member_handler =& xoops_gethandler('member'); - $groups_obj = $member_handler->getGroups(); - $count = count($groups_obj); - for ($i = 0; $i < $count; $i++) { - $groups[$groups_obj[$i]->getVar('groupid')] = $groups_obj[$i]->getVar('name'); - } - unset($groups_obj); - - $sql = 'SELECT groupid, uid FROM ' . $xoopsDB->prefix('groups_users_link') . " WHERE uid IN( " . implode(", ", array_keys($this->users)) . ")"; - $result = $xoopsDB->query($sql); - while ($myrow = $xoopsDB->fetchArray($result)) { - $this->userlist[$myrow['uid']]["groups"][] = $groups[$myrow['groupid']]; - } - } - - function loadUserDigest() - { - GLOBAL $xoopsDB; - - if (empty($this->users)) return; - - $sql = 'SELECT user_digests, uid FROM ' . $xoopsDB->prefix('bb_user_stats') . " WHERE uid IN( " . implode(", ", array_keys($this->users)) . ")"; - $result = $xoopsDB->query($sql); - while ($myrow = $xoopsDB->fetchArray($result)) { - $this->userlist[$myrow['uid']]["digests"] = intval( $myrow['user_digests'] ); - } - } - - function loadUserRank() - { - GLOBAL $xoopsDB; - - if (empty($this->users)) return; - $myts =& MyTextSanitizer::getInstance(); - - $sql = 'SELECT * FROM ' . $xoopsDB->prefix('ranks'); - $result = $xoopsDB->query($sql); - while ($myrow = $xoopsDB->fetchArray($result)) { - $ranks[$myrow['rank_id']] = $myrow; - $ranks[$myrow['rank_id']]["rank_title"] = $myts->htmlspecialchars($ranks[$myrow['rank_id']]["rank_title"]); - if (!empty($ranks[$myrow['rank_id']]['rank_image'])) { - $ranks[$myrow['rank_id']]['rank_image'] = "<img src='" . XOOPS_UPLOAD_URL . "/ranks/" . htmlspecialchars($ranks[$myrow['rank_id']]['rank_image'], ENT_QUOTES) . "' alt='' />"; - } - } - - foreach (array_keys($this->userlist) as $uid) { - if ($rank = $this->users[$uid]->getVar("rank")) { - $this->userlist[$uid]["rank"]["title"] = $ranks[$rank]["rank_title"]; - $this->userlist[$uid]["rank"]["image"] = $ranks[$rank]["rank_image"]; - continue; - } - foreach ($ranks as $id => $rank) { - if ($rank["rank_min"] <= $this->userlist[$uid]["posts"] && $rank["rank_max"] >= $this->userlist[$uid]["posts"]) { - $this->userlist[$uid]["rank"]["title"] = $rank["rank_title"]; - $this->userlist[$uid]["rank"]["image"] = $rank["rank_image"]; - break; - } - } - } - } - - function getUsers() - { - $this->loadUserInfo(); - $this->loadUserOnline(); - $this->loadUserGroups(); - $this->loadUserRank(); - $this->loadUserDigest(); - - return $this->userlist; - } -} - +<?php +/** + * CBB 4.0, or newbb, the forum module for XOOPS project + * + * @copyright The XOOPS Project http://xoops.sf.net + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @author Taiwen Jiang (phppp or D.J.) <ph...@us...> + * @since 4.00 + * @version $Id $ + * @package module::newbb + */ + +if (!defined("XOOPS_ROOT_PATH")) { + exit(); +} + +defined("NEWBB_FUNCTIONS_INI") || include XOOPS_ROOT_PATH.'/modules/newbb/include/functions.ini.php'; + +function newbb_calculateLevel($RPG, $RPGDIFF) +{ + + //$RPG = $user->getVar('posts'); + //$RPGDIFF = $user->getVar('user_regdate'); + + $today = time(); + $diff = $today - $RPGDIFF; + $exp = round($diff / 86400,0); + if ($exp <= 0) { $exp = 1; } + $ppd= round($RPG / $exp, 0); + $level = pow (log10 ($RPG), 3); + $ep = floor (100 * ($level - floor ($level))); + $showlevel = floor ($level + 1); + $hpmulti =round ($ppd / 6, 1); + if ($hpmulti > 1.5) { $hpmulti = 1.5; } + if ($hpmulti < 1) { $hpmulti = 1; } + $maxhp = $level * 25 * $hpmulti; + $hp= $ppd / 5; + if ($hp >= 1) { + $hp= $maxhp; + } else { + $hp= floor ($hp * $maxhp); + } + $hp= floor ($hp); + $maxhp= floor ($maxhp); + if ($maxhp <= 0) { + $zhp = 1; + } else { + $zhp = $maxhp; + } + $hpf= floor (100 * ($hp / $zhp)) - 1; + $maxmp= ($exp * $level) / 5; + $mp= $RPG / 3; + if ($mp >= $maxmp) { $mp = $maxmp; } + $maxmp = floor ($maxmp); + $mp = floor ($mp); + if ($maxmp <= 0) { + $zmp = 1; + } else { + $zmp = $maxmp; + } + $mpf= floor (100 * ($mp / $zmp)) - 1; + if ( $hpf >= 98 ) { $hpf = $hpf - 2; } + if ( $ep >= 98 ) { $ep = $ep - 2; } + if ( $mpf >= 98 ) { $mpf = $mpf - 2; } + + $level = array(); + $level['level'] = $showlevel ; + $level['exp'] = $ep; + $level['exp_width'] = $ep.'%'; + $level['hp'] = $hp; + $level['hp_max'] = $maxhp; + $level['hp_width'] = $hpf.'%'; + $level['mp'] = $mp; + $level['mp_max'] = $maxmp; + $level['mp_width'] = $mpf.'%'; + + return $level; +} + +class newbbUser { + var $user = null; + + function User() + { + } + + function getUserbar() + { + global $xoopsModuleConfig, $xoopsUser, $isadmin; + + $userbar = array(); + if (empty($xoopsModuleConfig['userbar_enabled'])) return $userbar; + + $user = $this->user; + $userbar["profile"] = array("link" => XOOPS_URL . "/userinfo.php?uid=" . $user->getVar("uid"), "name" => _PROFILE); + + if (is_object($xoopsUser)) { + $userbar["pm"] = array("link" => "javascript:void openWithSelfMain('" . XOOPS_URL . "/pmlite.php?send2=1&to_userid=" . $user->getVar("uid") . "', 'pmlite', 450, 380);", "name" => _MD_PM); + } + if ($user->getVar('user_viewemail') || $isadmin) { + $userbar["email"] = array("link" => "javascript:void window.open('mailto:" . $user->getVar('email') . "', 'new');", "name" => _MD_EMAIL); + } + if ($url = $user->getVar('url')) { + $userbar["url"] = array("link" => "javascript:void window.open('" . $url . "', 'new');", "name" => _MD_WWW); + } + if ($icq = $user->getVar('user_icq')) { + $userbar["icq"] = array("link" => "javascript:void window.open('http://wwp.icq.com/scripts/search.dll?to=" . $icq."', 'new');", "name" => _MD_ICQ); + } + if ($aim = $user->getVar('user_aim')) { + $userbar["aim"]= array("link" => "javascript:void window.open('aim:goim?screenname=" . $aim . "&message=Hi+" . $aim . "+Are+you+there?" . "', 'new');", "name" => _MD_AIM); + } + if ($yim = $user->getVar('user_yim')) { + $userbar["yim"] = array("link" => "javascript:void window.open('http://edit.yahoo.com/config/send_webmesg?.target=" . $yim . "&.src=pg" . "', 'new');", "name" => _MD_YIM); + } + if ($msn = $user->getVar('user_msnm')) { + $userbar["msnm"] = array("link" => "javascript:void window.open('http://members.msn.com?mem=" . $msn . "', 'new');", "name" => _MD_MSNM); + } + + return $userbar; + } + + function getLevel() + { + global $xoopsModuleConfig, $forumUrl; + + $level = newbb_calculateLevel($this->user->getVar("posts"), $this->user->getVar("user_regdate")); + $info=''; + if ($xoopsModuleConfig['user_level'] == 2) { + static $rpg_images; + if (!isset($rpg_images)) { + $icon_handler = newbb_getIconHandler(); + $rpg_path = $icon_handler->getPath("rpg"); + foreach (array("img_left", "img_backing", "img_right", "blue", "green", "orange") as $img) { + $rpg_images[$img] = XOOPS_URL . '/' . $rpg_path . '/'.$img.'.gif'; + } + } + $table = "<table class='userlevel'><tr><td class='end'><img src='" . $rpg_images['img_left'] . "' alt='' /></td><td class='center' background='" . $rpg_images['img_backing'] . "'><img src='%s' width='%d' alt='' align='left' /></td><td><img src='" . $rpg_images['img_right'] . "' alt='' /></td></tr></table>"; + + $info = _MD_LEVEL . " " . $level['level'] . "<br />" . _MD_HP . " " . $level['hp'] . " / " . $level['hp_max'] . "<br />". + sprintf($table, $rpg_images["orange"], $level['hp_width']); + $info .= _MD_MP . " " . $level['mp'] . " / " . $level['mp_max'] . "<br />". + sprintf($table, $rpg_images["green"], $level['mp_width']); + $info .= _MD_EXP . " " . $level['exp'] . "<br />". + sprintf($table, $rpg_images["blue"], $level['exp_width']); + } else { + $info = _MD_LEVEL . " " . $level['level'] . "; ". _MD_EXP . " " . $level['exp'] . "<br />"; + $info .= _MD_HP . " " . $level['hp'] . " / " . $level['hp_max'] . "<br />"; + $info .= _MD_MP . " " . $level['mp'] . " / " . $level['mp_max']; + } + return $info; + } + + function getInfo(&$user) + { + global $xoopsModuleConfig, $myts; + static $name_anonymous; + + if ( !(is_object($user)) || !($user->isActive()) ) { + if (!isset($name_anonymous)) { + $name_anonymous = $myts->HtmlSpecialChars($GLOBALS["xoopsConfig"]['anonymous']); + } + return array("name" => $name_anonymous, "link" => $name_anonymous); + } + + $this->user = $user; + + $userinfo["uid"] = $user->getVar("uid"); + + $name = empty($xoopsModuleConfig['show_realname']) ? $user->getVar('uname') : $user->getVar('name'); + $userinfo["name"] = $name ? $name : $user->getVar('uname'); + + $userinfo["link"] = "<a href=\"".XOOPS_URL . "/userinfo.php?uid=" . $user->getVar("uid") ."\">".$userinfo["name"]."</a>"; + + $userinfo["avatar"] = $user->getVar('user_avatar'); +// START hacked by irmtfan - easier rank getting + $userrank = $user->rank(); + if (isset($userrank['image']) && $userrank['image']) { + $userinfo["rank_image"] = $userrank['image']; + $userinfo["rank_title"] = $userrank['title']; + } +// END hacked by irmtfan - easier rank getting + + $userinfo["from"] = $user->getVar('user_from'); + + mod_loadFunctions("time", "newbb"); + $userinfo["regdate"] = newbb_formatTimestamp($user->getVar('user_regdate'), 'reg'); + + $userinfo["posts"] = $user->getVar('posts'); + + if (!empty($xoopsModuleConfig['user_level'])) { + $userinfo["level"] = $this->getLevel(); + } + + if (!empty($xoopsModuleConfig['userbar_enabled'])) { + $userinfo["userbar"] = $this->getUserbar(); + } + + $userinfo["signature"] = $user->getVar('user_sig'); + return $userinfo; + } +} + +class NewbbUserHandler +{ + var $enableGroup; + var $enableOnline; + var $userlist = array(); + var $users = array(); + //var $online = array(); + + function NewbbUserHandler($enableGroup = true, $enableOnline = true) + { + $this->enableGroup = $enableGroup; + $this->enableOnline = $enableOnline; + } + + function loadUserInfo() + { + @include_once XOOPS_ROOT_PATH."/modules/".$GLOBALS["xoopsModule"]->getVar("dirname", "n")."/language/".$GLOBALS["xoopsConfig"]["language"]."/user.php"; + if (class_exists("User_language")) { + $handler = new User_language(); + } else { + $handler = new newbbUser(); + } + foreach (array_keys($this->users) as $uid) { + $this->userlist[$uid] = $handler->getInfo($this->users[$uid]); + } + } + + function loadUserOnline() + { + if (empty($this->users) || !$this->enableOnline) return; + mod_loadFunctions("render", "newbb"); + $image_online = newbb_displayImage('online', _MD_ONLINE); + $image_offline = newbb_displayImage('offline',_MD_OFFLINE); + + $online_handler =& xoops_getmodulehandler('online', 'newbb'); + $onlines = $online_handler->checkStatus(array_keys($this->users)); + + foreach (array_keys($this->users) as $uid) { + $this->userlist[$uid]["status"] = empty($onlines[$uid]) ? $image_offline : $image_online; + } + } + + function loadUserGroups() + { + GLOBAL $xoopsDB; + + if (empty($this->users) || !$this->enableGroup) return; + + $groups = array(); + $member_handler =& xoops_gethandler('member'); + $groups_obj = $member_handler->getGroups(); + $count = count($groups_obj); + for ($i = 0; $i < $count; $i++) { + $groups[$groups_obj[$i]->getVar('groupid')] = $groups_obj[$i]->getVar('name'); + } + unset($groups_obj); + + $sql = 'SELECT groupid, uid FROM ' . $xoopsDB->prefix('groups_users_link') . " WHERE uid IN( " . implode(", ", array_keys($this->users)) . ")"; + $result = $xoopsDB->query($sql); + while ($myrow = $xoopsDB->fetchArray($result)) { + $this->userlist[$myrow['uid']]["groups"][] = $groups[$myrow['groupid']]; + } + } + + function loadUserDigest() + { + GLOBAL $xoopsDB; + + if (empty($this->users)) return; + + $sql = 'SELECT user_digests, uid FROM ' . $xoopsDB->prefix('bb_user_stats') . " WHERE uid IN( " . implode(", ", array_keys($this->users)) . ")"; + $result = $xoopsDB->query($sql); + while ($myrow = $xoopsDB->fetchArray($result)) { + $this->userlist[$myrow['uid']]["digests"] = intval( $myrow['user_digests'] ); + } + } +// START irmtfan remove function +// function loadUserRank() +// { +// return true; +// } +// END irmtfan remove function + + function getUsers() + { + $this->loadUserInfo(); + $this->loadUserOnline(); + $this->loadUserGroups(); + // irmtfan removed $this->loadUserRank(); + $this->loadUserDigest(); + + return $this->userlist; + } +} + ?> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/docs/changelog.txt =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/docs/changelog.txt 2012-07-30 11:20:19 UTC (rev 9947) +++ XoopsModules/newbb/branches/irmtfan/newbb/docs/changelog.txt 2012-07-30 11:25:09 UTC (rev 9948) @@ -20,6 +20,25 @@ 16 Fix Link to Blank.gif 17 Fix Error Upload File too large +18- bug fix: edit not displayed when the reason is not filled (irmtfan) +19- bug fix: only the last edit is recorded. (irmtfan/alfred) +in newbb/class/post.php + +20- bug fix: 'noapprove' permission incorrectly recorded in database. (irmtfan) +in newbb/class/permission.php + +21- bug fix: load user ranks has been hardcoded. it works in old/upgraded websites but not works in new installed websites. a new getting rank introduced. (black_beard/irmtfan) +in newbb/class/user.php, newbb/templates/newbb_thread.html + +22- minor bug fix: mysql 5.1 was incorrectly needed (irmtfan) +in newbb/xoops_version.php + +23- hardcode: some style.css color hardcodes has been removed. (irmtfan) +in newbb/templates/style.css + +24- feature added: text links instead of buttons. (deka87/irmtfan) +in newbb/class/icon.php , newbb/include/functions.render.php , newbb/include/plugin.php + newBB Changelog 4.2 02/08/2012 Modified: XoopsModules/newbb/branches/irmtfan/newbb/include/functions.render.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/include/functions.render.php 2012-07-30 11:20:19 UTC (rev 9947) +++ XoopsModules/newbb/branches/irmtfan/newbb/include/functions.render.php 2012-07-30 11:25:09 UTC (rev 9948) @@ -96,6 +96,13 @@ function newbb_displayImage($image, $alt = "", $display = true, $extra = "class='forum_icon'") { $icon_handler = newbb_getIconHandler(); + // START hacked by irmtfan + // to show text links instead of buttons + global $xoopsModuleConfig; + if (!empty($xoopsModuleConfig['display_text_links'])){ + $display=false; + } + // END hacked by irmtfan if (empty($display)) { return $icon_handler->assignImage($image, $alt, $extra); } else { Modified: XoopsModules/newbb/branches/irmtfan/newbb/include/plugin.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/include/plugin.php 2012-07-30 11:20:19 UTC (rev 9947) +++ XoopsModules/newbb/branches/irmtfan/newbb/include/plugin.php 2012-07-30 11:25:09 UTC (rev 9948) @@ -1,84 +1,87 @@ -<?php -/** - * CBB 4.0, or newbb, the forum module for XOOPS project - * - * @copyright The XOOPS Project http://xoops.sf.net - * @license http://www.fsf.org/copyleft/gpl.html GNU public license - * @author Taiwen Jiang (phppp or D.J.) <ph...@us...> - * @since 4.00 - * @version $Id $ - * @package module::newbb - */ - -if (!defined('XOOPS_ROOT_PATH')) { - exit(); -} -/* some static xoopsModuleConfig */ -$customConfig = array(); - -// specification for custom time format -// default manner will be used if not specified -$customConfig["formatTimestamp_custom"] = ""; // Could be set as "Y-m-d H:i" - -// requiring "name" field for anonymous users in edit form -$customConfig["require_name"] = true; - -// display "register or login to post" for anonymous users -$customConfig["show_reg"] = true; - -// perform forum/topic synchronization on module update -$customConfig["syncOnUpdate"] = true; - -// time for pending/deleted topics/posts, expired one will be removed automatically, in days; 0 or no cleanup -$customConfig["pending_expire"] = 0; - -// redirect to its URI of an attachment when requested -// Set to true if your attachment would be corrupted after download with normal way -$customConfig["download_direct"] = false; - -// Set allowed editors -// Should set from module preferences? -$customConfig["editor_allowed"] = array(); - -// Set the default editor -$customConfig["editor_default"] = "dhtmltextarea"; - -// Set the default editor for quick reply -$customConfig["editor_quick_default"] = "textarea"; - -// default value for editor rows, coloumns -$customConfig["editor_rows"] = 15; -$customConfig["editor_cols"] = 40; - -// default value for editor width, height (string) -$customConfig["editor_width"] = "100%"; -$customConfig["editor_height"] = "400px"; - -// storage method for reading records: 0 - none; 1 - cookie; 2 - db -$customConfig["read_mode"] = 2; - -// expire time for reading records, in days -$customConfig["read_expire"] = 30; - -// maximum records per forum for one user -$customConfig["read_items"] = 100; - -// Enable tag system -$customConfig["do_tag"] = 1; - -// Count posts counts of subfourms -$customConfig["count_subforum"] = 1; - -// Length for post title on index page: 0 for not showing post title, 255 for not truncate -$customConfig["length_title_index"] = 40; - -// MENU handler -/* You could remove anyone by commenting out in order to disable it */ -$customConfig["valid_menumodes"] = array( - 0 => _MD_MENU_SELECT, // for selectbox - //1 => _MD_MENU_CLICK, // for "click to expand" - //2 => _MD_MENU_HOVER // for "mouse hover to expand" - ); - -return $customConfig; +<?php +/** + * CBB 4.0, or newbb, the forum module for XOOPS project + * + * @copyright The XOOPS Project http://xoops.sf.net + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @author Taiwen Jiang (phppp or D.J.) <ph...@us...> + * @since 4.00 + * @version $Id $ + * @package module::newbb + */ + +if (!defined('XOOPS_ROOT_PATH')) { + exit(); +} +/* some static xoopsModuleConfig */ +$customConfig = array(); + +// specification for custom time format +// default manner will be used if not specified +$customConfig["formatTimestamp_custom"] = ""; // Could be set as "Y-m-d H:i" + +// requiring "name" field for anonymous users in edit form +$customConfig["require_name"] = true; + +// display "register or login to post" for anonymous users +$customConfig["show_reg"] = true; + +// perform forum/topic synchronization on module update +$customConfig["syncOnUpdate"] = true; + +// time for pending/deleted topics/posts, expired one will be removed automatically, in days; 0 or no cleanup +$customConfig["pending_expire"] = 0; + +// redirect to its URI of an attachment when requested +// Set to true if your attachment would be corrupted after download with normal way +$customConfig["download_direct"] = false; + +// Set allowed editors +// Should set from module preferences? +$customConfig["editor_allowed"] = array(); + +// Set the default editor +$customConfig["editor_default"] = "dhtmltextarea"; + +// Set the default editor for quick reply +$customConfig["editor_quick_default"] = "textarea"; + +// default value for editor rows, coloumns +$customConfig["editor_rows"] = 15; +$customConfig["editor_cols"] = 40; + +// default value for editor width, height (string) +$customConfig["editor_width"] = "100%"; +$customConfig["editor_height"] = "400px"; + +// storage method for reading records: 0 - none; 1 - cookie; 2 - db +$customConfig["read_mode"] = 2; + +// expire time for reading records, in days +$customConfig["read_expire"] = 30; + +// maximum records per forum for one user +$customConfig["read_items"] = 100; + +// Enable tag system +$customConfig["do_tag"] = 1; + +// Count posts counts of subfourms +$customConfig["count_subforum"] = 1; + +// Length for post title on index page: 0 for not showing post title, 255 for not truncate +$customConfig["length_title_index"] = 40; + +// MENU handler +/* You could remove anyone by commenting out in order to disable it */ +$customConfig["valid_menumodes"] = array( + 0 => _MD_MENU_SELECT, // for selectbox + //1 => _MD_MENU_CLICK, // for "click to expand" + //2 => _MD_MENU_HOVER // for "mouse hover to expand" + ); +// START hacked by irmtfan +// Display text links instead of image buttons for edit, reply, .... set true or false +$customConfig["display_text_links"] = false; +// END hacked by irmtfan +return $customConfig; ?> \ No newline at end of file Added: XoopsModules/newbb/branches/irmtfan/newbb/language/persian/admin.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/language/persian/admin.php (rev 0) +++ XoopsModules/newbb/branches/irmtfan/newbb/language/persian/admin.php 2012-07-30 11:25:09 UTC (rev 9948) @@ -0,0 +1,297 @@ +<?php +// $Id: admin.php,v 1.3 2005/10/19 17:20:33 phppp Exp $ + +if(defined('NEWBB_ADMIN_DEFINED')) return; +else define('NEWBB_ADMIN_DEFINED',true); + +//%%%%%% File Name index.php %%%%% +define("_AM_NEWBB_FORUMCONF","تنظیمات انجمن"); +define("_AM_NEWBB_ADDAFORUM","اضافه کردن یکانجمن"); +define("_AM_NEWBB_SYNCFORUM","همگام سازی انجمن"); +define("_AM_NEWBB_REORDERFORUM","مرتب سازی دوباره"); +define("_AM_NEWBB_FORUM_MANAGER","انجمنها"); +define("_AM_NEWBB_PRUNE_TITLE","هرس کردن"); +define("_AM_NEWBB_CATADMIN","شاخهها"); +define("_AM_NEWBB_GENERALSET", "تنظیمات ماژول" ); +define("_AM_NEWBB_MODULEADMIN","مدیریت ماژول:"); +define("_AM_NEWBB_HELP","کمک"); +define("_AM_NEWBB_ABOUT","درباره"); +define("_AM_NEWBB_BOARDSUMMARY","آمار Board"); +define("_AM_NEWBB_PENDING_POSTS_FOR_AUTH","تایید پستهای معلق"); +define("_AM_NEWBB_POSTID","ID پست"); +define("_AM_NEWBB_POSTDATE","تاریخ پست"); +define("_AM_NEWBB_POSTER","فرستنده"); +define("_AM_NEWBB_TOPICS","تاپیکها"); +define("_AM_NEWBB_SHORTSUMMARY","خلاصهی Board"); +define("_AM_NEWBB_TOTALPOSTS","مجموع پستها"); +define("_AM_NEWBB_TOTALTOPICS","مجموع تاپیکها"); +define("_AM_NEWBB_TOTALVIEWS","مجموع دیده شدهها"); +define("_AM_NEWBB_BLOCKS","بلاکها"); +define("_AM_NEWBB_SUBJECT","عنوان"); +define("_AM_NEWBB_APPROVE","تایید پست"); +define("_AM_NEWBB_APPROVETEXT","محتوای این پست"); +define("_AM_NEWBB_POSTAPPROVED","این پست تایید شد"); +define("_AM_NEWBB_POSTNOTAPPROVED","پست تایید نشد"); +define("_AM_NEWBB_POSTSAVED","پست ذخیره شد"); +define("_AM_NEWBB_POSTNOTSAVED","پست ذخیره نشد"); +define("_AM_NEWBB_TOPICAPPROVED","تاپیک تایید شد"); +define("_AM_NEWBB_TOPICNOTAPPROVED","تاپیکتایید نشد"); +define("_AM_NEWBB_TOPICID","ID تاپیک"); +define("_AM_NEWBB_ORPHAN_TOPICS_FOR_AUTH","تایید نکردن تاپیکهای ارسال شده"); +define('_AM_NEWBB_DEL_ONE','فقط این پیام را پاککن'); +define('_AM_NEWBB_POSTSDELETED','پیام انتخاب شده حذف شد'); +define('_AM_NEWBB_NOAPPROVEPOST','در حال حاضر هیچ پست منتظر برای تایید موجود نیست.'); +define('_AM_NEWBB_SUBJECTC','عنوان:'); +define('_AM_NEWBB_MESSAGEICON','شکلکپیام:'); +define('_AM_NEWBB_MESSAGEC','پیام:'); +define('_AM_NEWBB_CANCELPOST','لغو کردن ارسال'); +define('_AM_NEWBB_GOTOMOD','برو به ماژول'); +define('_AM_NEWBB_PREFERENCES','تنظیمات ماژول'); +define('_AM_NEWBB_POLLMODULE','ماژول Xoops poll'); +define('_AM_NEWBB_POLL_OK','آماده برای استفاده'); +define('_AM_NEWBB_GDLIB1','GD1 library:'); +define('_AM_NEWBB_GDLIB2','GD2 library:'); +define('_AM_NEWBB_AUTODETECTED','شناسایی خودکار: '); +define('_AM_NEWBB_AVAILABLE','آمادهاست'); +define('_AM_NEWBB_NOTAVAILABLE','<font color="red">آماده نیست</font>'); +define('_AM_NEWBB_NOTWRITABLE','<font color="red">قابل دسترسی نیست</font>'); +define('_AM_NEWBB_IMAGEMAGICK','ImageMagicK'); +define('_AM_NEWBB_IMAGEMAGICK_NOTSET','تنظیمنشده'); +define('_AM_NEWBB_ATTACHPATH','مسیر برای قرار دادن ضمائم'); +define('_AM_NEWBB_THUMBPATH','مسیر برای قرار دادن تصاویر تمبری'); +//define('_AM_NEWBB_RSSPATH','مسیر برای RSS feed'); +define('_AM_NEWBB_REPORT','پیامهای گزارش داده شده'); +define('_AM_NEWBB_REPORT_PENDING','گزارشهای معلق'); +define('_AM_NEWBB_REPORT_PROCESSED','گزارشهای پردازش شده'); +define('_AM_NEWBB_CREATETHEDIR','بساز'); +define('_AM_NEWBB_SETMPERM','گذاشتن دسترسی ها'); +define('_AM_NEWBB_DIRCREATED','شاخه ساخته شد'); +define('_AM_NEWBB_DIRNOTCREATED','شاخه شاخته نشد'); +define('_AM_NEWBB_PERMSET','دسترسی تنظیم شد'); +define('_AM_NEWBB_PERMNOTSET','دسترسی تنظیم نشد'); +define('_AM_NEWBB_DIGEST','آگهای رسانی خلاصه ها'); +define('_AM_NEWBB_DIGEST_PAST','<font color="red"> %d دقیقه پیش گذاشته شده است</font>'); +define('_AM_NEWBB_DIGEST_NEXT',' %d دقیقه دیگر فرستاده می شود'); +define('_AM_NEWBB_DIGEST_ARCHIVE','خلاصه در آرشیو قرار گرفت'); +define('_AM_NEWBB_DIGEST_SENT','خلاصه در حال فرستاده شدن'); +define('_AM_NEWBB_DIGEST_FAILED','خلاصه فرستاده نشد'); + +// admin_forum_manager.php +define("_AM_NEWBB_NAME","نام"); +define("_AM_NEWBB_CREATEFORUM","ایجاد انجمن"); +define("_AM_NEWBB_EDIT","ویرایش"); +define("_AM_NEWBB_CLEAR","پاک کردن گزینه ها"); +define("_AM_NEWBB_DELETE","حذف"); +define("_AM_NEWBB_ADD","اضافهکردن"); +define("_AM_NEWBB_MOVE","انتقال"); +define("_AM_NEWBB_ORDER","ردیفکردن"); +define("_AM_NEWBB_TWDAFAP","این قسمت انجمن و تمام پیامهای زده شده در آن را حذف خواهد کرد.<br><br>هشدار: آیا مطمئنید که این انجمن را میخواهید پاککنید؟"); +define("_AM_NEWBB_FORUMREMOVED","انجمن پاکشد."); +define("_AM_NEWBB_CREATENEWFORUM","ایجاد یکانجمن جدید"); +define("_AM_NEWBB_EDITTHISFORUM","ویرایش انجمن:"); +define("_AM_NEWBB_SET_FORUMORDER","تنظیم محل قرارگیری انجمن:"); +define("_AM_NEWBB_ALLOWPOLLS","اجازهدادن نظرسنجیها:"); +define("_AM_NEWBB_ATTACHMENT_SIZE" ,"حداکثر سایز ممکن بر حسب KB:"); +define("_AM_NEWBB_ALLOWED_EXTENSIONS", "پسوند های مجاز:<span style='font-size: xx-small; font-weight: normal; display: block;'>'*' یعنی بدون محدودیت. برای جدا کردن از نشان '|' استفاده کنید.</span>"); +define("_AM_NEWBB_ALLOW_ATTACHMENTS", "اجازه دادن پیوست:"); +define("_AM_NEWBB_ALLOWHTML","اجازه دادن استفاده از HTML:"); +define("_AM_NEWBB_YES","بله"); +define("_AM_NEWBB_NO","خیر"); +define("_AM_NEWBB_ALLOWSIGNATURES","اجازه دادن استفاده از امضا:"); +define("_AM_NEWBB_HOTTOPICTHRESHOLD","تعداد عنوان های مهم:"); +//define("_AM_NEWBB_POSTPERPAGE","تعداد پستها در صفحه<span style='font-size: xx-small; font-weight: normal; display: block;'>(این گزینه تعداد پستها را<br> در عنوان نشان می دهد که<br> در هر صفحه اتز عنوان وجود دارد)</span>"); +//define("_AM_NEWBB_TOPICPERFORUM","تعداد عنوان ها در انجمن<span style='font-size: xx-small; font-weight: normal; display: block;'>(این گزینه تعداد عنوان ها را در انجمن نشان می دهد<br> که در هر صفحه از انجمن<br> این تعداد عنوان وجود دارد)</span>"); +//define("_AM_NEWBB_SHOWNAME","جایگزینی نام کاربری با نام واقعی:"); +//define("_AM_NEWBB_SHOWICONSPANEL","نمایش پنل شکلکها:"); +//define("_AM_NEWBB_SHOWSMILIESPANEL","نمایش پنل Smiley ها:"); +define("_AM_NEWBB_MODERATOR_REMOVE","حذف ناظر های کنونی"); +define("_AM_NEWBB_MODERATOR_ADD","اظافه کردن ناظر"); + +// admin_cat_manager.php +define("_AM_NEWBB_SETCATEGORYORDER","تنظیم محل شاخه:"); +define("_AM_NEWBB_ACTIVE","فعال"); +define("_AM_NEWBB_INACTIVE","غیرفعال"); +define("_AM_NEWBB_STATE","وضعیت:"); +define("_AM_NEWBB_CATEGORYDESC","توضیحات شاخه:"); +define("_AM_NEWBB_SHOWDESC","نمایش دادن توضیحات؟"); +define("_AM_NEWBB_IMAGE","تصویر:"); +//define("_AM_NEWBB_SPONSORIMAGE","تصویر پشتیبان:"); +define("_AM_NEWBB_SPONSORLINK","لینک پشتیبان:"); +define("_AM_NEWBB_DELCAT","حذف شاخه"); +define("_AM_NEWBB_WAYSYWTDTTAL","این قسمت انجمنهای زیر شاخه را پاکنخواهد کرد.<br><br>WARNINGبرای پاککردن آن از ویرایش انجمناقدام کنید. آیا مایلید شاخهرا پاککنید؟"); + +//%%%%%% File Name admin_forums.php %%%%% +define("_AM_NEWBB_FORUMNAME","نام انجمن:"); +define("_AM_NEWBB_FORUMDESCRIPTION","توضیحات انجمن:"); +define("_AM_NEWBB_MODERATOR","ناظرین:"); +define("_AM_NEWBB_REMOVE","حذف"); +define("_AM_NEWBB_CATEGORY","شاخه:"); +define("_AM_NEWBB_DATABASEERROR","خطای دیتابیس"); +define("_AM_NEWBB_CATEGORYUPDATED","شاخه به روز شد."); +define("_AM_NEWBB_EDITCATEGORY","ویرایش شاخه:"); +define("_AM_NEWBB_CATEGORYTITLE","عنوان شاخه:"); +define("_AM_NEWBB_CATEGORYCREATED","شاخه ایجاد شد"); +define("_AM_NEWBB_CREATENEWCATEGORY","ایجاد یک شاخهی جدید"); +define("_AM_NEWBB_FORUMCREATED","انجمن ایجاد شد"); +define("_AM_NEWBB_ACCESSLEVEL","سطح دسترسی کامل:"); +define("_AM_NEWBB_CATEGORY1","شاخه"); +define("_AM_NEWBB_FORUMUPDATE","تنظیمات انجمن به روز شد."); +define("_AM_NEWBB_FORUM_ERROR","خطا: تنظیمات انجمن به روز نشد."); +define("_AM_NEWBB_CLICKBELOWSYNC","کلیک کردن زیر باعث میشود تاپیکها و صفحههای فروم شما با مقداردهی صحیحی از دیتابیس تنظیم شوند. از این بخش هنگامی استفاده کنید که مطلع شدهاید بی نظمی در تعداد تاپیکها و صفحهات وجود دارد. "); +define("_AM_NEWBB_SYNCHING","همزمان کردن صفه اصلی انجمن و انجمن ها (این کار ممکن است مدتی طول بکشد)"); +define("_AM_NEWBB_CATEGORYDELETED","شاخه پاک شد."); +define("_AM_NEWBB_MOVE2CAT","بردن به شاخه:"); +define("_AM_NEWBB_MAKE_SUBFORUM_OF","ایجاد زیرانجمن:"); +define("_AM_NEWBB_MSG_FORUM_MOVED","انجمن منتقل شد."); +define("_AM_NEWBB_MSG_ERR_FORUM_MOVED","ناتوانی در بردن انجمن."); +define("_AM_NEWBB_SELECT","< انتخاب >"); +define("_AM_NEWBB_MOVETHISFORUM","این انجمن را منتقل کن"); +define("_AM_NEWBB_MERGE","ادغام"); +define("_AM_NEWBB_MERGETHISFORUM","این انجمن را ادغام کن"); +define("_AM_NEWBB_MERGETO_FORUM","این انجمن را ادغام کن به:"); +define("_AM_NEWBB_MSG_FORUM_MERGED","انجمن ادغام شد!"); +define("_AM_NEWBB_MSG_ERR_FORUM_MERGED","خطا در ادغام انجمن!"); + +//%%%%%% File Name admin_forum_reorder.php %%%%% +define("_AM_NEWBB_REORDERID","ID"); +define("_AM_NEWBB_REORDERTITLE","عنوان"); +define("_AM_NEWBB_REORDERWEIGHT","محل"); +define("_AM_NEWBB_SETFORUMORDER","تغییر محل قرار گیری انجمن در شاخه"); +define("_AM_NEWBB_BOARDREORDER","مکان انجمن تغییر داده شد"); + +// admin_permission.php +define("_AM_NEWBB_PERMISSIONS_TO_THIS_FORUM","دسترسی تاپیکها برای این انجمن"); +define("_AM_NEWBB_CAT_ACCESS","میتوانید به شاخه دسترسی داشته باشید"); +define("_AM_NEWBB_CAN_ACCESS","میتوانید به انجمن دسترسی داشته باشید"); +define("_AM_NEWBB_CAN_VIEW","میتوانید مطالب را بخوانید"); +define("_AM_NEWBB_CAN_POST","میتوانید عنوان جدید باز کنید"); +define("_AM_NEWBB_CAN_REPLY","میتوانید به عنوان ها پاسخ دهید"); +define("_AM_NEWBB_CAN_EDIT","میتوانید پیامها ی خودتان را ویرایش کنید"); +define("_AM_NEWBB_CAN_DELETE","میتوانید پیامها ی خودتان را حذف کنید"); +define("_AM_NEWBB_CAN_ADDPOLL","میتوانید نظر سنجی اضافه کنید"); +define("_AM_NEWBB_CAN_VOTE","میتوانید در نظر سنجی ها شرکت کنید"); +define("_AM_NEWBB_CAN_ATTACH","میتوانید فایلها را به پیام خود پیوست کنید"); +define("_AM_NEWBB_CAN_NOAPPROVE","میتوانید پیام بدون نیاز به تایید بزنید"); +define("_AM_NEWBB_CAN_TYPE", "میتوانید نوع تاپیک ها را انتخاب کنید"); +define("_AM_NEWBB_CAN_HTML", "میتوانید از HTML استفاده کنید"); +define("_AM_NEWBB_CAN_SIGNATURE", "میتوانید امضا را فعال/غیر فعال کنید"); +define("_AM_NEWBB_ACTION","عمل"); +define("_AM_NEWBB_PERM_TEMPLATE","تمپلیت دسترسی های پیشفرض"); +define("_AM_NEWBB_PERM_TEMPLATE_DESC","میتواند به یک انجمن اضافه شود"); +define("_AM_NEWBB_PERM_FORUMS","انتخاب انجمن ها"); +define("_AM_NEWBB_PERM_TEMPLATE_CREATED","تمپلیت دسترسی ها ساخته شد"); +define("_AM_NEWBB_PERM_TEMPLATE_ERROR","خطا در حین ساخته شدن تمپلیت دسترسی ها"); +define("_AM_NEWBB_PERM_TEMPLATEAPP","اعمال دسترسی های پیشفرض"); +define("_AM_NEWBB_PERM_TEMPLATE_APPLIED","دسترسی های پیشفرض در انجمن ها اعمال شد"); +define("_AM_NEWBB_PERM_ACTION","عمل های دسترسی ها"); +define("_AM_NEWBB_PERM_SETBYGROUP","اعمال دسترسی برای گروه ها به صورت مستقیم"); + +// admin_forum_prune.php +define ("_AM_NEWBB_PRUNE_RESULTS_TITLE","نتیجهی هرسکردن"); +define ("_AM_NEWBB_PRUNE_RESULTS_TOPICS","تاپیک های هرس شده"); +define ("_AM_NEWBB_PRUNE_RESULTS_POSTS","پستهای هرس شده"); +define ("_AM_NEWBB_PRUNE_RESULTS_FORUMS","انجمنهای هرس شده"); +define ("_AM_NEWBB_PRUNE_STORE","به جای حذف کردن آن در این انجمن قرارشان بده:"); +define ("_AM_NEWBB_PRUNE_ARCHIVE","یک کپی از پستها در آرشیو نگه دار"); +define ("_AM_NEWBB_PRUNE_FORUMSELERROR","شما فراموش کردهاید که انجمنی را برای هرس انتخاب کنید."); +define ("_AM_NEWBB_PRUNE_DAYS","پاک کردن تاپیک بدون پاسخ در :"); +define ("_AM_NEWBB_PRUNE_FORUMS","انجمنهایی که هرس میشوند:"); +define ("_AM_NEWBB_PRUNE_STICKY","تاپیکهای مهم(Sticky) را حفظ کن."); +define ("_AM_NEWBB_PRUNE_DIGEST","تاپیک های خلاصه را حفظ کن"); +define ("_AM_NEWBB_PRUNE_LOCK","تاپیکهای قفل را حفظ کن"); +define ("_AM_NEWBB_PRUNE_HOT","تاپیکهایی که بیشتر از این پاسخها را دارند نگه دار"); +define ("_AM_NEWBB_PRUNE_SUBMIT","تایید"); +define ("_AM_NEWBB_PRUNE_RESET","تنظیم دوباره"); +define ("_AM_NEWBB_PRUNE_YES","بله"); +define ("_AM_NEWBB_PRUNE_NO","نه"); +define ("_AM_NEWBB_PRUNE_WEEK","یک هفته"); +define ("_AM_NEWBB_PRUNE_2WEEKS","دو هفته"); +define ("_AM_NEWBB_PRUNE_MONTH","یک ماه"); +define ("_AM_NEWBB_PRUNE_2MONTH","دو ماه"); +define ("_AM_NEWBB_PRUNE_4MONTH","چهار ماه"); +define ("_AM_NEWBB_PRUNE_YEAR","یک سال"); +define ("_AM_NEWBB_PRUNE_2YEARS","دو سال"); + +// About.php constants +define('_AM_NEWBB_AUTHOR_INFO', "اطلاعات نویسنده:"); +define('_AM_NEWBB_AUTHOR_NAME', "نویسنده:"); +define('_AM_NEWBB_AUTHOR_WEBSITE', "وب سایت نویسنده:"); +define('_AM_NEWBB_AUTHOR_EMAIL', "پست الکترونیکی نویسنده:"); +define('_AM_NEWBB_AUTHOR_CREDITS', "اعتبارات"); +define('_AM_NEWBB_MODULE_INFO', "اطلاعات سازندگان ماژول"); +define('_AM_NEWBB_MODULE_STATUS', "وضعیت"); +define('_AM_NEWBB_MODULE_DEMO', "سایت نمایشی"); +define('_AM_NEWBB_MODULE_SUPPORT', "سایت پشتیبان رسمی"); +define('_AM_NEWBB_MODULE_BUG', "گزارش دادن یک باگ برای این ماژول"); +define('_AM_NEWBB_MODULE_FEATURE', "امکانات جدیدی برای این ماژول پیشنهاد کنید."); +define('_AM_NEWBB_MODULE_DISCLAIMER', "توضیحات"); +define('_AM_NEWBB_AUTHOR_WORD', "سخن موسس"); +define('_AM_NEWBB_BY','توسط'); +define('_AM_NEWBB_AUTHOR_WORD_EXTRA', " +"); + +// admin_report.php +define("_AM_NEWBB_REPORTADMIN","مدیریت پیام های گزارش شده"); +define("_AM_NEWBB_PROCESSEDREPORT","دیدن پاسخ ارسال شده توسط ناظر به گزارش فرستاده شده"); +define("_AM_NEWBB_PROCESSREPORT","گزارش های ارسال شده"); +define("_AM_NEWBB_REPORTTITLE","عنوان گزارش"); +define("_AM_NEWBB_REPORTEXTRA","بخش اضافی"); +define("_AM_NEWBB_REPORTPOST","پیام گزارش شده"); +define("_AM_NEWBB_REPORTTEXT","متن گزارش ارسال شده"); +define("_AM_NEWBB_REPORTMEMO","Process memo"); + +// admin_report.php +define("_AM_NEWBB_DIGESTADMIN","مدیریت خلاصه ها"); +define("_AM_NEWBB_DIGESTCONTENT","متن خلاصه ها"); + +// admin_votedata.php +define("_AM_NEWBB_VOTE_RATINGINFOMATION", "اطلاعات ارزش گذاری"); +define("_AM_NEWBB_VOTE_TOTALVOTES", "همه رای ها: "); +define("_AM_NEWBB_VOTE_REGUSERVOTES", "رای های کاربران عضو: %s"); +define("_AM_NEWBB_VOTE_ANONUSERVOTES", "رای های کاربران مهمان: %s"); +define("_AM_NEWBB_VOTE_USER", "کاربر"); +define("_AM_NEWBB_VOTE_IP", "آدرس IP"); +define("_AM_NEWBB_VOTE_USERAVG", "متوسط ارزش گذاری کاربران"); +define("_AM_NEWBB_VOTE_TOTALRATE", "همه ارزش گذاری ها"); +define("_AM_NEWBB_VOTE_DATE", "ارسال شده ها"); +define("_AM_NEWBB_VOTE_RATING", "ارزش"); +define("_AM_NEWBB_VOTE_NOREGVOTES", "هیچ کاربر عضوی رای نداده است"); +define("_AM_NEWBB_VOTE_NOUNREGVOTES", "هیچ کاربر مهمانی رای نداده است"); +define("_AM_NEWBB_VOTEDELETED", "اطلاعات ارزش گذاری حذف شد."); +define("_AM_NEWBB_VOTE_ID", "ID"); +define("_AM_NEWBB_VOTE_FILETITLE", "نام تاپیک"); +define("_AM_NEWBB_VOTE_DISPLAYVOTES", "اطلاعات ارزش گذاری"); +define("_AM_NEWBB_VOTE_NOVOTES", "هیچ رایی برای نشان دادن نیست"); +define("_AM_NEWBB_VOTE_DELETE", "هیچ رایی برای نشان دادن نیست"); +define("_AM_NEWBB_VOTE_DELETEDSC", "رای های انتخاب شده از دیتابیس <b>حذف شدند</b>"); + +// admin_type_manager.php +define("_AM_NEWBB_TYPE_ADD", "نوع ها را اضافه کنید"); +define("_AM_NEWBB_TYPE_TEMPLATE", "تمپلیت نوع"); +define("_AM_NEWBB_TYPE_TEMPLATE_APPLY", "اعمال کردن تمپلیت"); +define("_AM_NEWBB_TYPE_FORUM", "نوع برای هر انجمن"); +define("_AM_NEWBB_TYPE_NAME", "عنوان نوع"); +define("_AM_NEWBB_TYPE_COLOR", "رنگ"); +define("_AM_NEWBB_TYPE_DESCRIPTION", "شرح"); +define("_AM_NEWBB_TYPE_ORDER", "ترتیب"); +define("_AM_NEWBB_TYPE_LIST", "فهرست نوع ها"); +define("_AM_NEWBB_TODEL_TYPE", "آیا مطمان هستید که میخواهید نوع [%s] را حذف کنید؟"); +define("_AM_NEWBB_TYPE_EDITFORUM_DESC", "اطلاعات هنوز ذخیره نشده اند. باید روی دکمه ارسال بزنید تا ذخیره شوند."); +define("_AM_NEWBB_TYPE_ORDER_DESC", "برای فعال کردن یک نوع برای یک انجمن، یک عدد بالاتر از 0 را برای ترتیب نوع 'type_order' انتخاب کنید. به عبارت دیگر اگر ترتیب نوع 'type_order' را 0 انتخاب کنید، آن نوع برای آن انجمن غیر فعال خواهد شد"); + +// admin_synchronization.php +define("_AM_NEWBB_SYNC_TYPE_FORUM", "داده های انجمن"); +define("_AM_NEWBB_SYNC_TYPE_TOPIC", "داده های تاپیک"); +define("_AM_NEWBB_SYNC_TYPE_POST", "داده های پست"); +define("_AM_NEWBB_SYNC_TYPE_USER", "داده های کاربر"); +define("_AM_NEWBB_SYNC_TYPE_STATS", "اطلاعات آماری"); +define("_AM_NEWBB_SYNC_TYPE_MISC", "گوناگون"); +define("_AM_NEWBB_SYNC_ITEMS", "گزینه های انتخاب برای هر حلقه: "); +define("_AM_NEWBB_ALLOW_SUBJECT_PREFIX", "پیشوند های تاپیک هم به عنوان تاپیک اضافه شوند؟"); +define("_AM_NEWBB_ALLOW_SUBJECT_PREFIX_DESC", "اجازه میدهد که پیشوند های انتخاب شده برای تاپیک ها به عنوان تاپیک اضافه شوند."); +define("_AM_NEWBB_GROUPMOD_TITLE","اضافه کردن ناظر برای انجمن ها بر مبنای یک گروه"); +define("_AM_NEWBB_GROUPMOD_TITLEDESC","به شما اجازه میدهد که کل اعضای یگ گروه را به عنوان ناظر به انجمن اضافه کنید."); +define("_AM_NEWBB_GROUPMOD_ALLFORUMS","همه انجمن ها"); +define("_AM_NEWBB_GROUPMOD_ADDMOD","ناظر ها با موفقیت به انجمن ها اضافه شدند."); +define("_AM_NEWBB_GROUPMOD_ERRMOD","یک خطا رخ داده است!"); +?> \ No newline at end of file Added: XoopsModules/newbb/branches/irmtfan/newbb/language/persian/blocks.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/language/persian/blocks.php (rev 0) +++ XoopsModules/newbb/branches/irmtfan/newbb/language/persian/blocks.php 2012-07-30 11:25:09 UTC (rev 9948) @@ -0,0 +1,40 @@ +<?php +// $Id: blocks.php,v 1.3 2005/10/19 17:20:33 phppp Exp $ +// Blocks +if(defined('_MB_NEWBB_DEFINED')) return; +else define('_MB_NEWBB_DEFINED',true); + +define("_MB_NEWBB_FORUM","انجمن"); +define("_MB_NEWBB_TOPIC","عنوان"); +define("_MB_NEWBB_RPLS","پاسخ ها"); +define("_MB_NEWBB_VIEWS","تعداد بازدید"); +define("_MB_NEWBB_LPOST","آخرین ارسال"); +define("_MB_NEWBB_VSTFRMS"," بازدید انجمنها"); +define("_MB_NEWBB_DISPLAY","تعداد در بلاک: "); +define("_MB_NEWBB_DISPLAYMODE","نوع نمایش: "); +define("_MB_NEWBB_DISPLAYMODE_FULL","کامل"); +define("_MB_NEWBB_DISPLAYMODE_COMPACT","فشرده"); +define("_MB_NEWBB_DISPLAYMODE_LITE","سبک"); +define("_MB_NEWBB_FORUMLIST","لیست انجمن های مجاز برای قرار گرفتن در بلاک"); +define("_MB_NEWBB_ALLTOPICS","همه عنوان ها"); +define("_MB_NEWBB_ALLPOSTS","همه پست ها"); +define("_MB_NEWBB_CRITERIA","معیار ها برای نمایش"); +define("_MB_NEWBB_CRITERIA_TOPIC","عنوان ها"); +define("_MB_NEWBB_CRITERIA_POST","پست ها"); +define("_MB_NEWBB_CRITERIA_TIME","جدید ترین ها"); +define("_MB_NEWBB_CRITERIA_TITLE","عنوان پست"); +define("_MB_NEWBB_CRITERIA_TEXT","متن پست"); +define("_MB_NEWBB_CRITERIA_VIEWS","پر بیننده"); +define("_MB_NEWBB_CRITERIA_REPLIES","دارای بیشترین پایخ"); +define("_MB_NEWBB_CRITERIA_DIGEST","جدیدترین خلاصه ها"); +define("_MB_NEWBB_CRITERIA_STICKY","جدید ترین چسبان ها"); +define("_MB_NEWBB_CRITERIA_DIGESTS","دارای بیشترین خلاصه"); +define("_MB_NEWBB_CRITERIA_STICKYS","دارای بیشترین چسبان"); +define("_MB_NEWBB_TIME","بازه زمانی"); +define("_MB_NEWBB_TIME_DESC","عدد های مثبت برای روز ها و عدد های منفی برای ساعت ها هستند"); +define("_MB_NEWBB_TITLE","عنوان"); +define("_MB_NEWBB_AUTHOR","نویسنده"); +define("_MB_NEWBB_COUNT","تعداد"); +define("_MB_NEWBB_INDEXNAV","هدایت گر را نشان بده"); +define("_MB_NEWBB_TITLE_LENGTH","طول عنوان/پیام"); +?> \ No newline at end of file Added: XoopsModules/newbb/branches/irmtfan/newbb/language/persian/index.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/language/persian/index.html (rev 0) +++ XoopsModules/newbb/branches/irmtfan/newbb/language/persian/index.html 2012-07-30 11:25:09 UTC (rev 9948) @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Added: XoopsModules/newbb/branches/irmtfan/newbb/language/persian/mail_template/forum_newpost_notify.tpl =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/language/persian/mail_template/forum_newpost_notify.tpl (rev 0) +++ XoopsModules/newbb/branches/irmtfan/newbb/language/persian/mail_template/forum_newpost_notify.tpl 2012-07-30 11:25:09 UTC (rev 9948) @@ -0,0 +1,20 @@ +agar matne farsi ra nemibinid baraye didane matne farsi rooye in safhe click rast konid va sepas Encoding --> Unicode (UTF-8) ra entekhab konid +سلام {X_UNAME}, + +يک پست جديد در انجمن"{FORUM_NAME}" زده شده است. + +براي ديدن متن پست لينک زير را بزنيد: +{POST_URL} + +----------- + +شما اين پيام را دريافت کرديد زيرا شما آگهي رساني براي پست هاي جديد در اين انجمن را فعال کرده ايد + +اگر فکر ميکنيد اين پيام اشتباهي براي شما ارسال شده است لطفا تنظيمات آگهي رساني خود را در لينک زير تغيير دهيد +{X_UNSUBSCRIBE_URL} + +----------- + +{X_SITENAME} ({X_SITEURL}) +مدير سايت +{X_ADMINMAIL} Added: XoopsModules/newbb/branches/irmtfan/newbb/language/persian/mail_template/forum_newthread_notify.tpl =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/language/persian/mail_template/forum_newthread_notify.tpl (rev 0) +++ XoopsModules/newbb/bra... [truncated message content] |
From: <be...@us...> - 2012-08-01 18:58:57
|
Revision: 9973 http://xoops.svn.sourceforge.net/xoops/?rev=9973&view=rev Author: beckmi Date: 2012-08-01 18:58:48 +0000 (Wed, 01 Aug 2012) Log Message: ----------- More changes from Irmtfan (http://xoops.org/modules/newbb/viewtopic.php?post_id=348253#forumpost348253) Modified Paths: -------------- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev9883.txt XoopsModules/newbb/branches/irmtfan/newbb/class/user.php XoopsModules/newbb/branches/irmtfan/newbb/docs/changelog.txt XoopsModules/newbb/branches/irmtfan/newbb/header.php XoopsModules/newbb/branches/irmtfan/newbb/include/plugin.php XoopsModules/newbb/branches/irmtfan/newbb/language/persian/admin.php XoopsModules/newbb/branches/irmtfan/newbb/language/persian/main.php XoopsModules/newbb/branches/irmtfan/newbb/language/persian/modinfo.php XoopsModules/newbb/branches/irmtfan/newbb/polls.php XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_index.html XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_thread.html XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewall.html XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewforum.html XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewpost.html XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html XoopsModules/newbb/branches/irmtfan/newbb/xoops_version.php Added Paths: ----------- XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/english/style.css XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/style.css Removed Paths: ------------- XoopsModules/newbb/branches/irmtfan/newbb/templates/style.css Modified: XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev9883.txt =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev9883.txt 2012-08-01 03:11:30 UTC (rev 9972) +++ XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev9883.txt 2012-08-01 18:58:48 UTC (rev 9973) @@ -1,7 +1,27 @@ Changelog from rev.9883 +date: 2012-08-01 +================================================ +1- localization: input date localized (for other date systems like hegira) by replacing strtotime by XoopsLocal::strtotime +in newbb/polls.php + +2- customization&localization: newbb style.css is fully localized and customized and is not hard-coded anymore. +in newbb/header.php +file changes: +-- deleted newbb/templates/style.css +-- added newbb/templates/images/language/english/style.css +-- added newbb/templates/images/language/persian/style.css +priorities: +if exist in themes/YOUR_THEME/modules/newbb/images/language/YOUR_LANG/style.css take it +else if exist in themes/default/modules/newbb/images/language/YOUR_LANG/style.css take it +else if exist in modules/newbb/templates/images/language/YOUR_LANG/style.css take it +else if exist in modules/newbb/templates/images/language/english/style.css take it +else if exist in modules/newbb/templates/style.css take it (for backward compatibility) + +3- many hardcodes in newbb/templates and style.css has been removed + date: 2012-07-30 ================================================ -1- bug fix: edit not record when the reason is not filled (irmtfan) +1- bug fix: edit not displayed when the reason is not filled (irmtfan) 2- bug fix: only the last edit is recorded. (irmtfan/alfred) in newbb/class/post.php 3- bug fix: 'noapprove' permission incorrectly recorded in database. (irmtfan) @@ -12,5 +32,5 @@ in newbb/xoops_version.php 6- hardcode: some style.css color hardcodes has been removed. (irmtfan) in newbb/templates/style.css -7- feature added: text links instead of buttons. (deka98/irmtfan) -in newbb/class/icon.php , newbb/include/functions.render.php , newbb/include/plugin.php +7- feature added: text links instead of buttons. (deka87/irmtfan) +in newbb/class/icon.php , newbb/include/functions.render.php , newbb/include/plugin.php \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/class/user.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/class/user.php 2012-08-01 03:11:30 UTC (rev 9972) +++ XoopsModules/newbb/branches/irmtfan/newbb/class/user.php 2012-08-01 18:58:48 UTC (rev 9973) @@ -1,298 +1,318 @@ -<?php -/** - * CBB 4.0, or newbb, the forum module for XOOPS project - * - * @copyright The XOOPS Project http://xoops.sf.net - * @license http://www.fsf.org/copyleft/gpl.html GNU public license - * @author Taiwen Jiang (phppp or D.J.) <ph...@us...> - * @since 4.00 - * @version $Id $ - * @package module::newbb - */ - -if (!defined("XOOPS_ROOT_PATH")) { - exit(); -} - -defined("NEWBB_FUNCTIONS_INI") || include XOOPS_ROOT_PATH.'/modules/newbb/include/functions.ini.php'; - -function newbb_calculateLevel($RPG, $RPGDIFF) -{ - - //$RPG = $user->getVar('posts'); - //$RPGDIFF = $user->getVar('user_regdate'); - - $today = time(); - $diff = $today - $RPGDIFF; - $exp = round($diff / 86400,0); - if ($exp <= 0) { $exp = 1; } - $ppd= round($RPG / $exp, 0); - $level = pow (log10 ($RPG), 3); - $ep = floor (100 * ($level - floor ($level))); - $showlevel = floor ($level + 1); - $hpmulti =round ($ppd / 6, 1); - if ($hpmulti > 1.5) { $hpmulti = 1.5; } - if ($hpmulti < 1) { $hpmulti = 1; } - $maxhp = $level * 25 * $hpmulti; - $hp= $ppd / 5; - if ($hp >= 1) { - $hp= $maxhp; - } else { - $hp= floor ($hp * $maxhp); - } - $hp= floor ($hp); - $maxhp= floor ($maxhp); - if ($maxhp <= 0) { - $zhp = 1; - } else { - $zhp = $maxhp; - } - $hpf= floor (100 * ($hp / $zhp)) - 1; - $maxmp= ($exp * $level) / 5; - $mp= $RPG / 3; - if ($mp >= $maxmp) { $mp = $maxmp; } - $maxmp = floor ($maxmp); - $mp = floor ($mp); - if ($maxmp <= 0) { - $zmp = 1; - } else { - $zmp = $maxmp; - } - $mpf= floor (100 * ($mp / $zmp)) - 1; - if ( $hpf >= 98 ) { $hpf = $hpf - 2; } - if ( $ep >= 98 ) { $ep = $ep - 2; } - if ( $mpf >= 98 ) { $mpf = $mpf - 2; } - - $level = array(); - $level['level'] = $showlevel ; - $level['exp'] = $ep; - $level['exp_width'] = $ep.'%'; - $level['hp'] = $hp; - $level['hp_max'] = $maxhp; - $level['hp_width'] = $hpf.'%'; - $level['mp'] = $mp; - $level['mp_max'] = $maxmp; - $level['mp_width'] = $mpf.'%'; - - return $level; -} - -class newbbUser { - var $user = null; - - function User() - { - } - - function getUserbar() - { - global $xoopsModuleConfig, $xoopsUser, $isadmin; - - $userbar = array(); - if (empty($xoopsModuleConfig['userbar_enabled'])) return $userbar; - - $user = $this->user; - $userbar["profile"] = array("link" => XOOPS_URL . "/userinfo.php?uid=" . $user->getVar("uid"), "name" => _PROFILE); - - if (is_object($xoopsUser)) { - $userbar["pm"] = array("link" => "javascript:void openWithSelfMain('" . XOOPS_URL . "/pmlite.php?send2=1&to_userid=" . $user->getVar("uid") . "', 'pmlite', 450, 380);", "name" => _MD_PM); - } - if ($user->getVar('user_viewemail') || $isadmin) { - $userbar["email"] = array("link" => "javascript:void window.open('mailto:" . $user->getVar('email') . "', 'new');", "name" => _MD_EMAIL); - } - if ($url = $user->getVar('url')) { - $userbar["url"] = array("link" => "javascript:void window.open('" . $url . "', 'new');", "name" => _MD_WWW); - } - if ($icq = $user->getVar('user_icq')) { - $userbar["icq"] = array("link" => "javascript:void window.open('http://wwp.icq.com/scripts/search.dll?to=" . $icq."', 'new');", "name" => _MD_ICQ); - } - if ($aim = $user->getVar('user_aim')) { - $userbar["aim"]= array("link" => "javascript:void window.open('aim:goim?screenname=" . $aim . "&message=Hi+" . $aim . "+Are+you+there?" . "', 'new');", "name" => _MD_AIM); - } - if ($yim = $user->getVar('user_yim')) { - $userbar["yim"] = array("link" => "javascript:void window.open('http://edit.yahoo.com/config/send_webmesg?.target=" . $yim . "&.src=pg" . "', 'new');", "name" => _MD_YIM); - } - if ($msn = $user->getVar('user_msnm')) { - $userbar["msnm"] = array("link" => "javascript:void window.open('http://members.msn.com?mem=" . $msn . "', 'new');", "name" => _MD_MSNM); - } - - return $userbar; - } - - function getLevel() - { - global $xoopsModuleConfig, $forumUrl; - - $level = newbb_calculateLevel($this->user->getVar("posts"), $this->user->getVar("user_regdate")); - $info=''; - if ($xoopsModuleConfig['user_level'] == 2) { - static $rpg_images; - if (!isset($rpg_images)) { - $icon_handler = newbb_getIconHandler(); - $rpg_path = $icon_handler->getPath("rpg"); - foreach (array("img_left", "img_backing", "img_right", "blue", "green", "orange") as $img) { - $rpg_images[$img] = XOOPS_URL . '/' . $rpg_path . '/'.$img.'.gif'; - } - } - $table = "<table class='userlevel'><tr><td class='end'><img src='" . $rpg_images['img_left'] . "' alt='' /></td><td class='center' background='" . $rpg_images['img_backing'] . "'><img src='%s' width='%d' alt='' align='left' /></td><td><img src='" . $rpg_images['img_right'] . "' alt='' /></td></tr></table>"; - - $info = _MD_LEVEL . " " . $level['level'] . "<br />" . _MD_HP . " " . $level['hp'] . " / " . $level['hp_max'] . "<br />". - sprintf($table, $rpg_images["orange"], $level['hp_width']); - $info .= _MD_MP . " " . $level['mp'] . " / " . $level['mp_max'] . "<br />". - sprintf($table, $rpg_images["green"], $level['mp_width']); - $info .= _MD_EXP . " " . $level['exp'] . "<br />". - sprintf($table, $rpg_images["blue"], $level['exp_width']); - } else { - $info = _MD_LEVEL . " " . $level['level'] . "; ". _MD_EXP . " " . $level['exp'] . "<br />"; - $info .= _MD_HP . " " . $level['hp'] . " / " . $level['hp_max'] . "<br />"; - $info .= _MD_MP . " " . $level['mp'] . " / " . $level['mp_max']; - } - return $info; - } - - function getInfo(&$user) - { - global $xoopsModuleConfig, $myts; - static $name_anonymous; - - if ( !(is_object($user)) || !($user->isActive()) ) { - if (!isset($name_anonymous)) { - $name_anonymous = $myts->HtmlSpecialChars($GLOBALS["xoopsConfig"]['anonymous']); - } - return array("name" => $name_anonymous, "link" => $name_anonymous); - } - - $this->user = $user; - - $userinfo["uid"] = $user->getVar("uid"); - - $name = empty($xoopsModuleConfig['show_realname']) ? $user->getVar('uname') : $user->getVar('name'); - $userinfo["name"] = $name ? $name : $user->getVar('uname'); - - $userinfo["link"] = "<a href=\"".XOOPS_URL . "/userinfo.php?uid=" . $user->getVar("uid") ."\">".$userinfo["name"]."</a>"; - - $userinfo["avatar"] = $user->getVar('user_avatar'); -// START hacked by irmtfan - easier rank getting - $userrank = $user->rank(); - if (isset($userrank['image']) && $userrank['image']) { - $userinfo["rank_image"] = $userrank['image']; - $userinfo["rank_title"] = $userrank['title']; - } -// END hacked by irmtfan - easier rank getting - - $userinfo["from"] = $user->getVar('user_from'); - - mod_loadFunctions("time", "newbb"); - $userinfo["regdate"] = newbb_formatTimestamp($user->getVar('user_regdate'), 'reg'); - - $userinfo["posts"] = $user->getVar('posts'); - - if (!empty($xoopsModuleConfig['user_level'])) { - $userinfo["level"] = $this->getLevel(); - } - - if (!empty($xoopsModuleConfig['userbar_enabled'])) { - $userinfo["userbar"] = $this->getUserbar(); - } - - $userinfo["signature"] = $user->getVar('user_sig'); - return $userinfo; - } -} - -class NewbbUserHandler -{ - var $enableGroup; - var $enableOnline; - var $userlist = array(); - var $users = array(); - //var $online = array(); - - function NewbbUserHandler($enableGroup = true, $enableOnline = true) - { - $this->enableGroup = $enableGroup; - $this->enableOnline = $enableOnline; - } - - function loadUserInfo() - { - @include_once XOOPS_ROOT_PATH."/modules/".$GLOBALS["xoopsModule"]->getVar("dirname", "n")."/language/".$GLOBALS["xoopsConfig"]["language"]."/user.php"; - if (class_exists("User_language")) { - $handler = new User_language(); - } else { - $handler = new newbbUser(); - } - foreach (array_keys($this->users) as $uid) { - $this->userlist[$uid] = $handler->getInfo($this->users[$uid]); - } - } - - function loadUserOnline() - { - if (empty($this->users) || !$this->enableOnline) return; - mod_loadFunctions("render", "newbb"); - $image_online = newbb_displayImage('online', _MD_ONLINE); - $image_offline = newbb_displayImage('offline',_MD_OFFLINE); - - $online_handler =& xoops_getmodulehandler('online', 'newbb'); - $onlines = $online_handler->checkStatus(array_keys($this->users)); - - foreach (array_keys($this->users) as $uid) { - $this->userlist[$uid]["status"] = empty($onlines[$uid]) ? $image_offline : $image_online; - } - } - - function loadUserGroups() - { - GLOBAL $xoopsDB; - - if (empty($this->users) || !$this->enableGroup) return; - - $groups = array(); - $member_handler =& xoops_gethandler('member'); - $groups_obj = $member_handler->getGroups(); - $count = count($groups_obj); - for ($i = 0; $i < $count; $i++) { - $groups[$groups_obj[$i]->getVar('groupid')] = $groups_obj[$i]->getVar('name'); - } - unset($groups_obj); - - $sql = 'SELECT groupid, uid FROM ' . $xoopsDB->prefix('groups_users_link') . " WHERE uid IN( " . implode(", ", array_keys($this->users)) . ")"; - $result = $xoopsDB->query($sql); - while ($myrow = $xoopsDB->fetchArray($result)) { - $this->userlist[$myrow['uid']]["groups"][] = $groups[$myrow['groupid']]; - } - } - - function loadUserDigest() - { - GLOBAL $xoopsDB; - - if (empty($this->users)) return; - - $sql = 'SELECT user_digests, uid FROM ' . $xoopsDB->prefix('bb_user_stats') . " WHERE uid IN( " . implode(", ", array_keys($this->users)) . ")"; - $result = $xoopsDB->query($sql); - while ($myrow = $xoopsDB->fetchArray($result)) { - $this->userlist[$myrow['uid']]["digests"] = intval( $myrow['user_digests'] ); - } - } -// START irmtfan remove function -// function loadUserRank() -// { -// return true; -// } -// END irmtfan remove function - - function getUsers() - { - $this->loadUserInfo(); - $this->loadUserOnline(); - $this->loadUserGroups(); - // irmtfan removed $this->loadUserRank(); - $this->loadUserDigest(); - - return $this->userlist; - } -} - +<?php +/** + * CBB 4.0, or newbb, the forum module for XOOPS project + * + * @copyright The XOOPS Project http://xoops.sf.net + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @author Taiwen Jiang (phppp or D.J.) <ph...@us...> + * @since 4.00 + * @version $Id $ + * @package module::newbb + */ + +if (!defined("XOOPS_ROOT_PATH")) { + exit(); +} + +defined("NEWBB_FUNCTIONS_INI") || include XOOPS_ROOT_PATH.'/modules/newbb/include/functions.ini.php'; + +function newbb_calculateLevel($RPG, $RPGDIFF) +{ + + //$RPG = $user->getVar('posts'); + //$RPGDIFF = $user->getVar('user_regdate'); + + $today = time(); + $diff = $today - $RPGDIFF; + $exp = round($diff / 86400,0); + if ($exp <= 0) { $exp = 1; } + $ppd= round($RPG / $exp, 0); + $level = pow (log10 ($RPG), 3); + $ep = floor (100 * ($level - floor ($level))); + $showlevel = floor ($level + 1); + $hpmulti =round ($ppd / 6, 1); + if ($hpmulti > 1.5) { $hpmulti = 1.5; } + if ($hpmulti < 1) { $hpmulti = 1; } + $maxhp = $level * 25 * $hpmulti; + $hp= $ppd / 5; + if ($hp >= 1) { + $hp= $maxhp; + } else { + $hp= floor ($hp * $maxhp); + } + $hp= floor ($hp); + $maxhp= floor ($maxhp); + if ($maxhp <= 0) { + $zhp = 1; + } else { + $zhp = $maxhp; + } + $hpf= floor (100 * ($hp / $zhp)) - 1; + $maxmp= ($exp * $level) / 5; + $mp= $RPG / 3; + if ($mp >= $maxmp) { $mp = $maxmp; } + $maxmp = floor ($maxmp); + $mp = floor ($mp); + if ($maxmp <= 0) { + $zmp = 1; + } else { + $zmp = $maxmp; + } + $mpf= floor (100 * ($mp / $zmp)) - 1; + if ( $hpf >= 98 ) { $hpf = $hpf - 2; } + if ( $ep >= 98 ) { $ep = $ep - 2; } + if ( $mpf >= 98 ) { $mpf = $mpf - 2; } + + $level = array(); + $level['level'] = $showlevel ; + $level['exp'] = $ep; + $level['exp_width'] = $ep.'%'; + $level['hp'] = $hp; + $level['hp_max'] = $maxhp; + $level['hp_width'] = $hpf.'%'; + $level['mp'] = $mp; + $level['mp_max'] = $maxmp; + $level['mp_width'] = $mpf.'%'; + + return $level; +} + +class newbbUser { + var $user = null; + + function User() + { + } + + function getUserbar() + { + global $xoopsModuleConfig, $xoopsUser, $isadmin; + + $userbar = array(); + if (empty($xoopsModuleConfig['userbar_enabled'])) return $userbar; + + $user = $this->user; + $userbar["profile"] = array("link" => XOOPS_URL . "/userinfo.php?uid=" . $user->getVar("uid"), "name" => _PROFILE); + + if (is_object($xoopsUser)) { + $userbar["pm"] = array("link" => "javascript:void openWithSelfMain('" . XOOPS_URL . "/pmlite.php?send2=1&to_userid=" . $user->getVar("uid") . "', 'pmlite', 450, 380);", "name" => _MD_PM); + } + if ($user->getVar('user_viewemail') || $isadmin) { + $userbar["email"] = array("link" => "javascript:void window.open('mailto:" . $user->getVar('email') . "', 'new');", "name" => _MD_EMAIL); + } + if ($url = $user->getVar('url')) { + $userbar["url"] = array("link" => "javascript:void window.open('" . $url . "', 'new');", "name" => _MD_WWW); + } + if ($icq = $user->getVar('user_icq')) { + $userbar["icq"] = array("link" => "javascript:void window.open('http://wwp.icq.com/scripts/search.dll?to=" . $icq."', 'new');", "name" => _MD_ICQ); + } + if ($aim = $user->getVar('user_aim')) { + $userbar["aim"]= array("link" => "javascript:void window.open('aim:goim?screenname=" . $aim . "&message=Hi+" . $aim . "+Are+you+there?" . "', 'new');", "name" => _MD_AIM); + } + if ($yim = $user->getVar('user_yim')) { + $userbar["yim"] = array("link" => "javascript:void window.open('http://edit.yahoo.com/config/send_webmesg?.target=" . $yim . "&.src=pg" . "', 'new');", "name" => _MD_YIM); + } + if ($msn = $user->getVar('user_msnm')) { + $userbar["msnm"] = array("link" => "javascript:void window.open('http://members.msn.com?mem=" . $msn . "', 'new');", "name" => _MD_MSNM); + } + + return $userbar; + } + + function getLevel() + { + global $xoopsModuleConfig, $forumUrl; + + $level = newbb_calculateLevel($this->user->getVar("posts"), $this->user->getVar("user_regdate")); + $info=''; + if ($xoopsModuleConfig['user_level'] == 2) { + static $rpg_images; + if (!isset($rpg_images)) { + $icon_handler = newbb_getIconHandler(); + $rpg_path = $icon_handler->getPath("rpg"); + foreach (array("img_left", "img_backing", "img_right", "blue", "green", "orange") as $img) { + $rpg_images[$img] = XOOPS_URL . '/' . $rpg_path . '/'.$img.'.gif'; + } + } + $table = "<table class='userlevel'><tr><td class='end'><img src='" . $rpg_images['img_left'] . "' alt='' /></td><td class='center' background='" . $rpg_images['img_backing'] . "'><img src='%s' width='%d' alt='' align='left' /></td><td><img src='" . $rpg_images['img_right'] . "' alt='' /></td></tr></table>"; + + $info = _MD_LEVEL . " " . $level['level'] . "<br />" . _MD_HP . " " . $level['hp'] . " / " . $level['hp_max'] . "<br />". + sprintf($table, $rpg_images["orange"], $level['hp_width']); + $info .= _MD_MP . " " . $level['mp'] . " / " . $level['mp_max'] . "<br />". + sprintf($table, $rpg_images["green"], $level['mp_width']); + $info .= _MD_EXP . " " . $level['exp'] . "<br />". + sprintf($table, $rpg_images["blue"], $level['exp_width']); + } else { + $info = _MD_LEVEL . " " . $level['level'] . "; ". _MD_EXP . " " . $level['exp'] . "<br />"; + $info .= _MD_HP . " " . $level['hp'] . " / " . $level['hp_max'] . "<br />"; + $info .= _MD_MP . " " . $level['mp'] . " / " . $level['mp_max']; + } + return $info; + } + + function getInfo(&$user) + { + global $xoopsModuleConfig, $myts; + static $name_anonymous; + + if ( !(is_object($user)) || !($user->isActive()) ) { + if (!isset($name_anonymous)) { + $name_anonymous = $myts->HtmlSpecialChars($GLOBALS["xoopsConfig"]['anonymous']); + } + return array("name" => $name_anonymous, "link" => $name_anonymous); + } + + $this->user = $user; + + $userinfo["uid"] = $user->getVar("uid"); + + $name = empty($xoopsModuleConfig['show_realname']) ? $user->getVar('uname') : $user->getVar('name'); + $userinfo["name"] = $name ? $name : $user->getVar('uname'); + + $userinfo["link"] = "<a href=\"".XOOPS_URL . "/userinfo.php?uid=" . $user->getVar("uid") ."\">".$userinfo["name"]."</a>"; + + $userinfo["avatar"] = $user->getVar('user_avatar'); + + $userinfo["from"] = $user->getVar('user_from'); + + mod_loadFunctions("time", "newbb"); + $userinfo["regdate"] = newbb_formatTimestamp($user->getVar('user_regdate'), 'reg'); + + $userinfo["posts"] = $user->getVar('posts'); + + if (!empty($xoopsModuleConfig['user_level'])) { + $userinfo["level"] = $this->getLevel(); + } + + if (!empty($xoopsModuleConfig['userbar_enabled'])) { + $userinfo["userbar"] = $this->getUserbar(); + } + + $userinfo["signature"] = $user->getVar('user_sig'); + return $userinfo; + } +} + +class NewbbUserHandler +{ + var $enableGroup; + var $enableOnline; + var $userlist = array(); + var $users = array(); + //var $online = array(); + + function NewbbUserHandler($enableGroup = true, $enableOnline = true) + { + $this->enableGroup = $enableGroup; + $this->enableOnline = $enableOnline; + } + + function loadUserInfo() + { + @include_once XOOPS_ROOT_PATH."/modules/".$GLOBALS["xoopsModule"]->getVar("dirname", "n")."/language/".$GLOBALS["xoopsConfig"]["language"]."/user.php"; + if (class_exists("User_language")) { + $handler = new User_language(); + } else { + $handler = new newbbUser(); + } + foreach (array_keys($this->users) as $uid) { + $this->userlist[$uid] = $handler->getInfo($this->users[$uid]); + } + } + + function loadUserOnline() + { + if (empty($this->users) || !$this->enableOnline) return; + mod_loadFunctions("render", "newbb"); + $image_online = newbb_displayImage('online', _MD_ONLINE); + $image_offline = newbb_displayImage('offline',_MD_OFFLINE); + + $online_handler =& xoops_getmodulehandler('online', 'newbb'); + $onlines = $online_handler->checkStatus(array_keys($this->users)); + + foreach (array_keys($this->users) as $uid) { + $this->userlist[$uid]["status"] = empty($onlines[$uid]) ? $image_offline : $image_online; + } + } + + function loadUserGroups() + { + GLOBAL $xoopsDB; + + if (empty($this->users) || !$this->enableGroup) return; + + $groups = array(); + $member_handler =& xoops_gethandler('member'); + $groups_obj = $member_handler->getGroups(); + $count = count($groups_obj); + for ($i = 0; $i < $count; $i++) { + $groups[$groups_obj[$i]->getVar('groupid')] = $groups_obj[$i]->getVar('name'); + } + unset($groups_obj); + + $sql = 'SELECT groupid, uid FROM ' . $xoopsDB->prefix('groups_users_link') . " WHERE uid IN( " . implode(", ", array_keys($this->users)) . ")"; + $result = $xoopsDB->query($sql); + while ($myrow = $xoopsDB->fetchArray($result)) { + $this->userlist[$myrow['uid']]["groups"][] = $groups[$myrow['groupid']]; + } + } + + function loadUserDigest() + { + GLOBAL $xoopsDB; + + if (empty($this->users)) return; + + $sql = 'SELECT user_digests, uid FROM ' . $xoopsDB->prefix('bb_user_stats') . " WHERE uid IN( " . implode(", ", array_keys($this->users)) . ")"; + $result = $xoopsDB->query($sql); + while ($myrow = $xoopsDB->fetchArray($result)) { + $this->userlist[$myrow['uid']]["digests"] = intval( $myrow['user_digests'] ); + } + } + + function loadUserRank() + { + GLOBAL $xoopsDB; + + if (empty($this->users)) return; + $myts =& MyTextSanitizer::getInstance(); + + $sql = 'SELECT * FROM ' . $xoopsDB->prefix('ranks'); + $result = $xoopsDB->query($sql); + while ($myrow = $xoopsDB->fetchArray($result)) { + $ranks[$myrow['rank_id']] = $myrow; + $ranks[$myrow['rank_id']]["rank_title"] = $myts->htmlspecialchars($ranks[$myrow['rank_id']]["rank_title"]); + if (!empty($ranks[$myrow['rank_id']]['rank_image'])) { + $ranks[$myrow['rank_id']]['rank_image'] = "<img src='" . XOOPS_UPLOAD_URL . "/ranks/" . htmlspecialchars($ranks[$myrow['rank_id']]['rank_image'], ENT_QUOTES) . "' alt='' />"; + } + } + + foreach (array_keys($this->userlist) as $uid) { + if ($rank = $this->users[$uid]->getVar("rank")) { + $this->userlist[$uid]["rank"]["title"] = $ranks[$rank]["rank_title"]; + $this->userlist[$uid]["rank"]["image"] = $ranks[$rank]["rank_image"]; + continue; + } + foreach ($ranks as $id => $rank) { + if ($rank["rank_min"] <= $this->userlist[$uid]["posts"] && $rank["rank_max"] >= $this->userlist[$uid]["posts"]) { + $this->userlist[$uid]["rank"]["title"] = $rank["rank_title"]; + $this->userlist[$uid]["rank"]["image"] = $rank["rank_image"]; + break; + } + } + } + } + + function getUsers() + { + $this->loadUserInfo(); + $this->loadUserOnline(); + $this->loadUserGroups(); + $this->loadUserRank(); + $this->loadUserDigest(); + + return $this->userlist; + } +} + ?> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/docs/changelog.txt =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/docs/changelog.txt 2012-08-01 03:11:30 UTC (rev 9972) +++ XoopsModules/newbb/branches/irmtfan/newbb/docs/changelog.txt 2012-08-01 18:58:48 UTC (rev 9973) @@ -20,25 +20,6 @@ 16 Fix Link to Blank.gif 17 Fix Error Upload File too large -18- bug fix: edit not displayed when the reason is not filled (irmtfan) -19- bug fix: only the last edit is recorded. (irmtfan/alfred) -in newbb/class/post.php - -20- bug fix: 'noapprove' permission incorrectly recorded in database. (irmtfan) -in newbb/class/permission.php - -21- bug fix: load user ranks has been hardcoded. it works in old/upgraded websites but not works in new installed websites. a new getting rank introduced. (black_beard/irmtfan) -in newbb/class/user.php, newbb/templates/newbb_thread.html - -22- minor bug fix: mysql 5.1 was incorrectly needed (irmtfan) -in newbb/xoops_version.php - -23- hardcode: some style.css color hardcodes has been removed. (irmtfan) -in newbb/templates/style.css - -24- feature added: text links instead of buttons. (deka87/irmtfan) -in newbb/class/icon.php , newbb/include/functions.render.php , newbb/include/plugin.php - newBB Changelog 4.2 02/08/2012 Modified: XoopsModules/newbb/branches/irmtfan/newbb/header.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/header.php 2012-08-01 03:11:30 UTC (rev 9972) +++ XoopsModules/newbb/branches/irmtfan/newbb/header.php 2012-08-01 18:58:48 UTC (rev 9973) @@ -1,116 +1,140 @@ -<?php -/** - * CBB 4.0, or newbb, the forum module for XOOPS project - * - * @copyright The XOOPS Project http://xoops.sf.net - * @license http://www.fsf.org/copyleft/gpl.html GNU public license - * @author Taiwen Jiang (phppp or D.J.) <ph...@us...> - * @since 4.00 - * @version $Id$ - * @package module::newbb - */ -include_once '../../mainfile.php'; -defined('XOOPS_ROOT_PATH') or die('Restricted access'); -$xoopsLogger->startTime('newBB_Header'); - -if (!empty($xoopsModuleConfig['do_rewrite'])) { - include_once "seo_url.php"; - /* for seo */ - $toseo_url = array("index.php","viewforum.php","viewtopic.php","rss.php"); - - if(((strpos(getenv('REQUEST_URI'), '.html') === false) && !empty($xoopsModuleConfig['do_rewrite']) && (!isset($_POST) || count($_POST) <= 0))) - { - $redir = false; - if ( strpos(getenv("REQUEST_URI"),"mark_read=") == true || strpos(getenv("REQUEST_URI"),"mark=") == true) { - // Mark Forums - } else { - if ( in_array(basename(getenv('SCRIPT_NAME')),$toseo_url) ) { - //rewrite only for files - - if ( trim(getenv("SCRIPT_NAME")) != '' ) { - if ( strpos(getenv("REQUEST_URI") , "/".SEO_MODULE_NAME."/") === false ) { - $redir = true; - } else if ( getenv("QUERY_STRING") ) { - $redir = true; - } - } - } - } - - if ($redir == true) { - $s = "http://" . getenv('HTTP_HOST') . getenv("REQUEST_URI"); - $s = str_replace("/".REAL_MODULE_NAME."/","/".SEO_MODULE_NAME."/",$s); - $newurl = seo_urls('<a href="'.$s.'"></a>'); - $newurl = str_replace('<a href="','',$newurl); - $newurl = str_replace('"></a>','',$newurl); - if ( !headers_sent() ) { - header("HTTP/1.1 301 Moved Permanently"); - header("Location: $newurl"); - exit(); - } - } - } -} - -include_once XOOPS_ROOT_PATH."/modules/".$xoopsModule->getVar("dirname")."/include/vars.php"; - -mod_loadFunctions("user", "newbb"); -mod_loadFunctions("topic", "newbb"); - -require_once XOOPS_ROOT_PATH."/class/xoopsformloader.php"; -require_once XOOPS_ROOT_PATH."/class/module.textsanitizer.php"; -$myts = MyTextSanitizer::getInstance(); - -$menumode = 0; -$menumode_other = array(); -$menu_url = htmlSpecialChars(preg_replace("/&menumode=[^&]/", "", $_SERVER[ 'REQUEST_URI' ])); -$menu_url .= ( false === strpos($menu_url, "?") ) ? "?menumode=" : "&menumode="; -foreach ($xoopsModuleConfig["valid_menumodes"] as $key => $val) { - if ($key != $menumode) $menumode_other[] = array("title"=>$val, "link"=>$menu_url.$key); -} - - -$newbb_module_header = ''; -$newbb_module_header .= '<link rel="alternate" type="application/rss+xml" title="'.$xoopsModule->getVar("name").'" href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', "n").'/rss.php" />'; -if (!empty($xoopsModuleConfig['pngforie_enabled'])) { - $newbb_module_header .= '<style type="text/css">img {behavior:url("include/pngbehavior.htc");}</style>'; -} -$newbb_module_header .= ' - <link rel="stylesheet" type="text/css" href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar("dirname").'/templates/style.css" /> - <script type="text/javascript">var toggle_cookie="'.$forumCookie['prefix'].'G'.'";</script> - <script src="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar("dirname").'/include/js/newbb_toggle.js" type="text/javascript"></script> - '; - -if ($menumode == 2) { - $newbb_module_header .= ' - <link rel="stylesheet" type="text/css" href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar("dirname").'templates/newbb_menu_hover.css" /> - <style type="text/css">body {behavior:url("include/newbb.htc");}</style> - '; -} - -if ($menumode == 1) { - $newbb_module_header .= ' - <link rel="stylesheet" type="text/css" href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar("dirname").'templates/newbb_menu_click.css" /> - <script src="include/js/newbb_menu_click.js" type="text/javascript"></script> - '; -} - -$xoops_module_header = $newbb_module_header; // for cache hack - -if (!empty($xoopsModuleConfig["welcome_forum"]) && is_object($xoopsUser) && !$xoopsUser->getVar('posts')) { - mod_loadFunctions("welcome", "newbb"); -} - -$pollmodules = NULL; -//$module_handler = &xoops_gethandler('module'); -$xoopspoll = &$module_handler->getByDirname('xoopspoll'); -if (is_object($xoopspoll) && $xoopspoll->getVar('isactive')) { - $pollmodules = 'xoopspoll'; -} else { - //Umfrage - $xoopspoll = &$module_handler->getByDirname('umfrage'); - if (is_object($xoopspoll) && $xoopspoll->getVar('isactive')) - $pollmodules = 'umfrage'; -} -$xoopsLogger->stopTime('newBB_Header'); +<?php +/** + * CBB 4.0, or newbb, the forum module for XOOPS project + * + * @copyright The XOOPS Project http://xoops.sf.net + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @author Taiwen Jiang (phppp or D.J.) <ph...@us...> + * @since 4.00 + * @version $Id$ + * @package module::newbb + */ +include_once '../../mainfile.php'; +defined('XOOPS_ROOT_PATH') or die('Restricted access'); +$xoopsLogger->startTime('newBB_Header'); + +if (!empty($xoopsModuleConfig['do_rewrite'])) { + include_once "seo_url.php"; + /* for seo */ + $toseo_url = array("index.php","viewforum.php","viewtopic.php","rss.php"); + + if(((strpos(getenv('REQUEST_URI'), '.html') === false) && !empty($xoopsModuleConfig['do_rewrite']) && (!isset($_POST) || count($_POST) <= 0))) + { + $redir = false; + if ( strpos(getenv("REQUEST_URI"),"mark_read=") == true || strpos(getenv("REQUEST_URI"),"mark=") == true) { + // Mark Forums + } else { + if ( in_array(basename(getenv('SCRIPT_NAME')),$toseo_url) ) { + //rewrite only for files + + if ( trim(getenv("SCRIPT_NAME")) != '' ) { + if ( strpos(getenv("REQUEST_URI") , "/".SEO_MODULE_NAME."/") === false ) { + $redir = true; + } else if ( getenv("QUERY_STRING") ) { + $redir = true; + } + } + } + } + + if ($redir == true) { + $s = "http://" . getenv('HTTP_HOST') . getenv("REQUEST_URI"); + $s = str_replace("/".REAL_MODULE_NAME."/","/".SEO_MODULE_NAME."/",$s); + $newurl = seo_urls('<a href="'.$s.'"></a>'); + $newurl = str_replace('<a href="','',$newurl); + $newurl = str_replace('"></a>','',$newurl); + if ( !headers_sent() ) { + header("HTTP/1.1 301 Moved Permanently"); + header("Location: $newurl"); + exit(); + } + } + } +} + +include_once XOOPS_ROOT_PATH."/modules/".$xoopsModule->getVar("dirname")."/include/vars.php"; + +mod_loadFunctions("user", "newbb"); +mod_loadFunctions("topic", "newbb"); + +require_once XOOPS_ROOT_PATH."/class/xoopsformloader.php"; +require_once XOOPS_ROOT_PATH."/class/module.textsanitizer.php"; +$myts = MyTextSanitizer::getInstance(); + +$menumode = 0; +$menumode_other = array(); +$menu_url = htmlSpecialChars(preg_replace("/&menumode=[^&]/", "", $_SERVER[ 'REQUEST_URI' ])); +$menu_url .= ( false === strpos($menu_url, "?") ) ? "?menumode=" : "&menumode="; +foreach ($xoopsModuleConfig["valid_menumodes"] as $key => $val) { + if ($key != $menumode) $menumode_other[] = array("title"=>$val, "link"=>$menu_url.$key); +} + + +$newbb_module_header = ''; +$newbb_module_header .= '<link rel="alternate" type="application/rss+xml" title="'.$xoopsModule->getVar("name").'" href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', "n").'/rss.php" />'; +if (!empty($xoopsModuleConfig['pngforie_enabled'])) { + $newbb_module_header .= '<style type="text/css">img {behavior:url("include/pngbehavior.htc");}</style>'; +} +// START hacked by irmtfan to add localization/customization for newbb style.css +$dirname=$xoopsModule->getVar('dirname'); +$theme_path = "{$xoopsConfig['theme_set']}/modules/{$dirname}"; +$theme_default_path= "default/modules/{$dirname}"; +$default_path = "modules/{$dirname}/templates"; +$lang_path = "images/language/{$xoopsConfig['language']}"; + + // get from setted theme +if (is_file(XOOPS_THEME_PATH . '/'.$theme_path . '/' . $lang_path . '/style.css')) { + $rel_path=$theme_path . '/' . $lang_path; + // get from default theme +} else if (is_file(XOOPS_THEME_PATH . '/'.$theme_default_path . '/' . $lang_path . '/style.css')) { + $rel_path=$theme_default_path . '/' . $lang_path; + // get from module default path +} else if (is_file(XOOPS_ROOT_PATH. '/'.$default_path . '/' . $lang_path . '/style.css')) { + $rel_path=$default_path . '/' . $lang_path; + // if no one is found get the english from default path +} else if (is_file(XOOPS_ROOT_PATH. '/'.$default_path . '/images/language/english/style.css')) { + $rel_path=$default_path . '/images/language/english'; + // for backward compatibility - as before +} else { + $rel_path=$default_path; +} + +$newbb_module_header .= ' + <link rel="stylesheet" type="text/css" href="'.XOOPS_URL . '/' . $rel_path . '/style.css" /> + <script type="text/javascript">var toggle_cookie="'.$forumCookie['prefix'].'G'.'";</script> + <script src="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar("dirname").'/include/js/newbb_toggle.js" type="text/javascript"></script> + '; +// END hacked by irmtfan to add localization/customization for newbb style.css +if ($menumode == 2) { + $newbb_module_header .= ' + <link rel="stylesheet" type="text/css" href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar("dirname").'templates/newbb_menu_hover.css" /> + <style type="text/css">body {behavior:url("include/newbb.htc");}</style> + '; +} + +if ($menumode == 1) { + $newbb_module_header .= ' + <link rel="stylesheet" type="text/css" href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar("dirname").'templates/newbb_menu_click.css" /> + <script src="include/js/newbb_menu_click.js" type="text/javascript"></script> + '; +} + +$xoops_module_header = $newbb_module_header; // for cache hack + +if (!empty($xoopsModuleConfig["welcome_forum"]) && is_object($xoopsUser) && !$xoopsUser->getVar('posts')) { + mod_loadFunctions("welcome", "newbb"); +} + +$pollmodules = NULL; +//$module_handler = &xoops_gethandler('module'); +$xoopspoll = &$module_handler->getByDirname('xoopspoll'); +if (is_object($xoopspoll) && $xoopspoll->getVar('isactive')) { + $pollmodules = 'xoopspoll'; +} else { + //Umfrage + $xoopspoll = &$module_handler->getByDirname('umfrage'); + if (is_object($xoopspoll) && $xoopspoll->getVar('isactive')) + $pollmodules = 'umfrage'; +} +$xoopsLogger->stopTime('newBB_Header'); ?> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/include/plugin.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/include/plugin.php 2012-08-01 03:11:30 UTC (rev 9972) +++ XoopsModules/newbb/branches/irmtfan/newbb/include/plugin.php 2012-08-01 18:58:48 UTC (rev 9973) @@ -1,87 +1,87 @@ -<?php -/** - * CBB 4.0, or newbb, the forum module for XOOPS project - * - * @copyright The XOOPS Project http://xoops.sf.net - * @license http://www.fsf.org/copyleft/gpl.html GNU public license - * @author Taiwen Jiang (phppp or D.J.) <ph...@us...> - * @since 4.00 - * @version $Id $ - * @package module::newbb - */ - -if (!defined('XOOPS_ROOT_PATH')) { - exit(); -} -/* some static xoopsModuleConfig */ -$customConfig = array(); - -// specification for custom time format -// default manner will be used if not specified -$customConfig["formatTimestamp_custom"] = ""; // Could be set as "Y-m-d H:i" - -// requiring "name" field for anonymous users in edit form -$customConfig["require_name"] = true; - -// display "register or login to post" for anonymous users -$customConfig["show_reg"] = true; - -// perform forum/topic synchronization on module update -$customConfig["syncOnUpdate"] = true; - -// time for pending/deleted topics/posts, expired one will be removed automatically, in days; 0 or no cleanup -$customConfig["pending_expire"] = 0; - -// redirect to its URI of an attachment when requested -// Set to true if your attachment would be corrupted after download with normal way -$customConfig["download_direct"] = false; - -// Set allowed editors -// Should set from module preferences? -$customConfig["editor_allowed"] = array(); - -// Set the default editor -$customConfig["editor_default"] = "dhtmltextarea"; - -// Set the default editor for quick reply -$customConfig["editor_quick_default"] = "textarea"; - -// default value for editor rows, coloumns -$customConfig["editor_rows"] = 15; -$customConfig["editor_cols"] = 40; - -// default value for editor width, height (string) -$customConfig["editor_width"] = "100%"; -$customConfig["editor_height"] = "400px"; - -// storage method for reading records: 0 - none; 1 - cookie; 2 - db -$customConfig["read_mode"] = 2; - -// expire time for reading records, in days -$customConfig["read_expire"] = 30; - -// maximum records per forum for one user -$customConfig["read_items"] = 100; - -// Enable tag system -$customConfig["do_tag"] = 1; - -// Count posts counts of subfourms -$customConfig["count_subforum"] = 1; - -// Length for post title on index page: 0 for not showing post title, 255 for not truncate -$customConfig["length_title_index"] = 40; - -// MENU handler -/* You could remove anyone by commenting out in order to disable it */ -$customConfig["valid_menumodes"] = array( - 0 => _MD_MENU_SELECT, // for selectbox - //1 => _MD_MENU_CLICK, // for "click to expand" - //2 => _MD_MENU_HOVER // for "mouse hover to expand" - ); -// START hacked by irmtfan -// Display text links instead of image buttons for edit, reply, .... set true or false -$customConfig["display_text_links"] = false; -// END hacked by irmtfan -return $customConfig; +<?php +/** + * CBB 4.0, or newbb, the forum module for XOOPS project + * + * @copyright The XOOPS Project http://xoops.sf.net + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @author Taiwen Jiang (phppp or D.J.) <ph...@us...> + * @since 4.00 + * @version $Id $ + * @package module::newbb + */ + +if (!defined('XOOPS_ROOT_PATH')) { + exit(); +} +/* some static xoopsModuleConfig */ +$customConfig = array(); + +// specification for custom time format +// default manner will be used if not specified +$customConfig["formatTimestamp_custom"] = ""; // Could be set as "Y-m-d H:i" + +// requiring "name" field for anonymous users in edit form +$customConfig["require_name"] = true; + +// display "register or login to post" for anonymous users +$customConfig["show_reg"] = true; + +// perform forum/topic synchronization on module update +$customConfig["syncOnUpdate"] = true; + +// time for pending/deleted topics/posts, expired one will be removed automatically, in days; 0 or no cleanup +$customConfig["pending_expire"] = 0; + +// redirect to its URI of an attachment when requested +// Set to true if your attachment would be corrupted after download with normal way +$customConfig["download_direct"] = false; + +// Set allowed editors +// Should set from module preferences? +$customConfig["editor_allowed"] = array(); + +// Set the default editor +$customConfig["editor_default"] = "dhtmltextarea"; + +// Set the default editor for quick reply +$customConfig["editor_quick_default"] = "textarea"; + +// default value for editor rows, coloumns +$customConfig["editor_rows"] = 15; +$customConfig["editor_cols"] = 40; + +// default value for editor width, height (string) +$customConfig["editor_width"] = "100%"; +$customConfig["editor_height"] = "400px"; + +// storage method for reading records: 0 - none; 1 - cookie; 2 - db +$customConfig["read_mode"] = 2; + +// expire time for reading records, in days +$customConfig["read_expire"] = 30; + +// maximum records per forum for one user +$customConfig["read_items"] = 100; + +// Enable tag system +$customConfig["do_tag"] = 1; + +// Count posts counts of subfourms +$customConfig["count_subforum"] = 1; + +// Length for post title on index page: 0 for not showing post title, 255 for not truncate +$customConfig["length_title_index"] = 40; + +// MENU handler +/* You could remove anyone by commenting out in order to disable it */ +$customConfig["valid_menumodes"] = array( + 0 => _MD_MENU_SELECT, // for selectbox + //1 => _MD_MENU_CLICK, // for "click to expand" + //2 => _MD_MENU_HOVER // for "mouse hover to expand" + ); +// START hacked by irmtfan +// Display text links instead of image buttons for edit, reply, .... set true or false +$customConfig["display_text_links"] = false; +// END hacked by irmtfan +return $customConfig; ?> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/language/persian/admin.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/language/persian/admin.php 2012-08-01 03:11:30 UTC (rev 9972) +++ XoopsModules/newbb/branches/irmtfan/newbb/language/persian/admin.php 2012-08-01 18:58:48 UTC (rev 9973) @@ -277,7 +277,7 @@ define("_AM_NEWBB_TYPE_LIST", "فهرست نوع ها"); define("_AM_NEWBB_TODEL_TYPE", "آیا مطمان هستید که میخواهید نوع [%s] را حذف کنید؟"); define("_AM_NEWBB_TYPE_EDITFORUM_DESC", "اطلاعات هنوز ذخیره نشده اند. باید روی دکمه ارسال بزنید تا ذخیره شوند."); -define("_AM_NEWBB_TYPE_ORDER_DESC", "برای فعال کردن یک نوع برای یک انجمن، یک عدد بالاتر از 0 را برای ترتیب نوع 'type_order' انتخاب کنید. به عبارت دیگر اگر ترتیب نوع 'type_order' را 0 انتخاب کنید، آن نوع برای آن انجمن غیر فعال خواهد شد"); +define("_AM_NEWBB_TYPE_ORDER_DESC", "برای فعال کردن یک نوع برای یک انجمن، یک عدد بالاتر از 0 را برای نوع تاپیک 'type_order' انتخاب کنید. به عبارت دیگر اگر نوع تاپیک 'type_order' را 0 انتخاب کنید، آن نوع برای آن انجمن غیر فعال خواهد شد"); // admin_synchronization.php define("_AM_NEWBB_SYNC_TYPE_FORUM", "داده های انجمن"); Modified: XoopsModules/newbb/branches/irmtfan/newbb/language/persian/main.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/language/persian/main.php 2012-08-01 03:11:30 UTC (rev 9972) +++ XoopsModules/newbb/branches/irmtfan/newbb/language/persian/main.php 2012-08-01 18:58:48 UTC (rev 9973) @@ -10,7 +10,7 @@ define('_MD_MAX_FILESIZE','حداکثر اندازه فایل'); define('_MD_ATTACHMENT','پیوست'); define('_MD_FILESIZE','اندازه'); -define('_MD_HITS','تعداد دانلود'); +define('_MD_HITS','دفعات دیدن'); define('_MD_GROUPS','گروهها:'); define('_MD_DEL_ONE','فقط این پیام را پاک کن'); define('_MD_DEL_RELATED','این پیام و تمامی پیامهای مربوط به آن را پاک کن'); @@ -431,8 +431,8 @@ define("_MD_NEWBB_SEENOTGUEST","<font color=\"red\"><b>فقط برای کاربران عضو سایت</b></font>"); define("_MD_NEWBB_REPORTSUBJECT","A contribution has been reported"); define("_MD_NEWBB_GOTOLASTPOST","رفتن به آخرین پست ارسال شده"); -define("_MD_EDITEDMSG","دلیل ویرایش:"); -define("_MD_DELEDEDMSG","دلیل حذف پست<br /><small>(اگر دلیلی نوشته شده فرد ارسال کننده پست با خبر خواهد شد)</small>:"); +define("_MD_EDITEDMSG","دلیل ویرایش پست (اختیاری):"); +define("_MD_DELEDEDMSG","دلیل ویرایش پست<br /><small>(اگر دلیلی نوشته شده فرد ارسال کننده پست با خبر خواهد شد)</small>:"); define("_MD_DELEDEDMSG_SUBJECT","پست شما حذف شد"); define("_MD_DELEDEDMSG_BODY","سلام %s, پست شما در انجمن زیر Modified: XoopsModules/newbb/branches/irmtfan/newbb/language/persian/modinfo.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/language/persian/modinfo.php 2012-08-01 03:11:30 UTC (rev 9972) +++ XoopsModules/newbb/branches/irmtfan/newbb/language/persian/modinfo.php 2012-08-01 18:58:48 UTC (rev 9973) @@ -33,7 +33,7 @@ define("_MI_NEWBB_ADMENU_REPORT","گزارش ها"); define("_MI_NEWBB_ADMENU_DIGEST","خلاصه"); define("_MI_NEWBB_ADMENU_VOTE","نظر سنجی ها"); -define("_MI_NEWBB_ADMENU_TYPE", "نوع های تاپیک"); +define("_MI_NEWBB_ADMENU_TYPE", "نوع تاپیک ها"); define("_MI_NEWBB_ADMENU_ABOUT", "درباره این ماژول"); //config options @@ -140,7 +140,7 @@ define("_MI_POST_TIMELIMIT", "ایجاد محدودیت زمانی برای زدن پست های پشت سر هم"); define("_MI_POST_TIMELIMIT_DESC", "قرار دادن محدودیت زمانی برای زدن پیام پشت سر هم. به ثانیه، 0 به معنی بدون محدودیت است"); define("_MI_RECORDEDIT_TIMELIMIT", "محدودیت زمانی برای ذخیره شدن اطلاعات مربوط به ویرایش شدن پیام"); -define("_MI_RECORDEDIT_TIMELIMIT_DESC", "قرار دادن یک زمان به دقیقه که از آن زمان به بعد پس از ارسال پست ویرایش های آن پست ذخیره میشوند. قرار دادن 0 به این معنی است که هیچ ویرایشی ثبت نشود."); +define("_MI_RECORDEDIT_TIMELIMIT_DESC", "قرار دادن محدودیت زمانی برای ذخیره شدن اطلاعات ویرایش پیام ها به دقیقه. 0 به معنی این است که عبارت ویرایش شد در زیر پیام ها اضافه نشود"); //define("_MI_SUBJECT_PREFIX_LEVEL", "سطح دسترسی برای گروه هایی که میتوانند پیشوند (Prefix) اضافه کنند"); //define("_MI_SUBJECT_PREFIX_LEVEL_DESC", "گروه های مجاز را انتخاب کنید"); //define("_MI_SPL_DISABLE", 'غیر فعال'); @@ -229,7 +229,7 @@ میتوانید ثبت نام کرده و سپس مبادرت به ارسال پیام کنید.<br /><br /> اگر هر سوالی راجع به استفاده از newbb دارید, لطفا سایت پشتیبانی را بازدید کنید <a href=\"http://www.xoops.ir/modules/newbb/\" target=\"_blank\" title=\"newbb @ persian xoops\">ماژول انجمن ها</a>. "); -define("_MI_NEWBB_ADMENU_GROUPMOD", "انتخاب گروهی ناظران"); +define("_MI_NEWBB_ADMENU_GROUPMOD", "نظارت بر گروه ها"); define("_MI_SUBJECT_PREFIX", "اضافه کردن پیشوند به ابتدای عنوان"); define("_MI_SUBJECT_PREFIX_DESC", "قرار دادن یک پیشوند مثلا [حل شده] در ابتدای نام یک عنوان.برای جدا کردن گزینه ها از ',' استفاده کنید، اگر میخواهید هیچ پیشوندی نداشته باشید فقط NONE را باقی بگذارید."); define("_MI_SUBJECT_PREFIX_DEFAULT", '<font color="#00CC00">[حل شده]</font>,<font color="#00CC00">[قطعی شده]</font>,<font color="#FF0000">[درخواست شده]</font>,<font color="#FF0000">[گزارش خطا]</font>,<font color="#FF0000">[حل نشده]</font>'); @@ -250,7 +250,7 @@ define('_MI_NEWBB_INFOBOX_HIDDEN', 'بله به صورت فشرده'); define('_MI_NEWBB_INFOBOX_SHOW', 'بله به صورت کامل'); define('_MI_SHOW_SOCIALLINKS', "نمایش لینک های شبکه های اجتماعی"); -define('_MI_SHOW_SOCIALLINKS_DESC', "دکمه های شبکه های اجتماعی از جمله فیس بوک و تویتر را نمایش میدهد"); +define('_MI_SHOW_SOCIALLINKS_DESC', "دکمه های شبکه های اجتماعی از چمله فیس بوک و تویتر را نمایش میدهد"); //4.2 define("_MI_PAGENAV_DISPLAY","نمایش مرورگر"); Modified: XoopsModules/newbb/branches/irmtfan/newbb/polls.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/polls.php 2012-08-01 03:11:30 UTC (rev 9972) +++ XoopsModules/newbb/branches/irmtfan/newbb/polls.php 2012-08-01 18:58:48 UTC (rev 9973) @@ -1,570 +1,580 @@ -<?php -/** - * Newbb module - * - * You may not change or alter any portion of this comment or credits - * of supporting developers from this source code or any supporting source code - * which is considered copyrighted (c) material of the original comment or credit authors. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ - * @license http://www.fsf.org/copyleft/gpl.html GNU public license - * @package newbb - * @since 4.0 - * @author Taiwen Jiang <ph...@us...> - * @version $Id: polls.php 2175 2008-09-23 14:07:03Z phppp $ - */ - - -include_once dirname(__FILE__) . "/header.php"; - -include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php"; -include_once XOOPS_ROOT_PATH . "/class/xoopslists.php"; -include_once XOOPS_ROOT_PATH . "/class/xoopsblock.php"; - -if ( $pollmodules == 'xoopspoll') -{ - include XOOPS_ROOT_PATH . "/modules/xoopspoll/include/constants.php"; - include_once XOOPS_ROOT_PATH . "/modules/xoopspoll/class/xoopspoll.php"; - include_once XOOPS_ROOT_PATH . "/modules/xoopspoll/class/xoopspolloption.php"; - include_once XOOPS_ROOT_PATH . "/modules/xoopspoll/class/xoopspolllog.php"; - include_once XOOPS_ROOT_PATH . "/modules/xoopspoll/class/xoopspollrenderer.php"; -} -elseif ($pollmodules == 'umfrage') -{ - include XOOPS_ROOT_PATH."/modules/umfrage/include/constants.php"; - include_once XOOPS_ROOT_PATH."/modules/umfrage/class/umfrage.php"; - include_once XOOPS_ROOT_PATH."/modules/umfrage/class/umfrageoption.php"; - include_once XOOPS_ROOT_PATH."/modules/umfrage/class/umfragelog.php"; - include_once XOOPS_ROOT_PATH."/modules/umfrage/class/umfragerenderer.php"; -} -else -{ - redirect_header("javascript:history.go(-1);", 2, _MD_POLLMODULE_ERROR); - exit(); -} - -$op = "add"; -if (isset($_GET['op'])) $op = $_GET['op']; -if (isset($_POST['op'])) $op = $_POST['op']; -if (isset($_GET['poll_id'])) $poll_id = intval($_GET['poll_id']); -if (isset($_POST['poll_id'])) $poll_id = intval($_POST['poll_id']); -if (isset($_GET['topic_id'])) $topic_id = intval($_GET['topic_id']); -if (isset($_POST['topic_id'])) $topic_id = intval($_POST['topic_id']); - -if (!isset($module_handler)) $module_handler =& xoops_gethandler('module'); -$xoopspoll =& $module_handler->getByDirname($pollmodules); -if (!is_object($xoopspoll) || !$xoopspoll->getVar('isactive')) { - redirect_header("javascript:history.go(-1);", 2, _MD_POLLMODULE_ERROR); - exit(); -} - -include XOOPS_ROOT_PATH . "/header.php"; - -$topic_handler =& xoops_getmodulehandler('topic', 'newbb'); -$topic_obj =& $topic_handler->get($topic_id); -$forum = $topic_obj->getVar('forum_id'); -$forum_handler =& xoops_getmodulehandler('forum', 'newbb'); -$forum_obj =& $forum_handler->get($forum); -if (!$forum_handler->getPermission($forum_obj)) { - redirect_header("index.php", 2, _MD_NORIGHTTOACCESS); - exit(); -} -if (!$topic_handler->getPermission($forum_obj, $topic_obj->getVar('topic_status'), "view")) { - redirect_header("viewforum.php?forum=" . $forum_obj->getVar('forum_id'), 2, _MD_NORIGHTTOVIEW); - exit(); -} - -$isadmin = newbb_isAdmin($forum_obj); -$perm = false; -if ($isadmin) { - $perm = true; -} elseif ($topic_handler->getPermission($forum_obj, $topic_obj->getVar('topic_status'), "addpoll") - //&& $forum_obj->getVar('allow_polls') == 1 -) { - if ( ($op=="add" || $op=="save") && !$topic_obj->getVar("topic_haspoll") && is_object($xoopsUser) && $xoopsUser->getVar("uid") == $topic_obj->getVar("topic_poster") ) { - $perm = true; - } elseif (!empty($poll_id)) { - $poll = new XoopsPoll($poll_id); - if (is_object($xoopsUser) && $xoopsUser->getVar("uid") == $poll->getVar("user_id")) { - $perm = true; - } - } -} -if (!$perm) { - redirect_header("viewtopic.php?topic_id=" . $topic_id, 2, _NOPERM); -} - -if ( $op == "add" ) { - $poll_form = new XoopsThemeForm(_MD_POLL_CREATNEWPOLL, "poll_form", "polls.php"); - - $question_text = new XoopsFormText(_MD_POLL_POLLQUESTION, "question", 50, 255); - $poll_form->addElement($question_text, true); - - $desc_tarea = new XoopsFormTextarea(_MD_POLL_POLLDESC, "description"); - $poll_form->addElement($desc_tarea); - - $currenttime = formatTimestamp(time(), "Y-m-d H:i:s"); - $endtime = formatTimestamp(time() + 604800, "Y-m-d H:i:s"); - $expire_text = new XoopsFormText(_MD_POLL_EXPIRATION . "<br /><small>" . _MD_POLL_FORMAT . "<br />" . sprintf(_MD_POLL_CURRENTTIME, $currenttime) . "</small>", "end_time", 30, 19, $endtime); - $poll_form->addElement($expire_text); - - $weight_text = new XoopsFormText(_MD_POLL_DISPLAYORDER, "weight", 6, 5, 0); - $poll_form->addElement($weight_text); - - $multi_yn = new XoopsFormRadioYN(_MD_POLL_ALLOWMULTI, "multiple", 0); - $poll_form->addElement($multi_yn); - - $notify_yn = new XoopsFormRadioYN(_MD_POLL_NOTIFY, "notify", 1); - $poll_form->addElement($notify_yn); - - $option_tray = new XoopsFormElementTray(_MD_POLL_POLLOPTIONS, ""); - $barcolor_array = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . "/modules/".$pollmodules."/images/colorbars/"); - for($i = 0; $i < 10; $i++) { - $current_bar = (current($barcolor_array) != "blank.gif") ? current($barcolor_array) : next($barcolor_array); - $option_text = new XoopsFormText("", "option_text[]", 50, 255); - $option_tray->addElement($option_text); - $color_select = new XoopsFormSelect("", "option_color[{$i}]", $current_bar); - $color_select->addOptionArray($barcolor_array); - $color_select->setExtra("onchange='showImgSelected(\"option_color_image[{$i}]\", \"option_color[{$i}]\", \"modules/".$pollmodules."/images/colorbars\", \"\", \"" . XOOPS_URL . "\")'"); - $color_label = new XoopsFormLabel("", "<img src='" . XOOPS_URL . "/modules/".$pollmodules."/images/colorbars/" . $current_bar . "' name='option_color_image[{$i}]' id='option_color_image[{$i}]' width='30' align='bottom' height='15' alt='' /><br />"); - $option_tray->addElement($color_select); - $option_tray->addElement($color_label); - if ( !next($barcolor_array) ) { - reset($barcolor_array); - } - unset($color_select, $color_label); - } - $poll_form->addElement($option_tray); - - $submit_button = new XoopsFormButton("", "poll_submit", _SUBMIT, "submit"); - $poll_form->addElement($submit_button); - $op_hidden = new XoopsFormHidden("op", "save"); - $poll_form->addElement($op_hidden); - $poll_topic_id_hidden = new XoopsFormHidden("topic_id", $topic_id); - $poll_form->addElement($poll_topic_id_hidden); - //include XOOPS_ROOT_PATH . "/header.php"; - echo "<h4>" . _MD_POLL_POLLCONF . "</h4>"; - $poll_form->display(); - //include XOOPS_ROOT_PATH . "/footer.php"; - //exit(); -} - -if ( $op == "save" ) { - /* - * The option check should be done before submitting - */ - $option_empty = true; - if (empty($_POST['option_text'])) { - redirect_header("javascript:history.go(-1);", 2, _MD_ERROROCCURED . ': ' . _MD_POLL_POLLOPTIONS . ' !'); - } - $option_text = $_POST['option_text']; - foreach ( $option_text as $optxt ) { - if ( trim($optxt) != "" ) { - $option_empty = false; - break; - } - } - if ($option_empty) { - redirect_header("javascript:history.go(-1);", 2, _MD_ERROROCCURED . ': ' . _MD_POLL_POLLOPTIONS . ' !'); - } - if ( $pollmodules == 'xoopspoll') - $poll = new XoopsPoll(); - else if ( $pollmodules == 'umfrage') - $poll = new Umfrage(); - else die("POLL-ERROR: polls.php Line 190"); - $poll->setVar("question", @$_POST['question']); - $poll->setVar("description", @$_POST['description']); - if ( !empty($_POST['end_time']) ) { - $timezone = is_object($xoopsUser) ? $xoopsUser->getVar("timezone") : null; - $poll->setVar("end_time", userTimeToServerTime(strtotime($_POST['end_time']), $timezone)); - } else { - // if expiration date is not set, set it to 10 days from now - $poll->setVar("end_time", time() + (86400 * 10)); - } - $poll->setVar("display", 0); - $poll->setVar("weight", intval(@$_POST['weight'])); - $poll->setVar("multiple", intval(@$_POST['multiple'])); - if ( !empty($_POST["notify"]) ) { - // if notify, set mail status to "not mailed" - $poll->setVar("mail_status", POLL_NOTMAILED); - } else { - // if not notify, set mail status to already "mailed" - $poll->setVar("mail_status", POLL_MAILED); - } - $uid = is_object($xoopsUser) ? $xoopsUser->getVar("uid") : 0; - $poll->setVar("user_id", $uid); - $new_poll_id = $poll->store(); - $option_color = empty($_POST['option_color']) ? NULL : $_POST['option_color']; - if ( !empty($new_poll_id) ) { - $i = 0; - foreach ( $option_text as $optxt ) { - $optxt = trim($optxt); - if ( $optxt != "" ) { - if ( $pollmodules == 'xoopspoll') - $option = new XoopsPollOption(); - else if ( $pollmodules == 'umfrage') - $option = new UmfrageOption(); - else die("POLL-ERROR: polls.php Line 223"); - $option->setVar("option_text", $optxt); - $option->setVar("option_color", $option_color[$i]); - $option->setVar("poll_id", $new_poll_id); - $option->store(); - } - $i++; - } - $sql = "UPDATE " . $xoopsDB->prefix("bb_topics") . " SET topic_haspoll = 1, poll_id = {$new_poll_id} WHERE topic_id = {$topic_id}"; - if ( !$result = $xoopsDB->query($sql) ) { - xoops_error($xoopsDB->error()); - } - include_once XOOPS_ROOT_PATH . '/class/template.php'; - xoops_template_clear_module_cache($xoopsModule->getVar('mid')); - } else { - xoops_error($poll->getHtmlErrors()); - exit(); - } - redirect_header("viewtopic.php?topic_id={$topic... [truncated message content] |
From: <ir...@us...> - 2012-08-02 05:24:44
|
Revision: 9976 http://xoops.svn.sourceforge.net/xoops/?rev=9976&view=rev Author: irmtfan Date: 2012-08-02 05:24:36 +0000 (Thu, 02 Aug 2012) Log Message: ----------- deleted the last revision 9947. there was mistakenly updated Revision Links: -------------- http://xoops.svn.sourceforge.net/xoops/?rev=9947&view=rev Modified Paths: -------------- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev9883.txt XoopsModules/newbb/branches/irmtfan/newbb/class/user.php XoopsModules/newbb/branches/irmtfan/newbb/docs/changelog.txt XoopsModules/newbb/branches/irmtfan/newbb/header.php XoopsModules/newbb/branches/irmtfan/newbb/include/plugin.php XoopsModules/newbb/branches/irmtfan/newbb/language/persian/admin.php XoopsModules/newbb/branches/irmtfan/newbb/language/persian/main.php XoopsModules/newbb/branches/irmtfan/newbb/language/persian/modinfo.php XoopsModules/newbb/branches/irmtfan/newbb/polls.php XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_index.html XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_thread.html XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewall.html XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewforum.html XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewpost.html XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html XoopsModules/newbb/branches/irmtfan/newbb/xoops_version.php Added Paths: ----------- XoopsModules/newbb/branches/irmtfan/newbb/templates/style.css Removed Paths: ------------- XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/english/style.css XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/style.css Modified: XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev9883.txt =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev9883.txt 2012-08-01 22:31:12 UTC (rev 9975) +++ XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev9883.txt 2012-08-02 05:24:36 UTC (rev 9976) @@ -1,27 +1,7 @@ Changelog from rev.9883 -date: 2012-08-01 -================================================ -1- localization: input date localized (for other date systems like hegira) by replacing strtotime by XoopsLocal::strtotime -in newbb/polls.php - -2- customization&localization: newbb style.css is fully localized and customized and is not hard-coded anymore. -in newbb/header.php -file changes: --- deleted newbb/templates/style.css --- added newbb/templates/images/language/english/style.css --- added newbb/templates/images/language/persian/style.css -priorities: -if exist in themes/YOUR_THEME/modules/newbb/images/language/YOUR_LANG/style.css take it -else if exist in themes/default/modules/newbb/images/language/YOUR_LANG/style.css take it -else if exist in modules/newbb/templates/images/language/YOUR_LANG/style.css take it -else if exist in modules/newbb/templates/images/language/english/style.css take it -else if exist in modules/newbb/templates/style.css take it (for backward compatibility) - -3- many hardcodes in newbb/templates and style.css has been removed - date: 2012-07-30 ================================================ -1- bug fix: edit not displayed when the reason is not filled (irmtfan) +1- bug fix: edit not record when the reason is not filled (irmtfan) 2- bug fix: only the last edit is recorded. (irmtfan/alfred) in newbb/class/post.php 3- bug fix: 'noapprove' permission incorrectly recorded in database. (irmtfan) @@ -32,5 +12,5 @@ in newbb/xoops_version.php 6- hardcode: some style.css color hardcodes has been removed. (irmtfan) in newbb/templates/style.css -7- feature added: text links instead of buttons. (deka87/irmtfan) -in newbb/class/icon.php , newbb/include/functions.render.php , newbb/include/plugin.php \ No newline at end of file +7- feature added: text links instead of buttons. (deka98/irmtfan) +in newbb/class/icon.php , newbb/include/functions.render.php , newbb/include/plugin.php Modified: XoopsModules/newbb/branches/irmtfan/newbb/class/user.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/class/user.php 2012-08-01 22:31:12 UTC (rev 9975) +++ XoopsModules/newbb/branches/irmtfan/newbb/class/user.php 2012-08-02 05:24:36 UTC (rev 9976) @@ -1,318 +1,298 @@ -<?php -/** - * CBB 4.0, or newbb, the forum module for XOOPS project - * - * @copyright The XOOPS Project http://xoops.sf.net - * @license http://www.fsf.org/copyleft/gpl.html GNU public license - * @author Taiwen Jiang (phppp or D.J.) <ph...@us...> - * @since 4.00 - * @version $Id $ - * @package module::newbb - */ - -if (!defined("XOOPS_ROOT_PATH")) { - exit(); -} - -defined("NEWBB_FUNCTIONS_INI") || include XOOPS_ROOT_PATH.'/modules/newbb/include/functions.ini.php'; - -function newbb_calculateLevel($RPG, $RPGDIFF) -{ - - //$RPG = $user->getVar('posts'); - //$RPGDIFF = $user->getVar('user_regdate'); - - $today = time(); - $diff = $today - $RPGDIFF; - $exp = round($diff / 86400,0); - if ($exp <= 0) { $exp = 1; } - $ppd= round($RPG / $exp, 0); - $level = pow (log10 ($RPG), 3); - $ep = floor (100 * ($level - floor ($level))); - $showlevel = floor ($level + 1); - $hpmulti =round ($ppd / 6, 1); - if ($hpmulti > 1.5) { $hpmulti = 1.5; } - if ($hpmulti < 1) { $hpmulti = 1; } - $maxhp = $level * 25 * $hpmulti; - $hp= $ppd / 5; - if ($hp >= 1) { - $hp= $maxhp; - } else { - $hp= floor ($hp * $maxhp); - } - $hp= floor ($hp); - $maxhp= floor ($maxhp); - if ($maxhp <= 0) { - $zhp = 1; - } else { - $zhp = $maxhp; - } - $hpf= floor (100 * ($hp / $zhp)) - 1; - $maxmp= ($exp * $level) / 5; - $mp= $RPG / 3; - if ($mp >= $maxmp) { $mp = $maxmp; } - $maxmp = floor ($maxmp); - $mp = floor ($mp); - if ($maxmp <= 0) { - $zmp = 1; - } else { - $zmp = $maxmp; - } - $mpf= floor (100 * ($mp / $zmp)) - 1; - if ( $hpf >= 98 ) { $hpf = $hpf - 2; } - if ( $ep >= 98 ) { $ep = $ep - 2; } - if ( $mpf >= 98 ) { $mpf = $mpf - 2; } - - $level = array(); - $level['level'] = $showlevel ; - $level['exp'] = $ep; - $level['exp_width'] = $ep.'%'; - $level['hp'] = $hp; - $level['hp_max'] = $maxhp; - $level['hp_width'] = $hpf.'%'; - $level['mp'] = $mp; - $level['mp_max'] = $maxmp; - $level['mp_width'] = $mpf.'%'; - - return $level; -} - -class newbbUser { - var $user = null; - - function User() - { - } - - function getUserbar() - { - global $xoopsModuleConfig, $xoopsUser, $isadmin; - - $userbar = array(); - if (empty($xoopsModuleConfig['userbar_enabled'])) return $userbar; - - $user = $this->user; - $userbar["profile"] = array("link" => XOOPS_URL . "/userinfo.php?uid=" . $user->getVar("uid"), "name" => _PROFILE); - - if (is_object($xoopsUser)) { - $userbar["pm"] = array("link" => "javascript:void openWithSelfMain('" . XOOPS_URL . "/pmlite.php?send2=1&to_userid=" . $user->getVar("uid") . "', 'pmlite', 450, 380);", "name" => _MD_PM); - } - if ($user->getVar('user_viewemail') || $isadmin) { - $userbar["email"] = array("link" => "javascript:void window.open('mailto:" . $user->getVar('email') . "', 'new');", "name" => _MD_EMAIL); - } - if ($url = $user->getVar('url')) { - $userbar["url"] = array("link" => "javascript:void window.open('" . $url . "', 'new');", "name" => _MD_WWW); - } - if ($icq = $user->getVar('user_icq')) { - $userbar["icq"] = array("link" => "javascript:void window.open('http://wwp.icq.com/scripts/search.dll?to=" . $icq."', 'new');", "name" => _MD_ICQ); - } - if ($aim = $user->getVar('user_aim')) { - $userbar["aim"]= array("link" => "javascript:void window.open('aim:goim?screenname=" . $aim . "&message=Hi+" . $aim . "+Are+you+there?" . "', 'new');", "name" => _MD_AIM); - } - if ($yim = $user->getVar('user_yim')) { - $userbar["yim"] = array("link" => "javascript:void window.open('http://edit.yahoo.com/config/send_webmesg?.target=" . $yim . "&.src=pg" . "', 'new');", "name" => _MD_YIM); - } - if ($msn = $user->getVar('user_msnm')) { - $userbar["msnm"] = array("link" => "javascript:void window.open('http://members.msn.com?mem=" . $msn . "', 'new');", "name" => _MD_MSNM); - } - - return $userbar; - } - - function getLevel() - { - global $xoopsModuleConfig, $forumUrl; - - $level = newbb_calculateLevel($this->user->getVar("posts"), $this->user->getVar("user_regdate")); - $info=''; - if ($xoopsModuleConfig['user_level'] == 2) { - static $rpg_images; - if (!isset($rpg_images)) { - $icon_handler = newbb_getIconHandler(); - $rpg_path = $icon_handler->getPath("rpg"); - foreach (array("img_left", "img_backing", "img_right", "blue", "green", "orange") as $img) { - $rpg_images[$img] = XOOPS_URL . '/' . $rpg_path . '/'.$img.'.gif'; - } - } - $table = "<table class='userlevel'><tr><td class='end'><img src='" . $rpg_images['img_left'] . "' alt='' /></td><td class='center' background='" . $rpg_images['img_backing'] . "'><img src='%s' width='%d' alt='' align='left' /></td><td><img src='" . $rpg_images['img_right'] . "' alt='' /></td></tr></table>"; - - $info = _MD_LEVEL . " " . $level['level'] . "<br />" . _MD_HP . " " . $level['hp'] . " / " . $level['hp_max'] . "<br />". - sprintf($table, $rpg_images["orange"], $level['hp_width']); - $info .= _MD_MP . " " . $level['mp'] . " / " . $level['mp_max'] . "<br />". - sprintf($table, $rpg_images["green"], $level['mp_width']); - $info .= _MD_EXP . " " . $level['exp'] . "<br />". - sprintf($table, $rpg_images["blue"], $level['exp_width']); - } else { - $info = _MD_LEVEL . " " . $level['level'] . "; ". _MD_EXP . " " . $level['exp'] . "<br />"; - $info .= _MD_HP . " " . $level['hp'] . " / " . $level['hp_max'] . "<br />"; - $info .= _MD_MP . " " . $level['mp'] . " / " . $level['mp_max']; - } - return $info; - } - - function getInfo(&$user) - { - global $xoopsModuleConfig, $myts; - static $name_anonymous; - - if ( !(is_object($user)) || !($user->isActive()) ) { - if (!isset($name_anonymous)) { - $name_anonymous = $myts->HtmlSpecialChars($GLOBALS["xoopsConfig"]['anonymous']); - } - return array("name" => $name_anonymous, "link" => $name_anonymous); - } - - $this->user = $user; - - $userinfo["uid"] = $user->getVar("uid"); - - $name = empty($xoopsModuleConfig['show_realname']) ? $user->getVar('uname') : $user->getVar('name'); - $userinfo["name"] = $name ? $name : $user->getVar('uname'); - - $userinfo["link"] = "<a href=\"".XOOPS_URL . "/userinfo.php?uid=" . $user->getVar("uid") ."\">".$userinfo["name"]."</a>"; - - $userinfo["avatar"] = $user->getVar('user_avatar'); - - $userinfo["from"] = $user->getVar('user_from'); - - mod_loadFunctions("time", "newbb"); - $userinfo["regdate"] = newbb_formatTimestamp($user->getVar('user_regdate'), 'reg'); - - $userinfo["posts"] = $user->getVar('posts'); - - if (!empty($xoopsModuleConfig['user_level'])) { - $userinfo["level"] = $this->getLevel(); - } - - if (!empty($xoopsModuleConfig['userbar_enabled'])) { - $userinfo["userbar"] = $this->getUserbar(); - } - - $userinfo["signature"] = $user->getVar('user_sig'); - return $userinfo; - } -} - -class NewbbUserHandler -{ - var $enableGroup; - var $enableOnline; - var $userlist = array(); - var $users = array(); - //var $online = array(); - - function NewbbUserHandler($enableGroup = true, $enableOnline = true) - { - $this->enableGroup = $enableGroup; - $this->enableOnline = $enableOnline; - } - - function loadUserInfo() - { - @include_once XOOPS_ROOT_PATH."/modules/".$GLOBALS["xoopsModule"]->getVar("dirname", "n")."/language/".$GLOBALS["xoopsConfig"]["language"]."/user.php"; - if (class_exists("User_language")) { - $handler = new User_language(); - } else { - $handler = new newbbUser(); - } - foreach (array_keys($this->users) as $uid) { - $this->userlist[$uid] = $handler->getInfo($this->users[$uid]); - } - } - - function loadUserOnline() - { - if (empty($this->users) || !$this->enableOnline) return; - mod_loadFunctions("render", "newbb"); - $image_online = newbb_displayImage('online', _MD_ONLINE); - $image_offline = newbb_displayImage('offline',_MD_OFFLINE); - - $online_handler =& xoops_getmodulehandler('online', 'newbb'); - $onlines = $online_handler->checkStatus(array_keys($this->users)); - - foreach (array_keys($this->users) as $uid) { - $this->userlist[$uid]["status"] = empty($onlines[$uid]) ? $image_offline : $image_online; - } - } - - function loadUserGroups() - { - GLOBAL $xoopsDB; - - if (empty($this->users) || !$this->enableGroup) return; - - $groups = array(); - $member_handler =& xoops_gethandler('member'); - $groups_obj = $member_handler->getGroups(); - $count = count($groups_obj); - for ($i = 0; $i < $count; $i++) { - $groups[$groups_obj[$i]->getVar('groupid')] = $groups_obj[$i]->getVar('name'); - } - unset($groups_obj); - - $sql = 'SELECT groupid, uid FROM ' . $xoopsDB->prefix('groups_users_link') . " WHERE uid IN( " . implode(", ", array_keys($this->users)) . ")"; - $result = $xoopsDB->query($sql); - while ($myrow = $xoopsDB->fetchArray($result)) { - $this->userlist[$myrow['uid']]["groups"][] = $groups[$myrow['groupid']]; - } - } - - function loadUserDigest() - { - GLOBAL $xoopsDB; - - if (empty($this->users)) return; - - $sql = 'SELECT user_digests, uid FROM ' . $xoopsDB->prefix('bb_user_stats') . " WHERE uid IN( " . implode(", ", array_keys($this->users)) . ")"; - $result = $xoopsDB->query($sql); - while ($myrow = $xoopsDB->fetchArray($result)) { - $this->userlist[$myrow['uid']]["digests"] = intval( $myrow['user_digests'] ); - } - } - - function loadUserRank() - { - GLOBAL $xoopsDB; - - if (empty($this->users)) return; - $myts =& MyTextSanitizer::getInstance(); - - $sql = 'SELECT * FROM ' . $xoopsDB->prefix('ranks'); - $result = $xoopsDB->query($sql); - while ($myrow = $xoopsDB->fetchArray($result)) { - $ranks[$myrow['rank_id']] = $myrow; - $ranks[$myrow['rank_id']]["rank_title"] = $myts->htmlspecialchars($ranks[$myrow['rank_id']]["rank_title"]); - if (!empty($ranks[$myrow['rank_id']]['rank_image'])) { - $ranks[$myrow['rank_id']]['rank_image'] = "<img src='" . XOOPS_UPLOAD_URL . "/ranks/" . htmlspecialchars($ranks[$myrow['rank_id']]['rank_image'], ENT_QUOTES) . "' alt='' />"; - } - } - - foreach (array_keys($this->userlist) as $uid) { - if ($rank = $this->users[$uid]->getVar("rank")) { - $this->userlist[$uid]["rank"]["title"] = $ranks[$rank]["rank_title"]; - $this->userlist[$uid]["rank"]["image"] = $ranks[$rank]["rank_image"]; - continue; - } - foreach ($ranks as $id => $rank) { - if ($rank["rank_min"] <= $this->userlist[$uid]["posts"] && $rank["rank_max"] >= $this->userlist[$uid]["posts"]) { - $this->userlist[$uid]["rank"]["title"] = $rank["rank_title"]; - $this->userlist[$uid]["rank"]["image"] = $rank["rank_image"]; - break; - } - } - } - } - - function getUsers() - { - $this->loadUserInfo(); - $this->loadUserOnline(); - $this->loadUserGroups(); - $this->loadUserRank(); - $this->loadUserDigest(); - - return $this->userlist; - } -} - +<?php +/** + * CBB 4.0, or newbb, the forum module for XOOPS project + * + * @copyright The XOOPS Project http://xoops.sf.net + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @author Taiwen Jiang (phppp or D.J.) <ph...@us...> + * @since 4.00 + * @version $Id $ + * @package module::newbb + */ + +if (!defined("XOOPS_ROOT_PATH")) { + exit(); +} + +defined("NEWBB_FUNCTIONS_INI") || include XOOPS_ROOT_PATH.'/modules/newbb/include/functions.ini.php'; + +function newbb_calculateLevel($RPG, $RPGDIFF) +{ + + //$RPG = $user->getVar('posts'); + //$RPGDIFF = $user->getVar('user_regdate'); + + $today = time(); + $diff = $today - $RPGDIFF; + $exp = round($diff / 86400,0); + if ($exp <= 0) { $exp = 1; } + $ppd= round($RPG / $exp, 0); + $level = pow (log10 ($RPG), 3); + $ep = floor (100 * ($level - floor ($level))); + $showlevel = floor ($level + 1); + $hpmulti =round ($ppd / 6, 1); + if ($hpmulti > 1.5) { $hpmulti = 1.5; } + if ($hpmulti < 1) { $hpmulti = 1; } + $maxhp = $level * 25 * $hpmulti; + $hp= $ppd / 5; + if ($hp >= 1) { + $hp= $maxhp; + } else { + $hp= floor ($hp * $maxhp); + } + $hp= floor ($hp); + $maxhp= floor ($maxhp); + if ($maxhp <= 0) { + $zhp = 1; + } else { + $zhp = $maxhp; + } + $hpf= floor (100 * ($hp / $zhp)) - 1; + $maxmp= ($exp * $level) / 5; + $mp= $RPG / 3; + if ($mp >= $maxmp) { $mp = $maxmp; } + $maxmp = floor ($maxmp); + $mp = floor ($mp); + if ($maxmp <= 0) { + $zmp = 1; + } else { + $zmp = $maxmp; + } + $mpf= floor (100 * ($mp / $zmp)) - 1; + if ( $hpf >= 98 ) { $hpf = $hpf - 2; } + if ( $ep >= 98 ) { $ep = $ep - 2; } + if ( $mpf >= 98 ) { $mpf = $mpf - 2; } + + $level = array(); + $level['level'] = $showlevel ; + $level['exp'] = $ep; + $level['exp_width'] = $ep.'%'; + $level['hp'] = $hp; + $level['hp_max'] = $maxhp; + $level['hp_width'] = $hpf.'%'; + $level['mp'] = $mp; + $level['mp_max'] = $maxmp; + $level['mp_width'] = $mpf.'%'; + + return $level; +} + +class newbbUser { + var $user = null; + + function User() + { + } + + function getUserbar() + { + global $xoopsModuleConfig, $xoopsUser, $isadmin; + + $userbar = array(); + if (empty($xoopsModuleConfig['userbar_enabled'])) return $userbar; + + $user = $this->user; + $userbar["profile"] = array("link" => XOOPS_URL . "/userinfo.php?uid=" . $user->getVar("uid"), "name" => _PROFILE); + + if (is_object($xoopsUser)) { + $userbar["pm"] = array("link" => "javascript:void openWithSelfMain('" . XOOPS_URL . "/pmlite.php?send2=1&to_userid=" . $user->getVar("uid") . "', 'pmlite', 450, 380);", "name" => _MD_PM); + } + if ($user->getVar('user_viewemail') || $isadmin) { + $userbar["email"] = array("link" => "javascript:void window.open('mailto:" . $user->getVar('email') . "', 'new');", "name" => _MD_EMAIL); + } + if ($url = $user->getVar('url')) { + $userbar["url"] = array("link" => "javascript:void window.open('" . $url . "', 'new');", "name" => _MD_WWW); + } + if ($icq = $user->getVar('user_icq')) { + $userbar["icq"] = array("link" => "javascript:void window.open('http://wwp.icq.com/scripts/search.dll?to=" . $icq."', 'new');", "name" => _MD_ICQ); + } + if ($aim = $user->getVar('user_aim')) { + $userbar["aim"]= array("link" => "javascript:void window.open('aim:goim?screenname=" . $aim . "&message=Hi+" . $aim . "+Are+you+there?" . "', 'new');", "name" => _MD_AIM); + } + if ($yim = $user->getVar('user_yim')) { + $userbar["yim"] = array("link" => "javascript:void window.open('http://edit.yahoo.com/config/send_webmesg?.target=" . $yim . "&.src=pg" . "', 'new');", "name" => _MD_YIM); + } + if ($msn = $user->getVar('user_msnm')) { + $userbar["msnm"] = array("link" => "javascript:void window.open('http://members.msn.com?mem=" . $msn . "', 'new');", "name" => _MD_MSNM); + } + + return $userbar; + } + + function getLevel() + { + global $xoopsModuleConfig, $forumUrl; + + $level = newbb_calculateLevel($this->user->getVar("posts"), $this->user->getVar("user_regdate")); + $info=''; + if ($xoopsModuleConfig['user_level'] == 2) { + static $rpg_images; + if (!isset($rpg_images)) { + $icon_handler = newbb_getIconHandler(); + $rpg_path = $icon_handler->getPath("rpg"); + foreach (array("img_left", "img_backing", "img_right", "blue", "green", "orange") as $img) { + $rpg_images[$img] = XOOPS_URL . '/' . $rpg_path . '/'.$img.'.gif'; + } + } + $table = "<table class='userlevel'><tr><td class='end'><img src='" . $rpg_images['img_left'] . "' alt='' /></td><td class='center' background='" . $rpg_images['img_backing'] . "'><img src='%s' width='%d' alt='' align='left' /></td><td><img src='" . $rpg_images['img_right'] . "' alt='' /></td></tr></table>"; + + $info = _MD_LEVEL . " " . $level['level'] . "<br />" . _MD_HP . " " . $level['hp'] . " / " . $level['hp_max'] . "<br />". + sprintf($table, $rpg_images["orange"], $level['hp_width']); + $info .= _MD_MP . " " . $level['mp'] . " / " . $level['mp_max'] . "<br />". + sprintf($table, $rpg_images["green"], $level['mp_width']); + $info .= _MD_EXP . " " . $level['exp'] . "<br />". + sprintf($table, $rpg_images["blue"], $level['exp_width']); + } else { + $info = _MD_LEVEL . " " . $level['level'] . "; ". _MD_EXP . " " . $level['exp'] . "<br />"; + $info .= _MD_HP . " " . $level['hp'] . " / " . $level['hp_max'] . "<br />"; + $info .= _MD_MP . " " . $level['mp'] . " / " . $level['mp_max']; + } + return $info; + } + + function getInfo(&$user) + { + global $xoopsModuleConfig, $myts; + static $name_anonymous; + + if ( !(is_object($user)) || !($user->isActive()) ) { + if (!isset($name_anonymous)) { + $name_anonymous = $myts->HtmlSpecialChars($GLOBALS["xoopsConfig"]['anonymous']); + } + return array("name" => $name_anonymous, "link" => $name_anonymous); + } + + $this->user = $user; + + $userinfo["uid"] = $user->getVar("uid"); + + $name = empty($xoopsModuleConfig['show_realname']) ? $user->getVar('uname') : $user->getVar('name'); + $userinfo["name"] = $name ? $name : $user->getVar('uname'); + + $userinfo["link"] = "<a href=\"".XOOPS_URL . "/userinfo.php?uid=" . $user->getVar("uid") ."\">".$userinfo["name"]."</a>"; + + $userinfo["avatar"] = $user->getVar('user_avatar'); +// START hacked by irmtfan - easier rank getting + $userrank = $user->rank(); + if (isset($userrank['image']) && $userrank['image']) { + $userinfo["rank_image"] = $userrank['image']; + $userinfo["rank_title"] = $userrank['title']; + } +// END hacked by irmtfan - easier rank getting + + $userinfo["from"] = $user->getVar('user_from'); + + mod_loadFunctions("time", "newbb"); + $userinfo["regdate"] = newbb_formatTimestamp($user->getVar('user_regdate'), 'reg'); + + $userinfo["posts"] = $user->getVar('posts'); + + if (!empty($xoopsModuleConfig['user_level'])) { + $userinfo["level"] = $this->getLevel(); + } + + if (!empty($xoopsModuleConfig['userbar_enabled'])) { + $userinfo["userbar"] = $this->getUserbar(); + } + + $userinfo["signature"] = $user->getVar('user_sig'); + return $userinfo; + } +} + +class NewbbUserHandler +{ + var $enableGroup; + var $enableOnline; + var $userlist = array(); + var $users = array(); + //var $online = array(); + + function NewbbUserHandler($enableGroup = true, $enableOnline = true) + { + $this->enableGroup = $enableGroup; + $this->enableOnline = $enableOnline; + } + + function loadUserInfo() + { + @include_once XOOPS_ROOT_PATH."/modules/".$GLOBALS["xoopsModule"]->getVar("dirname", "n")."/language/".$GLOBALS["xoopsConfig"]["language"]."/user.php"; + if (class_exists("User_language")) { + $handler = new User_language(); + } else { + $handler = new newbbUser(); + } + foreach (array_keys($this->users) as $uid) { + $this->userlist[$uid] = $handler->getInfo($this->users[$uid]); + } + } + + function loadUserOnline() + { + if (empty($this->users) || !$this->enableOnline) return; + mod_loadFunctions("render", "newbb"); + $image_online = newbb_displayImage('online', _MD_ONLINE); + $image_offline = newbb_displayImage('offline',_MD_OFFLINE); + + $online_handler =& xoops_getmodulehandler('online', 'newbb'); + $onlines = $online_handler->checkStatus(array_keys($this->users)); + + foreach (array_keys($this->users) as $uid) { + $this->userlist[$uid]["status"] = empty($onlines[$uid]) ? $image_offline : $image_online; + } + } + + function loadUserGroups() + { + GLOBAL $xoopsDB; + + if (empty($this->users) || !$this->enableGroup) return; + + $groups = array(); + $member_handler =& xoops_gethandler('member'); + $groups_obj = $member_handler->getGroups(); + $count = count($groups_obj); + for ($i = 0; $i < $count; $i++) { + $groups[$groups_obj[$i]->getVar('groupid')] = $groups_obj[$i]->getVar('name'); + } + unset($groups_obj); + + $sql = 'SELECT groupid, uid FROM ' . $xoopsDB->prefix('groups_users_link') . " WHERE uid IN( " . implode(", ", array_keys($this->users)) . ")"; + $result = $xoopsDB->query($sql); + while ($myrow = $xoopsDB->fetchArray($result)) { + $this->userlist[$myrow['uid']]["groups"][] = $groups[$myrow['groupid']]; + } + } + + function loadUserDigest() + { + GLOBAL $xoopsDB; + + if (empty($this->users)) return; + + $sql = 'SELECT user_digests, uid FROM ' . $xoopsDB->prefix('bb_user_stats') . " WHERE uid IN( " . implode(", ", array_keys($this->users)) . ")"; + $result = $xoopsDB->query($sql); + while ($myrow = $xoopsDB->fetchArray($result)) { + $this->userlist[$myrow['uid']]["digests"] = intval( $myrow['user_digests'] ); + } + } +// START irmtfan remove function +// function loadUserRank() +// { +// return true; +// } +// END irmtfan remove function + + function getUsers() + { + $this->loadUserInfo(); + $this->loadUserOnline(); + $this->loadUserGroups(); + // irmtfan removed $this->loadUserRank(); + $this->loadUserDigest(); + + return $this->userlist; + } +} + ?> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/docs/changelog.txt =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/docs/changelog.txt 2012-08-01 22:31:12 UTC (rev 9975) +++ XoopsModules/newbb/branches/irmtfan/newbb/docs/changelog.txt 2012-08-02 05:24:36 UTC (rev 9976) @@ -20,6 +20,25 @@ 16 Fix Link to Blank.gif 17 Fix Error Upload File too large +18- bug fix: edit not displayed when the reason is not filled (irmtfan) +19- bug fix: only the last edit is recorded. (irmtfan/alfred) +in newbb/class/post.php + +20- bug fix: 'noapprove' permission incorrectly recorded in database. (irmtfan) +in newbb/class/permission.php + +21- bug fix: load user ranks has been hardcoded. it works in old/upgraded websites but not works in new installed websites. a new getting rank introduced. (black_beard/irmtfan) +in newbb/class/user.php, newbb/templates/newbb_thread.html + +22- minor bug fix: mysql 5.1 was incorrectly needed (irmtfan) +in newbb/xoops_version.php + +23- hardcode: some style.css color hardcodes has been removed. (irmtfan) +in newbb/templates/style.css + +24- feature added: text links instead of buttons. (deka87/irmtfan) +in newbb/class/icon.php , newbb/include/functions.render.php , newbb/include/plugin.php + newBB Changelog 4.2 02/08/2012 Modified: XoopsModules/newbb/branches/irmtfan/newbb/header.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/header.php 2012-08-01 22:31:12 UTC (rev 9975) +++ XoopsModules/newbb/branches/irmtfan/newbb/header.php 2012-08-02 05:24:36 UTC (rev 9976) @@ -1,140 +1,116 @@ -<?php -/** - * CBB 4.0, or newbb, the forum module for XOOPS project - * - * @copyright The XOOPS Project http://xoops.sf.net - * @license http://www.fsf.org/copyleft/gpl.html GNU public license - * @author Taiwen Jiang (phppp or D.J.) <ph...@us...> - * @since 4.00 - * @version $Id$ - * @package module::newbb - */ -include_once '../../mainfile.php'; -defined('XOOPS_ROOT_PATH') or die('Restricted access'); -$xoopsLogger->startTime('newBB_Header'); - -if (!empty($xoopsModuleConfig['do_rewrite'])) { - include_once "seo_url.php"; - /* for seo */ - $toseo_url = array("index.php","viewforum.php","viewtopic.php","rss.php"); - - if(((strpos(getenv('REQUEST_URI'), '.html') === false) && !empty($xoopsModuleConfig['do_rewrite']) && (!isset($_POST) || count($_POST) <= 0))) - { - $redir = false; - if ( strpos(getenv("REQUEST_URI"),"mark_read=") == true || strpos(getenv("REQUEST_URI"),"mark=") == true) { - // Mark Forums - } else { - if ( in_array(basename(getenv('SCRIPT_NAME')),$toseo_url) ) { - //rewrite only for files - - if ( trim(getenv("SCRIPT_NAME")) != '' ) { - if ( strpos(getenv("REQUEST_URI") , "/".SEO_MODULE_NAME."/") === false ) { - $redir = true; - } else if ( getenv("QUERY_STRING") ) { - $redir = true; - } - } - } - } - - if ($redir == true) { - $s = "http://" . getenv('HTTP_HOST') . getenv("REQUEST_URI"); - $s = str_replace("/".REAL_MODULE_NAME."/","/".SEO_MODULE_NAME."/",$s); - $newurl = seo_urls('<a href="'.$s.'"></a>'); - $newurl = str_replace('<a href="','',$newurl); - $newurl = str_replace('"></a>','',$newurl); - if ( !headers_sent() ) { - header("HTTP/1.1 301 Moved Permanently"); - header("Location: $newurl"); - exit(); - } - } - } -} - -include_once XOOPS_ROOT_PATH."/modules/".$xoopsModule->getVar("dirname")."/include/vars.php"; - -mod_loadFunctions("user", "newbb"); -mod_loadFunctions("topic", "newbb"); - -require_once XOOPS_ROOT_PATH."/class/xoopsformloader.php"; -require_once XOOPS_ROOT_PATH."/class/module.textsanitizer.php"; -$myts = MyTextSanitizer::getInstance(); - -$menumode = 0; -$menumode_other = array(); -$menu_url = htmlSpecialChars(preg_replace("/&menumode=[^&]/", "", $_SERVER[ 'REQUEST_URI' ])); -$menu_url .= ( false === strpos($menu_url, "?") ) ? "?menumode=" : "&menumode="; -foreach ($xoopsModuleConfig["valid_menumodes"] as $key => $val) { - if ($key != $menumode) $menumode_other[] = array("title"=>$val, "link"=>$menu_url.$key); -} - - -$newbb_module_header = ''; -$newbb_module_header .= '<link rel="alternate" type="application/rss+xml" title="'.$xoopsModule->getVar("name").'" href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', "n").'/rss.php" />'; -if (!empty($xoopsModuleConfig['pngforie_enabled'])) { - $newbb_module_header .= '<style type="text/css">img {behavior:url("include/pngbehavior.htc");}</style>'; -} -// START hacked by irmtfan to add localization/customization for newbb style.css -$dirname=$xoopsModule->getVar('dirname'); -$theme_path = "{$xoopsConfig['theme_set']}/modules/{$dirname}"; -$theme_default_path= "default/modules/{$dirname}"; -$default_path = "modules/{$dirname}/templates"; -$lang_path = "images/language/{$xoopsConfig['language']}"; - - // get from setted theme -if (is_file(XOOPS_THEME_PATH . '/'.$theme_path . '/' . $lang_path . '/style.css')) { - $rel_path=$theme_path . '/' . $lang_path; - // get from default theme -} else if (is_file(XOOPS_THEME_PATH . '/'.$theme_default_path . '/' . $lang_path . '/style.css')) { - $rel_path=$theme_default_path . '/' . $lang_path; - // get from module default path -} else if (is_file(XOOPS_ROOT_PATH. '/'.$default_path . '/' . $lang_path . '/style.css')) { - $rel_path=$default_path . '/' . $lang_path; - // if no one is found get the english from default path -} else if (is_file(XOOPS_ROOT_PATH. '/'.$default_path . '/images/language/english/style.css')) { - $rel_path=$default_path . '/images/language/english'; - // for backward compatibility - as before -} else { - $rel_path=$default_path; -} - -$newbb_module_header .= ' - <link rel="stylesheet" type="text/css" href="'.XOOPS_URL . '/' . $rel_path . '/style.css" /> - <script type="text/javascript">var toggle_cookie="'.$forumCookie['prefix'].'G'.'";</script> - <script src="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar("dirname").'/include/js/newbb_toggle.js" type="text/javascript"></script> - '; -// END hacked by irmtfan to add localization/customization for newbb style.css -if ($menumode == 2) { - $newbb_module_header .= ' - <link rel="stylesheet" type="text/css" href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar("dirname").'templates/newbb_menu_hover.css" /> - <style type="text/css">body {behavior:url("include/newbb.htc");}</style> - '; -} - -if ($menumode == 1) { - $newbb_module_header .= ' - <link rel="stylesheet" type="text/css" href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar("dirname").'templates/newbb_menu_click.css" /> - <script src="include/js/newbb_menu_click.js" type="text/javascript"></script> - '; -} - -$xoops_module_header = $newbb_module_header; // for cache hack - -if (!empty($xoopsModuleConfig["welcome_forum"]) && is_object($xoopsUser) && !$xoopsUser->getVar('posts')) { - mod_loadFunctions("welcome", "newbb"); -} - -$pollmodules = NULL; -//$module_handler = &xoops_gethandler('module'); -$xoopspoll = &$module_handler->getByDirname('xoopspoll'); -if (is_object($xoopspoll) && $xoopspoll->getVar('isactive')) { - $pollmodules = 'xoopspoll'; -} else { - //Umfrage - $xoopspoll = &$module_handler->getByDirname('umfrage'); - if (is_object($xoopspoll) && $xoopspoll->getVar('isactive')) - $pollmodules = 'umfrage'; -} -$xoopsLogger->stopTime('newBB_Header'); +<?php +/** + * CBB 4.0, or newbb, the forum module for XOOPS project + * + * @copyright The XOOPS Project http://xoops.sf.net + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @author Taiwen Jiang (phppp or D.J.) <ph...@us...> + * @since 4.00 + * @version $Id$ + * @package module::newbb + */ +include_once '../../mainfile.php'; +defined('XOOPS_ROOT_PATH') or die('Restricted access'); +$xoopsLogger->startTime('newBB_Header'); + +if (!empty($xoopsModuleConfig['do_rewrite'])) { + include_once "seo_url.php"; + /* for seo */ + $toseo_url = array("index.php","viewforum.php","viewtopic.php","rss.php"); + + if(((strpos(getenv('REQUEST_URI'), '.html') === false) && !empty($xoopsModuleConfig['do_rewrite']) && (!isset($_POST) || count($_POST) <= 0))) + { + $redir = false; + if ( strpos(getenv("REQUEST_URI"),"mark_read=") == true || strpos(getenv("REQUEST_URI"),"mark=") == true) { + // Mark Forums + } else { + if ( in_array(basename(getenv('SCRIPT_NAME')),$toseo_url) ) { + //rewrite only for files + + if ( trim(getenv("SCRIPT_NAME")) != '' ) { + if ( strpos(getenv("REQUEST_URI") , "/".SEO_MODULE_NAME."/") === false ) { + $redir = true; + } else if ( getenv("QUERY_STRING") ) { + $redir = true; + } + } + } + } + + if ($redir == true) { + $s = "http://" . getenv('HTTP_HOST') . getenv("REQUEST_URI"); + $s = str_replace("/".REAL_MODULE_NAME."/","/".SEO_MODULE_NAME."/",$s); + $newurl = seo_urls('<a href="'.$s.'"></a>'); + $newurl = str_replace('<a href="','',$newurl); + $newurl = str_replace('"></a>','',$newurl); + if ( !headers_sent() ) { + header("HTTP/1.1 301 Moved Permanently"); + header("Location: $newurl"); + exit(); + } + } + } +} + +include_once XOOPS_ROOT_PATH."/modules/".$xoopsModule->getVar("dirname")."/include/vars.php"; + +mod_loadFunctions("user", "newbb"); +mod_loadFunctions("topic", "newbb"); + +require_once XOOPS_ROOT_PATH."/class/xoopsformloader.php"; +require_once XOOPS_ROOT_PATH."/class/module.textsanitizer.php"; +$myts = MyTextSanitizer::getInstance(); + +$menumode = 0; +$menumode_other = array(); +$menu_url = htmlSpecialChars(preg_replace("/&menumode=[^&]/", "", $_SERVER[ 'REQUEST_URI' ])); +$menu_url .= ( false === strpos($menu_url, "?") ) ? "?menumode=" : "&menumode="; +foreach ($xoopsModuleConfig["valid_menumodes"] as $key => $val) { + if ($key != $menumode) $menumode_other[] = array("title"=>$val, "link"=>$menu_url.$key); +} + + +$newbb_module_header = ''; +$newbb_module_header .= '<link rel="alternate" type="application/rss+xml" title="'.$xoopsModule->getVar("name").'" href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', "n").'/rss.php" />'; +if (!empty($xoopsModuleConfig['pngforie_enabled'])) { + $newbb_module_header .= '<style type="text/css">img {behavior:url("include/pngbehavior.htc");}</style>'; +} +$newbb_module_header .= ' + <link rel="stylesheet" type="text/css" href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar("dirname").'/templates/style.css" /> + <script type="text/javascript">var toggle_cookie="'.$forumCookie['prefix'].'G'.'";</script> + <script src="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar("dirname").'/include/js/newbb_toggle.js" type="text/javascript"></script> + '; + +if ($menumode == 2) { + $newbb_module_header .= ' + <link rel="stylesheet" type="text/css" href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar("dirname").'templates/newbb_menu_hover.css" /> + <style type="text/css">body {behavior:url("include/newbb.htc");}</style> + '; +} + +if ($menumode == 1) { + $newbb_module_header .= ' + <link rel="stylesheet" type="text/css" href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar("dirname").'templates/newbb_menu_click.css" /> + <script src="include/js/newbb_menu_click.js" type="text/javascript"></script> + '; +} + +$xoops_module_header = $newbb_module_header; // for cache hack + +if (!empty($xoopsModuleConfig["welcome_forum"]) && is_object($xoopsUser) && !$xoopsUser->getVar('posts')) { + mod_loadFunctions("welcome", "newbb"); +} + +$pollmodules = NULL; +//$module_handler = &xoops_gethandler('module'); +$xoopspoll = &$module_handler->getByDirname('xoopspoll'); +if (is_object($xoopspoll) && $xoopspoll->getVar('isactive')) { + $pollmodules = 'xoopspoll'; +} else { + //Umfrage + $xoopspoll = &$module_handler->getByDirname('umfrage'); + if (is_object($xoopspoll) && $xoopspoll->getVar('isactive')) + $pollmodules = 'umfrage'; +} +$xoopsLogger->stopTime('newBB_Header'); ?> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/include/plugin.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/include/plugin.php 2012-08-01 22:31:12 UTC (rev 9975) +++ XoopsModules/newbb/branches/irmtfan/newbb/include/plugin.php 2012-08-02 05:24:36 UTC (rev 9976) @@ -1,87 +1,87 @@ -<?php -/** - * CBB 4.0, or newbb, the forum module for XOOPS project - * - * @copyright The XOOPS Project http://xoops.sf.net - * @license http://www.fsf.org/copyleft/gpl.html GNU public license - * @author Taiwen Jiang (phppp or D.J.) <ph...@us...> - * @since 4.00 - * @version $Id $ - * @package module::newbb - */ - -if (!defined('XOOPS_ROOT_PATH')) { - exit(); -} -/* some static xoopsModuleConfig */ -$customConfig = array(); - -// specification for custom time format -// default manner will be used if not specified -$customConfig["formatTimestamp_custom"] = ""; // Could be set as "Y-m-d H:i" - -// requiring "name" field for anonymous users in edit form -$customConfig["require_name"] = true; - -// display "register or login to post" for anonymous users -$customConfig["show_reg"] = true; - -// perform forum/topic synchronization on module update -$customConfig["syncOnUpdate"] = true; - -// time for pending/deleted topics/posts, expired one will be removed automatically, in days; 0 or no cleanup -$customConfig["pending_expire"] = 0; - -// redirect to its URI of an attachment when requested -// Set to true if your attachment would be corrupted after download with normal way -$customConfig["download_direct"] = false; - -// Set allowed editors -// Should set from module preferences? -$customConfig["editor_allowed"] = array(); - -// Set the default editor -$customConfig["editor_default"] = "dhtmltextarea"; - -// Set the default editor for quick reply -$customConfig["editor_quick_default"] = "textarea"; - -// default value for editor rows, coloumns -$customConfig["editor_rows"] = 15; -$customConfig["editor_cols"] = 40; - -// default value for editor width, height (string) -$customConfig["editor_width"] = "100%"; -$customConfig["editor_height"] = "400px"; - -// storage method for reading records: 0 - none; 1 - cookie; 2 - db -$customConfig["read_mode"] = 2; - -// expire time for reading records, in days -$customConfig["read_expire"] = 30; - -// maximum records per forum for one user -$customConfig["read_items"] = 100; - -// Enable tag system -$customConfig["do_tag"] = 1; - -// Count posts counts of subfourms -$customConfig["count_subforum"] = 1; - -// Length for post title on index page: 0 for not showing post title, 255 for not truncate -$customConfig["length_title_index"] = 40; - -// MENU handler -/* You could remove anyone by commenting out in order to disable it */ -$customConfig["valid_menumodes"] = array( - 0 => _MD_MENU_SELECT, // for selectbox - //1 => _MD_MENU_CLICK, // for "click to expand" - //2 => _MD_MENU_HOVER // for "mouse hover to expand" - ); -// START hacked by irmtfan -// Display text links instead of image buttons for edit, reply, .... set true or false -$customConfig["display_text_links"] = false; -// END hacked by irmtfan -return $customConfig; +<?php +/** + * CBB 4.0, or newbb, the forum module for XOOPS project + * + * @copyright The XOOPS Project http://xoops.sf.net + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @author Taiwen Jiang (phppp or D.J.) <ph...@us...> + * @since 4.00 + * @version $Id $ + * @package module::newbb + */ + +if (!defined('XOOPS_ROOT_PATH')) { + exit(); +} +/* some static xoopsModuleConfig */ +$customConfig = array(); + +// specification for custom time format +// default manner will be used if not specified +$customConfig["formatTimestamp_custom"] = ""; // Could be set as "Y-m-d H:i" + +// requiring "name" field for anonymous users in edit form +$customConfig["require_name"] = true; + +// display "register or login to post" for anonymous users +$customConfig["show_reg"] = true; + +// perform forum/topic synchronization on module update +$customConfig["syncOnUpdate"] = true; + +// time for pending/deleted topics/posts, expired one will be removed automatically, in days; 0 or no cleanup +$customConfig["pending_expire"] = 0; + +// redirect to its URI of an attachment when requested +// Set to true if your attachment would be corrupted after download with normal way +$customConfig["download_direct"] = false; + +// Set allowed editors +// Should set from module preferences? +$customConfig["editor_allowed"] = array(); + +// Set the default editor +$customConfig["editor_default"] = "dhtmltextarea"; + +// Set the default editor for quick reply +$customConfig["editor_quick_default"] = "textarea"; + +// default value for editor rows, coloumns +$customConfig["editor_rows"] = 15; +$customConfig["editor_cols"] = 40; + +// default value for editor width, height (string) +$customConfig["editor_width"] = "100%"; +$customConfig["editor_height"] = "400px"; + +// storage method for reading records: 0 - none; 1 - cookie; 2 - db +$customConfig["read_mode"] = 2; + +// expire time for reading records, in days +$customConfig["read_expire"] = 30; + +// maximum records per forum for one user +$customConfig["read_items"] = 100; + +// Enable tag system +$customConfig["do_tag"] = 1; + +// Count posts counts of subfourms +$customConfig["count_subforum"] = 1; + +// Length for post title on index page: 0 for not showing post title, 255 for not truncate +$customConfig["length_title_index"] = 40; + +// MENU handler +/* You could remove anyone by commenting out in order to disable it */ +$customConfig["valid_menumodes"] = array( + 0 => _MD_MENU_SELECT, // for selectbox + //1 => _MD_MENU_CLICK, // for "click to expand" + //2 => _MD_MENU_HOVER // for "mouse hover to expand" + ); +// START hacked by irmtfan +// Display text links instead of image buttons for edit, reply, .... set true or false +$customConfig["display_text_links"] = false; +// END hacked by irmtfan +return $customConfig; ?> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/language/persian/admin.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/language/persian/admin.php 2012-08-01 22:31:12 UTC (rev 9975) +++ XoopsModules/newbb/branches/irmtfan/newbb/language/persian/admin.php 2012-08-02 05:24:36 UTC (rev 9976) @@ -277,7 +277,7 @@ define("_AM_NEWBB_TYPE_LIST", "فهرست نوع ها"); define("_AM_NEWBB_TODEL_TYPE", "آیا مطمان هستید که میخواهید نوع [%s] را حذف کنید؟"); define("_AM_NEWBB_TYPE_EDITFORUM_DESC", "اطلاعات هنوز ذخیره نشده اند. باید روی دکمه ارسال بزنید تا ذخیره شوند."); -define("_AM_NEWBB_TYPE_ORDER_DESC", "برای فعال کردن یک نوع برای یک انجمن، یک عدد بالاتر از 0 را برای نوع تاپیک 'type_order' انتخاب کنید. به عبارت دیگر اگر نوع تاپیک 'type_order' را 0 انتخاب کنید، آن نوع برای آن انجمن غیر فعال خواهد شد"); +define("_AM_NEWBB_TYPE_ORDER_DESC", "برای فعال کردن یک نوع برای یک انجمن، یک عدد بالاتر از 0 را برای ترتیب نوع 'type_order' انتخاب کنید. به عبارت دیگر اگر ترتیب نوع 'type_order' را 0 انتخاب کنید، آن نوع برای آن انجمن غیر فعال خواهد شد"); // admin_synchronization.php define("_AM_NEWBB_SYNC_TYPE_FORUM", "داده های انجمن"); Modified: XoopsModules/newbb/branches/irmtfan/newbb/language/persian/main.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/language/persian/main.php 2012-08-01 22:31:12 UTC (rev 9975) +++ XoopsModules/newbb/branches/irmtfan/newbb/language/persian/main.php 2012-08-02 05:24:36 UTC (rev 9976) @@ -10,7 +10,7 @@ define('_MD_MAX_FILESIZE','حداکثر اندازه فایل'); define('_MD_ATTACHMENT','پیوست'); define('_MD_FILESIZE','اندازه'); -define('_MD_HITS','دفعات دیدن'); +define('_MD_HITS','تعداد دانلود'); define('_MD_GROUPS','گروهها:'); define('_MD_DEL_ONE','فقط این پیام را پاک کن'); define('_MD_DEL_RELATED','این پیام و تمامی پیامهای مربوط به آن را پاک کن'); @@ -431,8 +431,8 @@ define("_MD_NEWBB_SEENOTGUEST","<font color=\"red\"><b>فقط برای کاربران عضو سایت</b></font>"); define("_MD_NEWBB_REPORTSUBJECT","A contribution has been reported"); define("_MD_NEWBB_GOTOLASTPOST","رفتن به آخرین پست ارسال شده"); -define("_MD_EDITEDMSG","دلیل ویرایش پست (اختیاری):"); -define("_MD_DELEDEDMSG","دلیل ویرایش پست<br /><small>(اگر دلیلی نوشته شده فرد ارسال کننده پست با خبر خواهد شد)</small>:"); +define("_MD_EDITEDMSG","دلیل ویرایش:"); +define("_MD_DELEDEDMSG","دلیل حذف پست<br /><small>(اگر دلیلی نوشته شده فرد ارسال کننده پست با خبر خواهد شد)</small>:"); define("_MD_DELEDEDMSG_SUBJECT","پست شما حذف شد"); define("_MD_DELEDEDMSG_BODY","سلام %s, پست شما در انجمن زیر Modified: XoopsModules/newbb/branches/irmtfan/newbb/language/persian/modinfo.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/language/persian/modinfo.php 2012-08-01 22:31:12 UTC (rev 9975) +++ XoopsModules/newbb/branches/irmtfan/newbb/language/persian/modinfo.php 2012-08-02 05:24:36 UTC (rev 9976) @@ -33,7 +33,7 @@ define("_MI_NEWBB_ADMENU_REPORT","گزارش ها"); define("_MI_NEWBB_ADMENU_DIGEST","خلاصه"); define("_MI_NEWBB_ADMENU_VOTE","نظر سنجی ها"); -define("_MI_NEWBB_ADMENU_TYPE", "نوع تاپیک ها"); +define("_MI_NEWBB_ADMENU_TYPE", "نوع های تاپیک"); define("_MI_NEWBB_ADMENU_ABOUT", "درباره این ماژول"); //config options @@ -140,7 +140,7 @@ define("_MI_POST_TIMELIMIT", "ایجاد محدودیت زمانی برای زدن پست های پشت سر هم"); define("_MI_POST_TIMELIMIT_DESC", "قرار دادن محدودیت زمانی برای زدن پیام پشت سر هم. به ثانیه، 0 به معنی بدون محدودیت است"); define("_MI_RECORDEDIT_TIMELIMIT", "محدودیت زمانی برای ذخیره شدن اطلاعات مربوط به ویرایش شدن پیام"); -define("_MI_RECORDEDIT_TIMELIMIT_DESC", "قرار دادن محدودیت زمانی برای ذخیره شدن اطلاعات ویرایش پیام ها به دقیقه. 0 به معنی این است که عبارت ویرایش شد در زیر پیام ها اضافه نشود"); +define("_MI_RECORDEDIT_TIMELIMIT_DESC", "قرار دادن یک زمان به دقیقه که از آن زمان به بعد پس از ارسال پست ویرایش های آن پست ذخیره میشوند. قرار دادن 0 به این معنی است که هیچ ویرایشی ثبت نشود."); //define("_MI_SUBJECT_PREFIX_LEVEL", "سطح دسترسی برای گروه هایی که میتوانند پیشوند (Prefix) اضافه کنند"); //define("_MI_SUBJECT_PREFIX_LEVEL_DESC", "گروه های مجاز را انتخاب کنید"); //define("_MI_SPL_DISABLE", 'غیر فعال'); @@ -229,7 +229,7 @@ میتوانید ثبت نام کرده و سپس مبادرت به ارسال پیام کنید.<br /><br /> اگر هر سوالی راجع به استفاده از newbb دارید, لطفا سایت پشتیبانی را بازدید کنید <a href=\"http://www.xoops.ir/modules/newbb/\" target=\"_blank\" title=\"newbb @ persian xoops\">ماژول انجمن ها</a>. "); -define("_MI_NEWBB_ADMENU_GROUPMOD", "نظارت بر گروه ها"); +define("_MI_NEWBB_ADMENU_GROUPMOD", "انتخاب گروهی ناظران"); define("_MI_SUBJECT_PREFIX", "اضافه کردن پیشوند به ابتدای عنوان"); define("_MI_SUBJECT_PREFIX_DESC", "قرار دادن یک پیشوند مثلا [حل شده] در ابتدای نام یک عنوان.برای جدا کردن گزینه ها از ',' استفاده کنید، اگر میخواهید هیچ پیشوندی نداشته باشید فقط NONE را باقی بگذارید."); define("_MI_SUBJECT_PREFIX_DEFAULT", '<font color="#00CC00">[حل شده]</font>,<font color="#00CC00">[قطعی شده]</font>,<font color="#FF0000">[درخواست شده]</font>,<font color="#FF0000">[گزارش خطا]</font>,<font color="#FF0000">[حل نشده]</font>'); @@ -250,7 +250,7 @@ define('_MI_NEWBB_INFOBOX_HIDDEN', 'بله به صورت فشرده'); define('_MI_NEWBB_INFOBOX_SHOW', 'بله به صورت کامل'); define('_MI_SHOW_SOCIALLINKS', "نمایش لینک های شبکه های اجتماعی"); -define('_MI_SHOW_SOCIALLINKS_DESC', "دکمه های شبکه های اجتماعی از چمله فیس بوک و تویتر را نمایش میدهد"); +define('_MI_SHOW_SOCIALLINKS_DESC', "دکمه های شبکه های اجتماعی از جمله فیس بوک و تویتر را نمایش میدهد"); //4.2 define("_MI_PAGENAV_DISPLAY","نمایش مرورگر"); Modified: XoopsModules/newbb/branches/irmtfan/newbb/polls.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/polls.php 2012-08-01 22:31:12 UTC (rev 9975) +++ XoopsModules/newbb/branches/irmtfan/newbb/polls.php 2012-08-02 05:24:36 UTC (rev 9976) @@ -1,580 +1,570 @@ -<?php -/** - * Newbb module - * - * You may not change or alter any portion of this comment or credits - * of supporting developers from this source code or any supporting source code - * which is considered copyrighted (c) material of the original comment or credit authors. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ - * @license http://www.fsf.org/copyleft/gpl.html GNU public license - * @package newbb - * @since 4.0 - * @author Taiwen Jiang <ph...@us...> - * @version $Id: polls.php 2175 2008-09-23 14:07:03Z phppp $ - */ - - -include_once dirname(__FILE__) . "/header.php"; - -include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php"; -include_once XOOPS_ROOT_PATH . "/class/xoopslists.php"; -include_once XOOPS_ROOT_PATH . "/class/xoopsblock.php"; - -if ( $pollmodules == 'xoopspoll') -{ - include XOOPS_ROOT_PATH . "/modules/xoopspoll/include/constants.php"; - include_once XOOPS_ROOT_PATH . "/modules/xoopspoll/class/xoopspoll.php"; - include_once XOOPS_ROOT_PATH . "/modules/xoopspoll/class/xoopspolloption.php"; - include_once XOOPS_ROOT_PATH . "/modules/xoopspoll/class/xoopspolllog.php"; - include_once XOOPS_ROOT_PATH . "/modules/xoopspoll/class/xoopspollrenderer.php"; -} -elseif ($pollmodules == 'umfrage') -{ - include XOOPS_ROOT_PATH."/modules/umfrage/include/constants.php"; - include_once XOOPS_ROOT_PATH."/modules/umfrage/class/umfrage.php"; - include_once XOOPS_ROOT_PATH."/modules/umfrage/class/umfrageoption.php"; - include_once XOOPS_ROOT_PATH."/modules/umfrage/class/umfragelog.php"; - include_once XOOPS_ROOT_PATH."/modules/umfrage/class/umfragerenderer.php"; -} -else -{ - redirect_header("javascript:history.go(-1);", 2, _MD_POLLMODULE_ERROR); - exit(); -} - -$op = "add"; -if (isset($_GET['op'])) $op = $_GET['op']; -if (isset($_POST['op'])) $op = $_POST['op']; -if (isset($_GET['poll_id'])) $poll_id = intval($_GET['poll_id']); -if (isset($_POST['poll_id'])) $poll_id = intval($_POST['poll_id']); -if (isset($_GET['topic_id'])) $topic_id = intval($_GET['topic_id']); -if (isset($_POST['topic_id'])) $topic_id = intval($_POST['topic_id']); - -if (!isset($module_handler)) $module_handler =& xoops_gethandler('module'); -$xoopspoll =& $module_handler->getByDirname($pollmodules); -if (!is_object($xoopspoll) || !$xoopspoll->getVar('isactive')) { - redirect_header("javascript:history.go(-1);", 2, _MD_POLLMODULE_ERROR); - exit(); -} - -include XOOPS_ROOT_PATH . "/header.php"; - -$topic_handler =& xoops_getmodulehandler('topic', 'newbb'); -$topic_obj =& $topic_handler->get($topic_id); -$forum = $topic_obj->getVar('forum_id'); -$forum_handler =& xoops_getmodulehandler('forum', 'newbb'); -$forum_obj =& $forum_handler->get($forum); -if (!$forum_handler->getPermission($forum_obj)) { - redirect_header("index.php", 2, _MD_NORIGHTTOACCESS); - exit(); -} -if (!$topic_handler->getPermission($forum_obj, $topic_obj->getVar('topic_status'), "view")) { - redirect_header("viewforum.php?forum=" . $forum_obj->getVar('forum_id'), 2, _MD_NORIGHTTOVIEW); - exit(); -} - -$isadmin = newbb_isAdmin($forum_obj); -$perm = false; -if ($isadmin) { - $perm = true; -} elseif ($topic_handler->getPermission($forum_obj, $topic_obj->getVar('topic_status'), "addpoll") - //&& $forum_obj->getVar('allow_polls') == 1 -) { - if ( ($op=="add" || $op=="save") && !$topic_obj->getVar("topic_haspoll") && is_object($xoopsUser) && $xoopsUser->getVar("uid") == $topic_obj->getVar("topic_poster") ) { - $perm = true; - } elseif (!empty($poll_id)) { - $poll = new XoopsPoll($poll_id); - if (is_object($xoopsUser) && $xoopsUser->getVar("uid") == $poll->getVar("user_id")) { - $perm = true; - } - } -} -if (!$perm) { - redirect_header("viewtopic.php?topic_id=" . $topic_id, 2, _NOPERM); -} - -if ( $op == "add" ) { - $poll_form = new XoopsThemeForm(_MD_POLL_CREATNEWPOLL, "poll_form", "polls.php"); - - $question_text = new XoopsFormText(_MD_POLL_POLLQUESTION, "question", 50, 255); - $poll_form->addElement($question_text, true); - - $desc_tarea = new XoopsFormTextarea(_MD_POLL_POLLDESC, "description"); - $poll_form->addElement($desc_tarea); - - $currenttime = formatTimestamp(time(), "Y-m-d H:i:s"); - $endtime = formatTimestamp(time() + 604800, "Y-m-d H:i:s"); - $expire_text = new XoopsFormText(_MD_POLL_EXPIRATION . "<br /><small>" . _MD_POLL_FORMAT . "<br />" . sprintf(_MD_POLL_CURRENTTIME, $currenttime) . "</small>", "end_time", 30, 19, $endtime); - $poll_form->addElement($expire_text); - - $weight_text = new XoopsFormText(_MD_POLL_DISPLAYORDER, "weight", 6, 5, 0); - $poll_form->addElement($weight_text); - - $multi_yn = new XoopsFormRadioYN(_MD_POLL_ALLOWMULTI, "multiple", 0); - $poll_form->addElement($multi_yn); - - $notify_yn = new XoopsFormRadioYN(_MD_POLL_NOTIFY, "notify", 1); - $poll_form->addElement($notify_yn); - - $option_tray = new XoopsFormElementTray(_MD_POLL_POLLOPTIONS, ""); - $barcolor_array = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . "/modules/".$pollmodules."/images/colorbars/"); - for($i = 0; $i < 10; $i++) { - $current_bar = (current($barcolor_array) != "blank.gif") ? current($barcolor_array) : next($barcolor_array); - $option_text = new XoopsFormText("", "option_text[]", 50, 255); - $option_tray->addElement($option_text); - $color_select = new XoopsFormSelect("", "option_color[{$i}]", $current_bar); - $color_select->addOptionArray($barcolor_array); - $color_select->setExtra("onchange='showImgSelected(\"option_color_image[{$i}]\", \"option_color[{$i}]\", \"modules/".$pollmodules."/images/colorbars\", \"\", \"" . XOOPS_URL . "\")'"); - $color_label = new XoopsFormLabel("", "<img src='" . XOOPS_URL . "/modules/".$pollmodules."/images/colorbars/" . $current_bar . "' name='option_color_image[{$i}]' id='option_color_image[{$i}]' width='30' align='bottom' height='15' alt='' /><br />"); - $option_tray->addElement($color_select); - $option_tray->addElement($color_label); - if ( !next($barcolor_array) ) { - reset($barcolor_array); - } - unset($color_select, $color_label); - } - $poll_form->addElement($option_tray); - - $submit_button = new XoopsFormButton("", "poll_submit", _SUBMIT, "submit"); - $poll_form->addElement($submit_button); - $op_hidden = new XoopsFormHidden("op", "save"); - $poll_form->addElement($op_hidden); - $poll_topic_id_hidden = new XoopsFormHidden("topic_id", $topic_id); - $poll_form->addElement($poll_topic_id_hidden); - //include XOOPS_ROOT_PATH . "/header.php"; - echo "<h4>" . _MD_POLL_POLLCONF . "</h4>"; - $poll_form->display(); - //include XOOPS_ROOT_PATH . "/footer.php"; - //exit(); -} - -if ( $op == "save" ) { - /* - * The option check should be done before submitting - */ - $option_empty = true; - if (empty($_POST['option_text'])) { - redirect_header("javascript:history.go(-1);", 2, _MD_ERROROCCURED . ': ' . _MD_POLL_POLLOPTIONS . ' !'); - } - $option_text = $_POST['option_text']; - foreach ( $option_text as $optxt ) { - if ( trim($optxt) != "" ) { - $option_empty = false; - break; - } - } - if ($option_empty) { - redirect_header("javascript:history.go(-1);", 2, _MD_ERROROCCURED . ': ' . _MD_POLL_POLLOPTIONS . ' !'); - } - if ( $pollmodules == 'xoopspoll') - $poll = new XoopsPoll(); - else if ( $pollmodules == 'umfrage') - $poll = new Umfrage(); - else die("POLL-ERROR: polls.php Line 190"); - $poll->setVar("question", @$_POST['question']); - $poll->setVar("description", @$_POST['description']); - if ( !empty($_POST['end_time']) ) { - $timezone = is_object($xoopsUser) ? $xoopsUser->getVar("timezone") : null; -// Start user input time in hegira date - hacked by irmtfan (www.jadoogaran.org) -// $_POST['end_time']=inputTimeToGregorian($_POST['end_time']); - $poll->setVar("end_time", userTimeToServerTime(XoopsLocal::strtotime($_POST['end_time']), $timezone)); -// End user input time in hegira date - hacked by irmtfan (www.jadoogaran.org) - } else { - // if expiration date is not set, set it to 10 days from now - $poll->setVar("end_time", time() + (86400 * 10)); - } - $poll->setVar("display", 0); - $poll->setVar("weight", intval(@$_POST['weight'])); - $poll->setVar("multiple", intval(@$_POST['multiple'])); - if ( !empty($_POST["notify"]) ) { - // if notify, set mail status to "not mailed" - $poll->setVar("mail_status", POLL_NOTMAILED); - } else { - // if not notify, set mail status to already "mailed" - $poll->setVar("mail_status", POLL_MAILED); - } - $uid = is_object($xoopsUser) ? $xoopsUser->getVar("uid") : 0; - $poll->setVar("user_id", $uid); - $new_poll_id = $poll->store(); - $option_color = empty($_POST['option_color']) ? NULL : $_POST['option_color']; - if ( !empty($new_poll_id) ) { - $i = 0; - foreach ( $option_text as $optxt ) { - $optxt = trim($optxt); - if ( $optxt != "" ) { - if ( $pollmodules == 'xoopspoll') - $option = new XoopsPollOption(); - else if ( $pollmodules == 'umfrage') - $option = new UmfrageOption(); - else die("POLL-ERROR: polls.php Line 223"); - $option->setVar("option_text", $optxt); - $option->setVar("option_color", $option_color[$i]); - $option->setVar("poll_id", $new_poll_id); - $option->store(); - } - $i++; - } - $sql = "UPDATE " . $xoopsDB->prefix("bb_topics") . " SET topic_haspoll = 1, poll_id = {$new_poll_id} WHERE topic_id = {$topic_id}"; - if ( !$result = $xoopsDB->query($sql) ) { - xoops_error($xoopsDB->er... [truncated message content] |
From: <ir...@us...> - 2012-08-02 07:28:25
|
Revision: 9977 http://xoops.svn.sourceforge.net/xoops/?rev=9977&view=rev Author: irmtfan Date: 2012-08-02 07:28:11 +0000 (Thu, 02 Aug 2012) Log Message: ----------- apply style.css customization apply input time localization remove many hardcodes in templates Modified Paths: -------------- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev9883.txt XoopsModules/newbb/branches/irmtfan/newbb/header.php XoopsModules/newbb/branches/irmtfan/newbb/polls.php XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_index.html XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_thread.html XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewall.html XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewforum.html XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewpost.html XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html Modified: XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev9883.txt =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev9883.txt 2012-08-02 05:24:36 UTC (rev 9976) +++ XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev9883.txt 2012-08-02 07:28:11 UTC (rev 9977) @@ -1,7 +1,27 @@ Changelog from rev.9883 +date: 2012-08-01 +================================================ +1- localization: input date localized (for other date systems like hegira) by replacing strtotime by XoopsLocal::strtotime +in newbb/polls.php + +2- customization&localization: newbb style.css is fully localized and customized and is not hard-coded anymore. +in newbb/header.php +file changes: +-- deleted newbb/templates/style.css +-- added newbb/templates/images/language/english/style.css +-- added newbb/templates/images/language/persian/style.css +priorities: +if exist in themes/YOUR_THEME/modules/newbb/images/language/YOUR_LANG/style.css take it +else if exist in themes/default/modules/newbb/images/language/YOUR_LANG/style.css take it +else if exist in modules/newbb/templates/images/language/YOUR_LANG/style.css take it +else if exist in modules/newbb/templates/images/language/english/style.css take it +else if exist in modules/newbb/templates/style.css take it (for backward compatibility) + +3- many hardcodes in newbb/templates and style.css has been removed + date: 2012-07-30 ================================================ -1- bug fix: edit not record when the reason is not filled (irmtfan) +1- bug fix: edit not displayed when the reason is not filled (irmtfan) 2- bug fix: only the last edit is recorded. (irmtfan/alfred) in newbb/class/post.php 3- bug fix: 'noapprove' permission incorrectly recorded in database. (irmtfan) @@ -12,5 +32,5 @@ in newbb/xoops_version.php 6- hardcode: some style.css color hardcodes has been removed. (irmtfan) in newbb/templates/style.css -7- feature added: text links instead of buttons. (deka98/irmtfan) -in newbb/class/icon.php , newbb/include/functions.render.php , newbb/include/plugin.php +7- feature added: text links instead of buttons. (deka87/irmtfan) +in newbb/class/icon.php , newbb/include/functions.render.php , newbb/include/plugin.php \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/header.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/header.php 2012-08-02 05:24:36 UTC (rev 9976) +++ XoopsModules/newbb/branches/irmtfan/newbb/header.php 2012-08-02 07:28:11 UTC (rev 9977) @@ -1,116 +1,140 @@ -<?php -/** - * CBB 4.0, or newbb, the forum module for XOOPS project - * - * @copyright The XOOPS Project http://xoops.sf.net - * @license http://www.fsf.org/copyleft/gpl.html GNU public license - * @author Taiwen Jiang (phppp or D.J.) <ph...@us...> - * @since 4.00 - * @version $Id$ - * @package module::newbb - */ -include_once '../../mainfile.php'; -defined('XOOPS_ROOT_PATH') or die('Restricted access'); -$xoopsLogger->startTime('newBB_Header'); - -if (!empty($xoopsModuleConfig['do_rewrite'])) { - include_once "seo_url.php"; - /* for seo */ - $toseo_url = array("index.php","viewforum.php","viewtopic.php","rss.php"); - - if(((strpos(getenv('REQUEST_URI'), '.html') === false) && !empty($xoopsModuleConfig['do_rewrite']) && (!isset($_POST) || count($_POST) <= 0))) - { - $redir = false; - if ( strpos(getenv("REQUEST_URI"),"mark_read=") == true || strpos(getenv("REQUEST_URI"),"mark=") == true) { - // Mark Forums - } else { - if ( in_array(basename(getenv('SCRIPT_NAME')),$toseo_url) ) { - //rewrite only for files - - if ( trim(getenv("SCRIPT_NAME")) != '' ) { - if ( strpos(getenv("REQUEST_URI") , "/".SEO_MODULE_NAME."/") === false ) { - $redir = true; - } else if ( getenv("QUERY_STRING") ) { - $redir = true; - } - } - } - } - - if ($redir == true) { - $s = "http://" . getenv('HTTP_HOST') . getenv("REQUEST_URI"); - $s = str_replace("/".REAL_MODULE_NAME."/","/".SEO_MODULE_NAME."/",$s); - $newurl = seo_urls('<a href="'.$s.'"></a>'); - $newurl = str_replace('<a href="','',$newurl); - $newurl = str_replace('"></a>','',$newurl); - if ( !headers_sent() ) { - header("HTTP/1.1 301 Moved Permanently"); - header("Location: $newurl"); - exit(); - } - } - } -} - -include_once XOOPS_ROOT_PATH."/modules/".$xoopsModule->getVar("dirname")."/include/vars.php"; - -mod_loadFunctions("user", "newbb"); -mod_loadFunctions("topic", "newbb"); - -require_once XOOPS_ROOT_PATH."/class/xoopsformloader.php"; -require_once XOOPS_ROOT_PATH."/class/module.textsanitizer.php"; -$myts = MyTextSanitizer::getInstance(); - -$menumode = 0; -$menumode_other = array(); -$menu_url = htmlSpecialChars(preg_replace("/&menumode=[^&]/", "", $_SERVER[ 'REQUEST_URI' ])); -$menu_url .= ( false === strpos($menu_url, "?") ) ? "?menumode=" : "&menumode="; -foreach ($xoopsModuleConfig["valid_menumodes"] as $key => $val) { - if ($key != $menumode) $menumode_other[] = array("title"=>$val, "link"=>$menu_url.$key); -} - - -$newbb_module_header = ''; -$newbb_module_header .= '<link rel="alternate" type="application/rss+xml" title="'.$xoopsModule->getVar("name").'" href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', "n").'/rss.php" />'; -if (!empty($xoopsModuleConfig['pngforie_enabled'])) { - $newbb_module_header .= '<style type="text/css">img {behavior:url("include/pngbehavior.htc");}</style>'; -} -$newbb_module_header .= ' - <link rel="stylesheet" type="text/css" href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar("dirname").'/templates/style.css" /> - <script type="text/javascript">var toggle_cookie="'.$forumCookie['prefix'].'G'.'";</script> - <script src="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar("dirname").'/include/js/newbb_toggle.js" type="text/javascript"></script> - '; - -if ($menumode == 2) { - $newbb_module_header .= ' - <link rel="stylesheet" type="text/css" href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar("dirname").'templates/newbb_menu_hover.css" /> - <style type="text/css">body {behavior:url("include/newbb.htc");}</style> - '; -} - -if ($menumode == 1) { - $newbb_module_header .= ' - <link rel="stylesheet" type="text/css" href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar("dirname").'templates/newbb_menu_click.css" /> - <script src="include/js/newbb_menu_click.js" type="text/javascript"></script> - '; -} - -$xoops_module_header = $newbb_module_header; // for cache hack - -if (!empty($xoopsModuleConfig["welcome_forum"]) && is_object($xoopsUser) && !$xoopsUser->getVar('posts')) { - mod_loadFunctions("welcome", "newbb"); -} - -$pollmodules = NULL; -//$module_handler = &xoops_gethandler('module'); -$xoopspoll = &$module_handler->getByDirname('xoopspoll'); -if (is_object($xoopspoll) && $xoopspoll->getVar('isactive')) { - $pollmodules = 'xoopspoll'; -} else { - //Umfrage - $xoopspoll = &$module_handler->getByDirname('umfrage'); - if (is_object($xoopspoll) && $xoopspoll->getVar('isactive')) - $pollmodules = 'umfrage'; -} -$xoopsLogger->stopTime('newBB_Header'); +<?php +/** + * CBB 4.0, or newbb, the forum module for XOOPS project + * + * @copyright The XOOPS Project http://xoops.sf.net + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @author Taiwen Jiang (phppp or D.J.) <ph...@us...> + * @since 4.00 + * @version $Id$ + * @package module::newbb + */ +include_once '../../mainfile.php'; +defined('XOOPS_ROOT_PATH') or die('Restricted access'); +$xoopsLogger->startTime('newBB_Header'); + +if (!empty($xoopsModuleConfig['do_rewrite'])) { + include_once "seo_url.php"; + /* for seo */ + $toseo_url = array("index.php","viewforum.php","viewtopic.php","rss.php"); + + if(((strpos(getenv('REQUEST_URI'), '.html') === false) && !empty($xoopsModuleConfig['do_rewrite']) && (!isset($_POST) || count($_POST) <= 0))) + { + $redir = false; + if ( strpos(getenv("REQUEST_URI"),"mark_read=") == true || strpos(getenv("REQUEST_URI"),"mark=") == true) { + // Mark Forums + } else { + if ( in_array(basename(getenv('SCRIPT_NAME')),$toseo_url) ) { + //rewrite only for files + + if ( trim(getenv("SCRIPT_NAME")) != '' ) { + if ( strpos(getenv("REQUEST_URI") , "/".SEO_MODULE_NAME."/") === false ) { + $redir = true; + } else if ( getenv("QUERY_STRING") ) { + $redir = true; + } + } + } + } + + if ($redir == true) { + $s = "http://" . getenv('HTTP_HOST') . getenv("REQUEST_URI"); + $s = str_replace("/".REAL_MODULE_NAME."/","/".SEO_MODULE_NAME."/",$s); + $newurl = seo_urls('<a href="'.$s.'"></a>'); + $newurl = str_replace('<a href="','',$newurl); + $newurl = str_replace('"></a>','',$newurl); + if ( !headers_sent() ) { + header("HTTP/1.1 301 Moved Permanently"); + header("Location: $newurl"); + exit(); + } + } + } +} + +include_once XOOPS_ROOT_PATH."/modules/".$xoopsModule->getVar("dirname")."/include/vars.php"; + +mod_loadFunctions("user", "newbb"); +mod_loadFunctions("topic", "newbb"); + +require_once XOOPS_ROOT_PATH."/class/xoopsformloader.php"; +require_once XOOPS_ROOT_PATH."/class/module.textsanitizer.php"; +$myts = MyTextSanitizer::getInstance(); + +$menumode = 0; +$menumode_other = array(); +$menu_url = htmlSpecialChars(preg_replace("/&menumode=[^&]/", "", $_SERVER[ 'REQUEST_URI' ])); +$menu_url .= ( false === strpos($menu_url, "?") ) ? "?menumode=" : "&menumode="; +foreach ($xoopsModuleConfig["valid_menumodes"] as $key => $val) { + if ($key != $menumode) $menumode_other[] = array("title"=>$val, "link"=>$menu_url.$key); +} + + +$newbb_module_header = ''; +$newbb_module_header .= '<link rel="alternate" type="application/rss+xml" title="'.$xoopsModule->getVar("name").'" href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', "n").'/rss.php" />'; +if (!empty($xoopsModuleConfig['pngforie_enabled'])) { + $newbb_module_header .= '<style type="text/css">img {behavior:url("include/pngbehavior.htc");}</style>'; +} +// START hacked by irmtfan to add localization/customization for newbb style.css +$dirname=$xoopsModule->getVar('dirname'); +$theme_path = "{$xoopsConfig['theme_set']}/modules/{$dirname}"; +$theme_default_path= "default/modules/{$dirname}"; +$default_path = "modules/{$dirname}/templates"; +$lang_path = "images/language/{$xoopsConfig['language']}"; + + // get from setted theme +if (is_file(XOOPS_THEME_PATH . '/'.$theme_path . '/' . $lang_path . '/style.css')) { + $rel_path=$theme_path . '/' . $lang_path; + // get from default theme +} else if (is_file(XOOPS_THEME_PATH . '/'.$theme_default_path . '/' . $lang_path . '/style.css')) { + $rel_path=$theme_default_path . '/' . $lang_path; + // get from module default path +} else if (is_file(XOOPS_ROOT_PATH. '/'.$default_path . '/' . $lang_path . '/style.css')) { + $rel_path=$default_path . '/' . $lang_path; + // if no one is found get the english from default path +} else if (is_file(XOOPS_ROOT_PATH. '/'.$default_path . '/images/language/english/style.css')) { + $rel_path=$default_path . '/images/language/english'; + // for backward compatibility - as before +} else { + $rel_path=$default_path; +} + +$newbb_module_header .= ' + <link rel="stylesheet" type="text/css" href="'.XOOPS_URL . '/' . $rel_path . '/style.css" /> + <script type="text/javascript">var toggle_cookie="'.$forumCookie['prefix'].'G'.'";</script> + <script src="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar("dirname").'/include/js/newbb_toggle.js" type="text/javascript"></script> + '; +// END hacked by irmtfan to add localization/customization for newbb style.css +if ($menumode == 2) { + $newbb_module_header .= ' + <link rel="stylesheet" type="text/css" href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar("dirname").'templates/newbb_menu_hover.css" /> + <style type="text/css">body {behavior:url("include/newbb.htc");}</style> + '; +} + +if ($menumode == 1) { + $newbb_module_header .= ' + <link rel="stylesheet" type="text/css" href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar("dirname").'templates/newbb_menu_click.css" /> + <script src="include/js/newbb_menu_click.js" type="text/javascript"></script> + '; +} + +$xoops_module_header = $newbb_module_header; // for cache hack + +if (!empty($xoopsModuleConfig["welcome_forum"]) && is_object($xoopsUser) && !$xoopsUser->getVar('posts')) { + mod_loadFunctions("welcome", "newbb"); +} + +$pollmodules = NULL; +//$module_handler = &xoops_gethandler('module'); +$xoopspoll = &$module_handler->getByDirname('xoopspoll'); +if (is_object($xoopspoll) && $xoopspoll->getVar('isactive')) { + $pollmodules = 'xoopspoll'; +} else { + //Umfrage + $xoopspoll = &$module_handler->getByDirname('umfrage'); + if (is_object($xoopspoll) && $xoopspoll->getVar('isactive')) + $pollmodules = 'umfrage'; +} +$xoopsLogger->stopTime('newBB_Header'); ?> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/polls.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/polls.php 2012-08-02 05:24:36 UTC (rev 9976) +++ XoopsModules/newbb/branches/irmtfan/newbb/polls.php 2012-08-02 07:28:11 UTC (rev 9977) @@ -1,570 +1,580 @@ -<?php -/** - * Newbb module - * - * You may not change or alter any portion of this comment or credits - * of supporting developers from this source code or any supporting source code - * which is considered copyrighted (c) material of the original comment or credit authors. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ - * @license http://www.fsf.org/copyleft/gpl.html GNU public license - * @package newbb - * @since 4.0 - * @author Taiwen Jiang <ph...@us...> - * @version $Id: polls.php 2175 2008-09-23 14:07:03Z phppp $ - */ - - -include_once dirname(__FILE__) . "/header.php"; - -include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php"; -include_once XOOPS_ROOT_PATH . "/class/xoopslists.php"; -include_once XOOPS_ROOT_PATH . "/class/xoopsblock.php"; - -if ( $pollmodules == 'xoopspoll') -{ - include XOOPS_ROOT_PATH . "/modules/xoopspoll/include/constants.php"; - include_once XOOPS_ROOT_PATH . "/modules/xoopspoll/class/xoopspoll.php"; - include_once XOOPS_ROOT_PATH . "/modules/xoopspoll/class/xoopspolloption.php"; - include_once XOOPS_ROOT_PATH . "/modules/xoopspoll/class/xoopspolllog.php"; - include_once XOOPS_ROOT_PATH . "/modules/xoopspoll/class/xoopspollrenderer.php"; -} -elseif ($pollmodules == 'umfrage') -{ - include XOOPS_ROOT_PATH."/modules/umfrage/include/constants.php"; - include_once XOOPS_ROOT_PATH."/modules/umfrage/class/umfrage.php"; - include_once XOOPS_ROOT_PATH."/modules/umfrage/class/umfrageoption.php"; - include_once XOOPS_ROOT_PATH."/modules/umfrage/class/umfragelog.php"; - include_once XOOPS_ROOT_PATH."/modules/umfrage/class/umfragerenderer.php"; -} -else -{ - redirect_header("javascript:history.go(-1);", 2, _MD_POLLMODULE_ERROR); - exit(); -} - -$op = "add"; -if (isset($_GET['op'])) $op = $_GET['op']; -if (isset($_POST['op'])) $op = $_POST['op']; -if (isset($_GET['poll_id'])) $poll_id = intval($_GET['poll_id']); -if (isset($_POST['poll_id'])) $poll_id = intval($_POST['poll_id']); -if (isset($_GET['topic_id'])) $topic_id = intval($_GET['topic_id']); -if (isset($_POST['topic_id'])) $topic_id = intval($_POST['topic_id']); - -if (!isset($module_handler)) $module_handler =& xoops_gethandler('module'); -$xoopspoll =& $module_handler->getByDirname($pollmodules); -if (!is_object($xoopspoll) || !$xoopspoll->getVar('isactive')) { - redirect_header("javascript:history.go(-1);", 2, _MD_POLLMODULE_ERROR); - exit(); -} - -include XOOPS_ROOT_PATH . "/header.php"; - -$topic_handler =& xoops_getmodulehandler('topic', 'newbb'); -$topic_obj =& $topic_handler->get($topic_id); -$forum = $topic_obj->getVar('forum_id'); -$forum_handler =& xoops_getmodulehandler('forum', 'newbb'); -$forum_obj =& $forum_handler->get($forum); -if (!$forum_handler->getPermission($forum_obj)) { - redirect_header("index.php", 2, _MD_NORIGHTTOACCESS); - exit(); -} -if (!$topic_handler->getPermission($forum_obj, $topic_obj->getVar('topic_status'), "view")) { - redirect_header("viewforum.php?forum=" . $forum_obj->getVar('forum_id'), 2, _MD_NORIGHTTOVIEW); - exit(); -} - -$isadmin = newbb_isAdmin($forum_obj); -$perm = false; -if ($isadmin) { - $perm = true; -} elseif ($topic_handler->getPermission($forum_obj, $topic_obj->getVar('topic_status'), "addpoll") - //&& $forum_obj->getVar('allow_polls') == 1 -) { - if ( ($op=="add" || $op=="save") && !$topic_obj->getVar("topic_haspoll") && is_object($xoopsUser) && $xoopsUser->getVar("uid") == $topic_obj->getVar("topic_poster") ) { - $perm = true; - } elseif (!empty($poll_id)) { - $poll = new XoopsPoll($poll_id); - if (is_object($xoopsUser) && $xoopsUser->getVar("uid") == $poll->getVar("user_id")) { - $perm = true; - } - } -} -if (!$perm) { - redirect_header("viewtopic.php?topic_id=" . $topic_id, 2, _NOPERM); -} - -if ( $op == "add" ) { - $poll_form = new XoopsThemeForm(_MD_POLL_CREATNEWPOLL, "poll_form", "polls.php"); - - $question_text = new XoopsFormText(_MD_POLL_POLLQUESTION, "question", 50, 255); - $poll_form->addElement($question_text, true); - - $desc_tarea = new XoopsFormTextarea(_MD_POLL_POLLDESC, "description"); - $poll_form->addElement($desc_tarea); - - $currenttime = formatTimestamp(time(), "Y-m-d H:i:s"); - $endtime = formatTimestamp(time() + 604800, "Y-m-d H:i:s"); - $expire_text = new XoopsFormText(_MD_POLL_EXPIRATION . "<br /><small>" . _MD_POLL_FORMAT . "<br />" . sprintf(_MD_POLL_CURRENTTIME, $currenttime) . "</small>", "end_time", 30, 19, $endtime); - $poll_form->addElement($expire_text); - - $weight_text = new XoopsFormText(_MD_POLL_DISPLAYORDER, "weight", 6, 5, 0); - $poll_form->addElement($weight_text); - - $multi_yn = new XoopsFormRadioYN(_MD_POLL_ALLOWMULTI, "multiple", 0); - $poll_form->addElement($multi_yn); - - $notify_yn = new XoopsFormRadioYN(_MD_POLL_NOTIFY, "notify", 1); - $poll_form->addElement($notify_yn); - - $option_tray = new XoopsFormElementTray(_MD_POLL_POLLOPTIONS, ""); - $barcolor_array = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . "/modules/".$pollmodules."/images/colorbars/"); - for($i = 0; $i < 10; $i++) { - $current_bar = (current($barcolor_array) != "blank.gif") ? current($barcolor_array) : next($barcolor_array); - $option_text = new XoopsFormText("", "option_text[]", 50, 255); - $option_tray->addElement($option_text); - $color_select = new XoopsFormSelect("", "option_color[{$i}]", $current_bar); - $color_select->addOptionArray($barcolor_array); - $color_select->setExtra("onchange='showImgSelected(\"option_color_image[{$i}]\", \"option_color[{$i}]\", \"modules/".$pollmodules."/images/colorbars\", \"\", \"" . XOOPS_URL . "\")'"); - $color_label = new XoopsFormLabel("", "<img src='" . XOOPS_URL . "/modules/".$pollmodules."/images/colorbars/" . $current_bar . "' name='option_color_image[{$i}]' id='option_color_image[{$i}]' width='30' align='bottom' height='15' alt='' /><br />"); - $option_tray->addElement($color_select); - $option_tray->addElement($color_label); - if ( !next($barcolor_array) ) { - reset($barcolor_array); - } - unset($color_select, $color_label); - } - $poll_form->addElement($option_tray); - - $submit_button = new XoopsFormButton("", "poll_submit", _SUBMIT, "submit"); - $poll_form->addElement($submit_button); - $op_hidden = new XoopsFormHidden("op", "save"); - $poll_form->addElement($op_hidden); - $poll_topic_id_hidden = new XoopsFormHidden("topic_id", $topic_id); - $poll_form->addElement($poll_topic_id_hidden); - //include XOOPS_ROOT_PATH . "/header.php"; - echo "<h4>" . _MD_POLL_POLLCONF . "</h4>"; - $poll_form->display(); - //include XOOPS_ROOT_PATH . "/footer.php"; - //exit(); -} - -if ( $op == "save" ) { - /* - * The option check should be done before submitting - */ - $option_empty = true; - if (empty($_POST['option_text'])) { - redirect_header("javascript:history.go(-1);", 2, _MD_ERROROCCURED . ': ' . _MD_POLL_POLLOPTIONS . ' !'); - } - $option_text = $_POST['option_text']; - foreach ( $option_text as $optxt ) { - if ( trim($optxt) != "" ) { - $option_empty = false; - break; - } - } - if ($option_empty) { - redirect_header("javascript:history.go(-1);", 2, _MD_ERROROCCURED . ': ' . _MD_POLL_POLLOPTIONS . ' !'); - } - if ( $pollmodules == 'xoopspoll') - $poll = new XoopsPoll(); - else if ( $pollmodules == 'umfrage') - $poll = new Umfrage(); - else die("POLL-ERROR: polls.php Line 190"); - $poll->setVar("question", @$_POST['question']); - $poll->setVar("description", @$_POST['description']); - if ( !empty($_POST['end_time']) ) { - $timezone = is_object($xoopsUser) ? $xoopsUser->getVar("timezone") : null; - $poll->setVar("end_time", userTimeToServerTime(strtotime($_POST['end_time']), $timezone)); - } else { - // if expiration date is not set, set it to 10 days from now - $poll->setVar("end_time", time() + (86400 * 10)); - } - $poll->setVar("display", 0); - $poll->setVar("weight", intval(@$_POST['weight'])); - $poll->setVar("multiple", intval(@$_POST['multiple'])); - if ( !empty($_POST["notify"]) ) { - // if notify, set mail status to "not mailed" - $poll->setVar("mail_status", POLL_NOTMAILED); - } else { - // if not notify, set mail status to already "mailed" - $poll->setVar("mail_status", POLL_MAILED); - } - $uid = is_object($xoopsUser) ? $xoopsUser->getVar("uid") : 0; - $poll->setVar("user_id", $uid); - $new_poll_id = $poll->store(); - $option_color = empty($_POST['option_color']) ? NULL : $_POST['option_color']; - if ( !empty($new_poll_id) ) { - $i = 0; - foreach ( $option_text as $optxt ) { - $optxt = trim($optxt); - if ( $optxt != "" ) { - if ( $pollmodules == 'xoopspoll') - $option = new XoopsPollOption(); - else if ( $pollmodules == 'umfrage') - $option = new UmfrageOption(); - else die("POLL-ERROR: polls.php Line 223"); - $option->setVar("option_text", $optxt); - $option->setVar("option_color", $option_color[$i]); - $option->setVar("poll_id", $new_poll_id); - $option->store(); - } - $i++; - } - $sql = "UPDATE " . $xoopsDB->prefix("bb_topics") . " SET topic_haspoll = 1, poll_id = {$new_poll_id} WHERE topic_id = {$topic_id}"; - if ( !$result = $xoopsDB->query($sql) ) { - xoops_error($xoopsDB->error()); - } - include_once XOOPS_ROOT_PATH . '/class/template.php'; - xoops_template_clear_module_cache($xoopsModule->getVar('mid')); - } else { - xoops_error($poll->getHtmlErrors()); - exit(); - } - redirect_header("viewtopic.php?topic_id={$topic_id}",1,_MD_POLL_DBUPDATED); - //exit(); -} - -if ( $op == "edit" ) { - $pollid = intval($_GET['poll_id']); - if ( $pollmodules == 'xoopspoll') - $poll = new XoopsPoll($pollid); - else if ( $pollmodules == 'umfrage') - $poll = new Umfrage($pollid); - $poll_form = new XoopsThemeForm(_MD_POLL_EDITPOLL, "poll_form", "polls.php"); - $author_label = new XoopsFormLabel(_MD_POLL_AUTHOR, "<a href='" . XOOPS_URL . "/userinfo.php?uid=" . $poll->getVar("user_id") . "'>" . newbb_getUnameFromId($poll->getVar("user_id"), $xoopsModuleConfig['show_realname']) . "</a>"); - $poll_form->addElement($author_label); - $question_text = new XoopsFormText(_MD_POLL_POLLQUESTION, "question", 50, 255, $poll->getVar("question", "E")); - $poll_form->addElement($question_text); - $desc_tarea = new XoopsFormTextarea(_MD_POLL_POLLDESC, "description", $poll->getVar("description", "E")); - $poll_form->addElement($desc_tarea); - $date = formatTimestamp($poll->getVar("end_time"), "Y-m-d H:i:s"); - if ( !$poll->hasExpired() ) { - $expire_text = new XoopsFormText(_MD_POLL_EXPIRATION . "<br /><small>" . _MD_POLL_FORMAT . "<br />" . sprintf(_MD_POLL_CURRENTTIME, formatTimestamp(time(), "Y-m-d H:i:s")) . "</small>", "end_time", 20, 19, $date); - $poll_form->addElement($expire_text); - } else { - $restart_label = new XoopsFormLabel(_MD_POLL_EXPIRATION, sprintf(_MD_POLL_EXPIREDAT, $date) . "<br /><a href='polls.php?op=restart&poll_id=" . $poll->getVar("poll_id") . "'>" . _MD_POLL_RESTART . "</a>"); - $poll_form->addElement($restart_label); - } - $weight_text = new XoopsFormText(_MD_POLL_DISPLAYORDER, "weight", 6, 5, $poll->getVar("weight")); - $poll_form->addElement($weight_text); - $multi_yn = new XoopsFormRadioYN(_MD_POLL_ALLOWMULTI, "multiple", $poll->getVar("multiple")); - $poll_form->addElement($multi_yn); - if ( $pollmodules == 'xoopspoll') - $options_arr = XoopsPollOption::getAllByPollId($poll->getVar("poll_id")); - else - $options_arr =& UmfrageOption::getAllByPollId($poll->getVar("poll_id")); - $notify_value = 1; - if ( $poll->getVar("mail_status") != 0 ) { - $notify_value = 0; - } - $notify_yn = new XoopsFormRadioYN(_MD_POLL_NOTIFY, "notify", $notify_value); - $poll_form->addElement($notify_yn); - $option_tray = new XoopsFormElementTray(_MD_POLL_POLLOPTIONS, ""); - $barcolor_array = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . "/modules/".$pollmodules."/images/colorbars/"); - $i = 0; - foreach ($options_arr as $option) { - $option_text = new XoopsFormText("", "option_text[]", 50, 255, $option->getVar("option_text")); - $option_tray->addElement($option_text); - $option_id_hidden = new XoopsFormHidden("option_id[]", $option->getVar("option_id")); - $option_tray->addElement($option_id_hidden); - $color_select = new XoopsFormSelect("", "option_color[{$i}]", $option->getVar("option_color")); - $color_select->addOptionArray($barcolor_array); - $color_select->setExtra("onchange='showImgSelected(\"option_color_image[{$i}]\", \"option_color[".$i."]\", \"modules/".$pollmodules."/images/colorbars\", \"\", \"" . XOOPS_URL . "\")'"); - $color_label = new XoopsFormLabel("", "<img src='" . XOOPS_URL . "/modules/".$pollmodules."/images/colorbars/" . $option->getVar("option_color", "E") . "' name='option_color_image[{$i}]' id='option_color_image[{$i}]' width='30' align='bottom' height='15' alt='' /><br />"); - $option_tray->addElement($color_select); - $option_tray->addElement($color_label); - unset($color_select, $color_label, $option_id_hidden, $option_text); - $i++; - } - $more_label = new XoopsFormLabel("", "<br /><a href='polls.php?op=addmore&poll_id=" . $poll->getVar("poll_id") . "&topic_id=" . $topic_id . "'>" . _MD_POLL_ADDMORE . "</a>"); - $option_tray->addElement($more_label); - $poll_form->addElement($option_tray); - $op_hidden = new XoopsFormHidden("op", "update"); - $poll_form->addElement($op_hidden); - $poll_topic_id_hidden = new XoopsFormHidden("topic_id", $topic_id); - $poll_form->addElement($poll_topic_id_hidden); - $poll_id_hidden = new XoopsFormHidden("poll_id", $poll->getVar("poll_id")); - $poll_form->addElement($poll_id_hidden); - $submit_button = new XoopsFormButton("", "poll_submit", _SUBMIT, "submit"); - $poll_form->addElement($submit_button); - //include XOOPS_ROOT_PATH . "/header.php"; - echo "<h4>" . _MD_POLL_POLLCONF . "</h4>"; - $poll_form->display(); - //include XOOPS_ROOT_PATH . "/footer.php"; - //exit(); -} - -if ( $op == "update" ) { - $option_empty = true; - if (empty($_POST['option_text'])) { - redirect_header("javascript:history.go(-1);", 2, _MD_ERROROCCURED . ': ' . _MD_POLL_POLLOPTIONS . ' !'); - } - $option_text = $_POST['option_text']; - foreach ( $option_text as $optxt ) { - if ( trim($optxt) != "" ) { - $option_empty = false; - break; - } - } - if ($option_empty) redirect_header("javascript:history.go(-1);", 2, _MD_ERROROCCURED . ': ' . _MD_POLL_POLLOPTIONS . ' !'); - - if ( $pollmodules == 'xoopspoll') - $poll = new XoopsPoll($poll_id); - else - $poll = new Umfrage($poll_id); - $poll->setVar("question", @$_POST['question']); - $poll->setVar("description", @$_POST['description']); - $end_time = (empty($_POST['end_time'])) ? "" : $_POST['end_time']; - if ( !empty($end_time) ) { - $timezone = is_object($xoopsUser) ? $xoopsUser->getVar("timezone") : null; - $poll->setVar("end_time", userTimeToServerTime(strtotime($end_time), $timezone)); - } - $poll->setVar("display", 0); - $poll->setVar("weight", intval(@$_POST['weight'])); - $poll->setVar("multiple", intval(@$_POST['multiple'])); - if ( !empty($_POST["notify"]) && $end_time > time() ) { - // if notify, set mail status to "not mailed" - $poll->setVar("mail_status", POLL_NOTMAILED); - } else { - // if not notify, set mail status to already "mailed" - $poll->setVar("mail_status", POLL_MAILED); - } - if ( !$poll->store() ) { - exit(); - } - $i = 0; - $option_id = (empty($_POST['option_id'])) ? NULL : $_POST['option_id']; - $option_color = (empty($_POST['option_color'])) ? NULL : $_POST['option_color']; - foreach ( $option_id as $opid ) { - if ( $pollmodules == 'xoopspoll') { - $option = new XoopsPollOption($opid); - $option_text[$i] = trim ($option_text[$i]); - if ( $option_text[$i] != "" ) { - $option->setVar("option_text", $option_text[$i]); - $option->setVar("option_color", $option_color[$i]); - $option->store(); - } else { - if ( $option->delete() != false ) { - XoopsPollLog::deleteByOptionId($option->getVar("option_id")); - } - } - } else { - $option = new UmfrageOption($opid); - $option_text[$i] = trim ($option_text[$i]); - if ( $option_text[$i] != "" ) { - $option->setVar("option_text", $option_text[$i]); - $option->setVar("option_color", $option_color[$i]); - $option->store(); - } else { - if ( $option->delete() != false ) { - UmfrageLog::deleteByOptionId($option->getVar("option_id")); - } - } - } - $i++; - } - $poll->updateCount(); - include_once XOOPS_ROOT_PATH . '/class/template.php'; - xoops_template_clear_module_cache($xoopsModule->getVar('mid')); - redirect_header("viewtopic.php?topic_id={$topic_id}", 1, _MD_POLL_DBUPDATED); - //exit(); -} - -if ( $op == "addmore" ) { - $pollid = intval($_GET['poll_id']); - if ( $pollmodules == 'xoopspoll') - $poll = new XoopsPoll($pollid); - else if ( $pollmodules == 'umfrage') - $poll = new Umfrage($pollid); - $poll_form = new XoopsThemeForm(_MD_POLL_ADDMORE, "poll_form", "polls.php"); - $question_label = new XoopsFormLabel(_MD_POLL_POLLQUESTION, $poll->getVar("question")); - $poll_form->addElement($question_label); - $option_tray = new XoopsFormElementTray(_MD_POLL_POLLOPTIONS, ""); - $barcolor_array = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . "/modules/".$pollmodules."/images/colorbars/"); - for($i = 0; $i < 10; $i++) { - $current_bar = (current($barcolor_array) != "blank.gif") ? current($barcolor_array) : next($barcolor_array); - $option_text = new XoopsFormText("", "option_text[]", 50, 255); - $option_tray->addElement($option_text); - $color_select = new XoopsFormSelect("", "option_color[{$i}]", $current_bar); - $color_select->addOptionArray($barcolor_array); - $color_select->setExtra("onchange='showImgSelected(\"option_color_image[{$i}]\", \"option_color[{$i}]\", \"modules/".$pollmodules."/images/colorbars\", \"\", \"" . XOOPS_URL . "\")'"); - $color_label = new XoopsFormLabel("", "<img src='" . XOOPS_URL . "/modules/".$pollmodules."/images/colorbars/{$current_bar}' name='option_color_image[{$i}]' id='option_color_image[{$i}]' width='30' align='bottom' height='15' alt='' /><br />"); - $option_tray->addElement($color_select); - $option_tray->addElement($color_label); - unset($color_select, $color_label, $option_text); - if ( !next($barcolor_array) ) { - reset($barcolor_array); - } - } - $poll_form->addElement($option_tray); - $submit_button = new XoopsFormButton("", "poll_submit", _SUBMIT, "submit"); - $poll_form->addElement($submit_button); - $op_hidden = new XoopsFormHidden("op", "savemore"); - $poll_form->addElement($op_hidden); - $poll_topic_id_hidden = new XoopsFormHidden("topic_id", $topic_id); - $poll_form->addElement($poll_topic_id_hidden); - $poll_id_hidden = new XoopsFormHidden("poll_id", $poll->getVar("poll_id")); - $poll_form->addElement($poll_id_hidden); - //include XOOPS_ROOT_PATH . "/header.php"; - echo "<h4>" . _MD_POLL_POLLCONF . "</h4>"; - $poll_form->display(); - //include XOOPS_ROOT_PATH . "/footer.php"; - //exit(); -} - -if ( $op == "savemore" ) { - $option_empty = true; - if (empty($_POST['option_text'])) { - redirect_header("javascript:history.go(-1);", 2, _MD_ERROROCCURED . ': ' . _MD_POLL_POLLOPTIONS . ' !'); - } - $option_text = $_POST['option_text']; - foreach ( $option_text as $optxt ) { - if ( trim($optxt) != "" ) { - $option_empty = false; - break; - } - } - if ($option_empty) redirect_header("javascript:history.go(-1);", 2, _MD_ERROROCCURED . ': ' . _MD_POLL_POLLOPTIONS . ' !'); - - if ( $pollmodules == 'xoopspoll') - $poll = new XoopsPoll($poll_id); - else - $poll = new Umfrage($poll_id); - $i = 0; - $option_color = (empty($_POST['option_color'])) ? NULL : $_POST['option_color']; - foreach ( $option_text as $optxt ) { - $optxt = trim($optxt); - if ( $optxt != "" ) { - if ( $pollmodules == 'xoopspoll') $option = new XoopsPollOption(); - else $option = new UmfrageOption(); - $option->setVar("option_text", $optxt); - $option->setVar("poll_id", $poll->getVar("poll_id")); - $option->setVar("option_color", $option_color[$i]); - $option->store(); - } - $i++; - } - include_once XOOPS_ROOT_PATH . '/class/template.php'; - xoops_template_clear_module_cache($xoopsModule->getVar('mid')); - redirect_header("polls.php?op=edit&poll_id=" . $poll->getVar("poll_id") . "&topic_id=" . $topic_id, 1, _MD_POLL_DBUPDATED); - //exit(); -} - -if ( $op == "delete" ) { - //include XOOPS_ROOT_PATH . "/header.php"; - echo "<h4>" . _MD_POLL_POLLCONF . "</h4>"; - $poll = new XoopsPoll($_GET['poll_id']); - xoops_confirm(array('op' => 'delete_ok', 'topic_id' => $topic_id, 'poll_id' => $poll->getVar('poll_id')), 'polls.php', sprintf(_MD_POLL_RUSUREDEL, $poll->getVar("question"))); - //include XOOPS_ROOT_PATH . "/footer.php"; - //exit(); -} - -if ( $op == "delete_ok" ) { - if ( $pollmodules == 'xoopspoll') - $poll = new XoopsPoll($poll_id); - else - $poll = new Umfrage($poll_id); - if ( $poll->delete() != false ) { - if ( $pollmodules == 'xoopspoll') { - XoopsPollOption::deleteByPollId($poll->getVar("poll_id")); - XoopsPollLog::deleteByPollId($poll->getVar("poll_id")); - } else { - UmfrageOption::deleteByPollId($poll->getVar("poll_id")); - UmfrageLog::deleteByPollId($poll->getVar("poll_id")); - } - include_once XOOPS_ROOT_PATH . '/class/template.php'; - xoops_template_clear_module_cache($xoopsModule->getVar('mid')); - // delete comments for this poll - xoops_comment_delete($xoopsModule->getVar('mid'), $poll->getVar('poll_id')); - $sql = "UPDATE " . $xoopsDB->prefix("bb_topics") . " SET votes = 0, topic_haspoll = 0, poll_id = 0 WHERE topic_id = {$topic_id}"; - if ( !$result = $xoopsDB->query($sql) ) { - //xoops_error($xoopsDB->error()); - } - } - redirect_header("viewtopic.php?topic_id={$topic_id}", 1, _MD_POLL_DBUPDATED); - //exit(); -} - -if ( $op == "restart" ) { - $pollid = intval($_GET['poll_id']); - if ( $pollmodules == 'xoopspoll') - $poll = new XoopsPoll($pollid); - else if ( $pollmodules == 'umfrage') - $poll = new Umfrage($pollid); - $poll_form = new XoopsThemeForm(_MD_POLL_RESTARTPOLL, "poll_form", "polls.php"); - $expire_text = new XoopsFormText(_MD_POLL_EXPIRATION . "<br /><small>" . _MD_POLL_FORMAT . "<br />" . sprintf(_MD_POLL_CURRENTTIME, formatTimestamp(time(), "Y-m-d H:i:s")) . "</small>", "end_time", 20, 19, formatTimestamp(time() + 604800, "Y-m-d H:i:s")); - $poll_form->addElement($expire_text); - $notify_yn = new XoopsFormRadioYN(_MD_POLL_NOTIFY, "notify", 1); - $poll_form->addElement($notify_yn); - $reset_yn = new XoopsFormRadioYN(_MD_POLL_RESET, "reset", 0); - $poll_form->addElement($reset_yn); - $op_hidden = new XoopsFormHidden("op", "restart_ok"); - $poll_form->addElement($op_hidden); - $poll_topic_id_hidden = new XoopsFormHidden("topic_id", $topic_id); - $poll_form->addElement($poll_topic_id_hidden); - $poll_id_hidden = new XoopsFormHidden("poll_id", $poll->getVar("poll_id")); - $poll_form->addElement($poll_id_hidden); - $submit_button = new XoopsFormButton("", "poll_submit", _MD_POLL_RESTART, "submit"); - $poll_form->addElement($submit_button); - //include XOOPS_ROOT_PATH . "/header.php"; - echo "<h4>" . _MD_POLL_POLLCONF . "</h4>"; - $poll_form->display(); - //include XOOPS_ROOT_PATH . "/footer.php"; - //exit(); -} - -if ( $op == "restart_ok" ) { - if ( $pollmodules == 'xoopspoll') - $poll = new XoopsPoll($poll_id); - else - $poll = new Umfrage($poll_id); - $end_time = (empty($_POST['end_time'])) ? "" : $_POST['end_time']; - if ( !empty($end_time) ) { - $timezone = is_object($xoopsUser) ? $xoopsUser->getVar("timezone") : null; - $poll->setVar("end_time", userTimeToServerTime(strtotime($end_time), $timezone)); - } else { - $poll->setVar("end_time", time() + (86400 * 10)); - } - if ( !empty($_POST["notify"]) && $end_time > time() ) { - // if notify, set mail status to "not mailed" - $poll->setVar("mail_status", POLL_NOTMAILED); - } else { - // if not notify, set mail status to already "mailed" - $poll->setVar("mail_status", POLL_MAILED); - } - if ( !empty($_POST["reset"]) ) { - // reset all logs - if ( $pollmodules == 'xoopspoll') { - XoopsPollLog::deleteByPollId($poll->getVar("poll_id")); - XoopsPollOption::resetCountByPollId($poll->getVar("poll_id")); - } else { - UmfrageLog::deleteByPollId($poll->getVar("poll_id")); - UmfrageOption::resetCountByPollId($poll->getVar("poll_id")); - } - } - if (!$poll->store()) { - //xoops_error($poll->getHtmlErrors()); - exit(); - } - $poll->updateCount(); - include_once XOOPS_ROOT_PATH . '/class/template.php'; - xoops_template_clear_module_cache($xoopsModule->getVar('mid')); - redirect_header("viewtopic.php?topic_id={$topic_id}", 1, _MD_POLL_DBUPDATED); - //exit(); -} - -if ( $op == "log" ) { - //include XOOPS_ROOT_PATH . "/header.php"; - echo "<h4>" . _MD_POLL_POLLCONF . "</h4>"; - echo "<br />View Log<br /> Sorry, not yet. ;-)"; - //include XOOPS_ROOT_PATH . "/footer.php"; - //exit(); -} - -include XOOPS_ROOT_PATH . "/footer.php"; +<?php +/** + * Newbb module + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @package newbb + * @since 4.0 + * @author Taiwen Jiang <ph...@us...> + * @version $Id: polls.php 2175 2008-09-23 14:07:03Z phppp $ + */ + + +include_once dirname(__FILE__) . "/header.php"; + +include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php"; +include_once XOOPS_ROOT_PATH . "/class/xoopslists.php"; +include_once XOOPS_ROOT_PATH . "/class/xoopsblock.php"; + +if ( $pollmodules == 'xoopspoll') +{ + include XOOPS_ROOT_PATH . "/modules/xoopspoll/include/constants.php"; + include_once XOOPS_ROOT_PATH . "/modules/xoopspoll/class/xoopspoll.php"; + include_once XOOPS_ROOT_PATH . "/modules/xoopspoll/class/xoopspolloption.php"; + include_once XOOPS_ROOT_PATH . "/modules/xoopspoll/class/xoopspolllog.php"; + include_once XOOPS_ROOT_PATH . "/modules/xoopspoll/class/xoopspollrenderer.php"; +} +elseif ($pollmodules == 'umfrage') +{ + include XOOPS_ROOT_PATH."/modules/umfrage/include/constants.php"; + include_once XOOPS_ROOT_PATH."/modules/umfrage/class/umfrage.php"; + include_once XOOPS_ROOT_PATH."/modules/umfrage/class/umfrageoption.php"; + include_once XOOPS_ROOT_PATH."/modules/umfrage/class/umfragelog.php"; + include_once XOOPS_ROOT_PATH."/modules/umfrage/class/umfragerenderer.php"; +} +else +{ + redirect_header("javascript:history.go(-1);", 2, _MD_POLLMODULE_ERROR); + exit(); +} + +$op = "add"; +if (isset($_GET['op'])) $op = $_GET['op']; +if (isset($_POST['op'])) $op = $_POST['op']; +if (isset($_GET['poll_id'])) $poll_id = intval($_GET['poll_id']); +if (isset($_POST['poll_id'])) $poll_id = intval($_POST['poll_id']); +if (isset($_GET['topic_id'])) $topic_id = intval($_GET['topic_id']); +if (isset($_POST['topic_id'])) $topic_id = intval($_POST['topic_id']); + +if (!isset($module_handler)) $module_handler =& xoops_gethandler('module'); +$xoopspoll =& $module_handler->getByDirname($pollmodules); +if (!is_object($xoopspoll) || !$xoopspoll->getVar('isactive')) { + redirect_header("javascript:history.go(-1);", 2, _MD_POLLMODULE_ERROR); + exit(); +} + +include XOOPS_ROOT_PATH . "/header.php"; + +$topic_handler =& xoops_getmodulehandler('topic', 'newbb'); +$topic_obj =& $topic_handler->get($topic_id); +$forum = $topic_obj->getVar('forum_id'); +$forum_handler =& xoops_getmodulehandler('forum', 'newbb'); +$forum_obj =& $forum_handler->get($forum); +if (!$forum_handler->getPermission($forum_obj)) { + redirect_header("index.php", 2, _MD_NORIGHTTOACCESS); + exit(); +} +if (!$topic_handler->getPermission($forum_obj, $topic_obj->getVar('topic_status'), "view")) { + redirect_header("viewforum.php?forum=" . $forum_obj->getVar('forum_id'), 2, _MD_NORIGHTTOVIEW); + exit(); +} + +$isadmin = newbb_isAdmin($forum_obj); +$perm = false; +if ($isadmin) { + $perm = true; +} elseif ($topic_handler->getPermission($forum_obj, $topic_obj->getVar('topic_status'), "addpoll") + //&& $forum_obj->getVar('allow_polls') == 1 +) { + if ( ($op=="add" || $op=="save") && !$topic_obj->getVar("topic_haspoll") && is_object($xoopsUser) && $xoopsUser->getVar("uid") == $topic_obj->getVar("topic_poster") ) { + $perm = true; + } elseif (!empty($poll_id)) { + $poll = new XoopsPoll($poll_id); + if (is_object($xoopsUser) && $xoopsUser->getVar("uid") == $poll->getVar("user_id")) { + $perm = true; + } + } +} +if (!$perm) { + redirect_header("viewtopic.php?topic_id=" . $topic_id, 2, _NOPERM); +} + +if ( $op == "add" ) { + $poll_form = new XoopsThemeForm(_MD_POLL_CREATNEWPOLL, "poll_form", "polls.php"); + + $question_text = new XoopsFormText(_MD_POLL_POLLQUESTION, "question", 50, 255); + $poll_form->addElement($question_text, true); + + $desc_tarea = new XoopsFormTextarea(_MD_POLL_POLLDESC, "description"); + $poll_form->addElement($desc_tarea); + + $currenttime = formatTimestamp(time(), "Y-m-d H:i:s"); + $endtime = formatTimestamp(time() + 604800, "Y-m-d H:i:s"); + $expire_text = new XoopsFormText(_MD_POLL_EXPIRATION . "<br /><small>" . _MD_POLL_FORMAT . "<br />" . sprintf(_MD_POLL_CURRENTTIME, $currenttime) . "</small>", "end_time", 30, 19, $endtime); + $poll_form->addElement($expire_text); + + $weight_text = new XoopsFormText(_MD_POLL_DISPLAYORDER, "weight", 6, 5, 0); + $poll_form->addElement($weight_text); + + $multi_yn = new XoopsFormRadioYN(_MD_POLL_ALLOWMULTI, "multiple", 0); + $poll_form->addElement($multi_yn); + + $notify_yn = new XoopsFormRadioYN(_MD_POLL_NOTIFY, "notify", 1); + $poll_form->addElement($notify_yn); + + $option_tray = new XoopsFormElementTray(_MD_POLL_POLLOPTIONS, ""); + $barcolor_array = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . "/modules/".$pollmodules."/images/colorbars/"); + for($i = 0; $i < 10; $i++) { + $current_bar = (current($barcolor_array) != "blank.gif") ? current($barcolor_array) : next($barcolor_array); + $option_text = new XoopsFormText("", "option_text[]", 50, 255); + $option_tray->addElement($option_text); + $color_select = new XoopsFormSelect("", "option_color[{$i}]", $current_bar); + $color_select->addOptionArray($barcolor_array); + $color_select->setExtra("onchange='showImgSelected(\"option_color_image[{$i}]\", \"option_color[{$i}]\", \"modules/".$pollmodules."/images/colorbars\", \"\", \"" . XOOPS_URL . "\")'"); + $color_label = new XoopsFormLabel("", "<img src='" . XOOPS_URL . "/modules/".$pollmodules."/images/colorbars/" . $current_bar . "' name='option_color_image[{$i}]' id='option_color_image[{$i}]' width='30' align='bottom' height='15' alt='' /><br />"); + $option_tray->addElement($color_select); + $option_tray->addElement($color_label); + if ( !next($barcolor_array) ) { + reset($barcolor_array); + } + unset($color_select, $color_label); + } + $poll_form->addElement($option_tray); + + $submit_button = new XoopsFormButton("", "poll_submit", _SUBMIT, "submit"); + $poll_form->addElement($submit_button); + $op_hidden = new XoopsFormHidden("op", "save"); + $poll_form->addElement($op_hidden); + $poll_topic_id_hidden = new XoopsFormHidden("topic_id", $topic_id); + $poll_form->addElement($poll_topic_id_hidden); + //include XOOPS_ROOT_PATH . "/header.php"; + echo "<h4>" . _MD_POLL_POLLCONF . "</h4>"; + $poll_form->display(); + //include XOOPS_ROOT_PATH . "/footer.php"; + //exit(); +} + +if ( $op == "save" ) { + /* + * The option check should be done before submitting + */ + $option_empty = true; + if (empty($_POST['option_text'])) { + redirect_header("javascript:history.go(-1);", 2, _MD_ERROROCCURED . ': ' . _MD_POLL_POLLOPTIONS . ' !'); + } + $option_text = $_POST['option_text']; + foreach ( $option_text as $optxt ) { + if ( trim($optxt) != "" ) { + $option_empty = false; + break; + } + } + if ($option_empty) { + redirect_header("javascript:history.go(-1);", 2, _MD_ERROROCCURED . ': ' . _MD_POLL_POLLOPTIONS . ' !'); + } + if ( $pollmodules == 'xoopspoll') + $poll = new XoopsPoll(); + else if ( $pollmodules == 'umfrage') + $poll = new Umfrage(); + else die("POLL-ERROR: polls.php Line 190"); + $poll->setVar("question", @$_POST['question']); + $poll->setVar("description", @$_POST['description']); + if ( !empty($_POST['end_time']) ) { + $timezone = is_object($xoopsUser) ? $xoopsUser->getVar("timezone") : null; +// Start user input time in hegira date - hacked by irmtfan (www.jadoogaran.org) +// $_POST['end_time']=inputTimeToGregorian($_POST['end_time']); + $poll->setVar("end_time", userTimeToServerTime(XoopsLocal::strtotime($_POST['end_time']), $timezone)); +// End user input time in hegira date - hacked by irmtfan (www.jadoogaran.org) + } else { + // if expiration date is not set, set it to 10 days from now + $poll->setVar("end_time", time() + (86400 * 10)); + } + $poll->setVar("display", 0); + $poll->setVar("weight", intval(@$_POST['weight'])); + $poll->setVar("multiple", intval(@$_POST['multiple'])); + if ( !empty($_POST["notify"]) ) { + // if notify, set mail status to "not mailed" + $poll->setVar("mail_status", POLL_NOTMAILED); + } else { + // if not notify, set mail status to already "mailed" + $poll->setVar("mail_status", POLL_MAILED); + } + $uid = is_object($xoopsUser) ? $xoopsUser->getVar("uid") : 0; + $poll->setVar("user_id", $uid); + $new_poll_id = $poll->store(); + $option_color = empty($_POST['option_color']) ? NULL : $_POST['option_color']; + if ( !empty($new_poll_id) ) { + $i = 0; + foreach ( $option_text as $optxt ) { + $optxt = trim($optxt); + if ( $optxt != "" ) { + if ( $pollmodules == 'xoopspoll') + $option = new XoopsPollOption(); + else if ( $pollmodules == 'umfrage') + $option = new UmfrageOption(); + else die("POLL-ERROR: polls.php Line 223"); + $option->setVar("option_text", $optxt); + $option->setVar("option_color", $option_color[$i]); + $option->setVar("poll_id", $new_poll_id); + $option->store(); + } + $i++; + } + $sql = "UPDATE " . $xoopsDB->prefix("bb_topics") . " SET topic_haspoll = 1, poll_id = {$new_poll_id} WHERE topic_id = {$topic_id}"; + if ( !$result = $xoopsDB->query($sql) ) { + xoops_error($xoopsDB->error()); + } + include_once XOOPS_ROOT_PATH . '/class/template.php'; + xoops_template_clear_module_cache($xoopsModule->getVar('mid')); + } else { + xoops_error($poll->getHtmlErrors()); + exit(); + } + redirect_header("viewtopic.php?topic_id={$topic_id}",1,_MD_POLL_DBUPDATED); + //exit(); +} + +if ( $op == "edit" ) { + $pollid = intval($_GET['poll_id']); + if ( $pollmodules == 'xoopspoll') + $poll = new XoopsPoll($pollid); + else if ( $pollmodules == 'umfrage') + $poll = new Umfrage($pollid); + $poll_form = new XoopsThemeForm(_MD_POLL_EDITPOLL, "poll_form", "polls.php"); + $author_label = new XoopsFormLabel(_MD_POLL_AUTHOR, "<a href='" . XOOPS_URL . "/userinfo.php?uid=" . $poll->getVar("user_id") . "'>" . newbb_getUnameFromId($poll->getVar("user_id"), $xoopsModuleConfig['show_realname']) . "</a>"); + $poll_form->addElement($author_label); + $question_text = new XoopsFormText(_MD_POLL_POLLQUESTION, "question", 50, 255, $poll->getVar("question", "E")); + $poll_form->addElement($question_text); + $desc_tarea = new XoopsFormTextarea(_MD_POLL_POLLDESC, "description", $poll->getVar("description", "E")); + $poll_form->addElement($desc_tarea); + $date = formatTimestamp($poll->getVar("end_time"), "Y-m-d H:i:s"); + if ( !$poll->hasExpired() ) { + $expire_text = new XoopsFormText(_MD_POLL_EXPIRATION . "<br /><small>" . _MD_POLL_FORMAT . "<br />" . sprintf(_MD_POLL_CURRENTTIME, formatTimestamp(time(), "Y-m-d H:i:s")) . "</small>", "end_time", 20, 19, $date); + $poll_form->addElement($expire_text); + } else { + $restart_label = new XoopsFormLabel(_MD_POLL_EXPIRATION, sprintf(_MD_POLL_EXPIREDAT, $date) . "<br /><a href='polls.php?op=restart&poll_id=" . $poll->getVar("poll_id") . "'>" . _MD_POLL_RESTART . "</a>"); + $poll_form->addElement($restart_label); + } + $weight_text = new XoopsFormText(_MD_POLL_DISPLAYORDER, "weight", 6, 5, $poll->getVar("weight")); + $poll_form->addElement($weight_text); + $multi_yn = new XoopsFormRadioYN(_MD_POLL_ALLOWMULTI, "multiple", $poll->getVar("multiple")); + $poll_form->addElement($multi_yn); + if ( $pollmodules == 'xoopspoll') + $options_arr = XoopsPollOption::getAllByPollId($poll->getVar("poll_id")); + else + $options_arr =& UmfrageOption::getAllByPollId($poll->getVar("poll_id")); + $notify_value = 1; + if ( $poll->getVar("mail_status") != 0 ) { + $notify_value = 0; + } + $notify_yn = new XoopsFormRadioYN(_MD_POLL_NOTIFY, "notify", $notify_value); + $poll_form->addElement($notify_yn); + $option_tray = new XoopsFormElementTray(_MD_POLL_POLLOPTIONS, ""); + $barcolor_array = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . "/modules/".$pollmodules."/images/colorbars/"); + $i = 0; + foreach ($options_arr as $option) { + $option_text = new XoopsFormText("", "option_text[]", 50, 255, $option->getVar("option_text")); + $option_tray->addElement($option_text); + $option_id_hidden = new XoopsFormHidden("option_id[]", $option->getVar("option_id")); + $option_tray->addElement($option_id_hidden); + $color_select = new XoopsFormSelect("", "option_color[{$i}]", $option->getVar("option_color")); + $color_select->addOptionArray($barcolor_array); + $color_select->setExtra("onchange='showImgSelected(\"option_color_image[{$i}]\", \"option_color[".$i."]\", \"modules/".$pollmodules."/images/colorbars\", \"\", \"" . XOOPS_URL . "\")'"); + $color_label = new XoopsFormLabel("", "<img src='" . XOOPS_URL . "/modules/".$pollmodules."/images/colorbars/" . $option->getVar("option_color", "E") . "' name='option_color_image[{$i}]' id='option_color_image[{$i}]' width='30' align='bottom' height='15' alt='' /><br />"); + $option_tray->addElement($color_select); + $option_tray->addElement($color_label); + unset($color_select, $color_label, $option_id_hidden, $option_text); + $i++; + } + $more_label = new XoopsFormLabel("", "<br /><a href='polls.php?op=addmore&poll_id=" . $poll->getVar("poll_id") . "&topic_id=" . $topic_id . "'>" . _MD_POLL_ADDMORE . "</a>"); + $option_tray->addElement($more_label); + $poll_form->addElement($option_tray); + $op_hidden = new XoopsFormHidden("op", "update"); + $poll_form->addElement($op_hidden); + $poll_topic_id_hidden = new XoopsFormHidden("topic_id", $topic_id); + $poll_form->addElement($poll_topic_id_hidden); + $poll_id_hidden = new XoopsFormHidden("poll_id", $poll->getVar("poll_id")); + $poll_form->addElement($poll_id_hidden); + $submit_button = new XoopsFormButton("", "poll_submit", _SUBMIT, "submit"); + $poll_form->addElement($submit_button); + //include XOOPS_ROOT_PATH . "/header.php"; + echo "<h4>" . _MD_POLL_POLLCONF . "</h4>"; + $poll_form->display(); + //include XOOPS_ROOT_PATH . "/footer.php"; + //exit(); +} + +if ( $op == "update" ) { + $option_empty = true; + if (empty($_POST['option_text'])) { + redirect_header("javascript:history.go(-1);", 2, _MD_ERROROCCURED . ': ' . _MD_POLL_POLLOPTIONS . ' !'); + } + $option_text = $_POST['option_text']; + foreach ( $option_text as $optxt ) { + if ( trim($optxt) != "" ) { + $option_empty = false; + break; + } + } + if ($option_empty) redirect_header("javascript:history.go(-1);", 2, _MD_ERROROCCURED . ': ' . _MD_POLL_POLLOPTIONS . ' !'); + + if ( $pollmodules == 'xoopspoll') + $poll = new XoopsPoll($poll_id); + else + $poll = new Umfrage($poll_id); + $poll->setVar("question", @$_POST['question']); + $poll->setVar("description", @$_POST['description']); + $end_time = (empty($_POST['end_time'])) ? "" : $_POST['end_time']; + if ( !empty($end_time) ) { + $timezone = is_object($xoopsUser) ? $xoopsUser->getVar("timezone") : null; +// Start user input time in hegira date - hacked by irmtfan (www.jadoogaran.org) +// $end_time=inputTimeToGregorian($end_time); + $poll->setVar("end_time", userTimeToServerTime(XoopsLocal::strtotime($end_time), $timezone)); +// End user input time in hegira date - hacked by irmtfan (www.jadoogaran.org) + + } + $poll->setVar("display", 0); + $poll->setVar("weight", intval(@$_POST['weight'])); + $poll->setVar("multiple", intval(@$_POST['multiple'])); + if ( !empty($_POST["notify"]) && $end_time > time() ) { + // if notify, set mail status to "not mailed" + $poll->setVar("mail_status", POLL_NOTMAILED); + } else { + // if not notify, set mail status to already "mailed" + $poll->setVar("mail_status", POLL_MAILED); + } + if ( !$poll->store() ) { + exit(); + } + $i = 0; + $option_id = (empty($_POST['option_id'])) ? NULL : $_POST['option_id']; + $option_color = (empty($_POST['option_color'])) ? NULL : $_POST['option_color']; + foreach ( $option_id as $opid ) { + if ( $pollmodules == 'xoopspoll') { + $option = new XoopsPollOption($opid); + $option_text[$i] = trim ($option_text[$i]); + if ( $option_text[$i] != "" ) { + $option->setVar("option_text", $option_text[$i]); + $option->setVar("option_color", $option_color[$i]); + $option->store(); + } else { + if ( $option->delete() != false ) { + XoopsPollLog::deleteByOptionId($option->getVar("option_id")); + } + } + } else { + $option = new UmfrageOption($opid); + $option_text[$i] = trim ($option_text[$i]); + if ( $option_text[$i] != "" ) { + $option->setVar("option_text", $option_text[$i]); + $option->setVar("option_color", $option_color[$i]); + $option->store(); + } else { + if ( $option->delete() != false ) { + UmfrageLog::deleteByOptionId($option->getVar("option_id")); + } + } + } + $i++; + } + $poll->updateCount(); + include_once XOOPS_ROOT_PATH . '/class/template.php'; + xoops_template_clear_module_cache($xoopsModule->getVar('mid')); + redirect_header("viewtopic.php?topic_id={$topic_id}", 1, _MD_POLL_DBUPDATED); + //exit(); +} + +if ( $op == "addmore" ) { + $pollid = intval($_GET['poll_id']); + if ( $pollmodules == 'xoopspoll') + $poll = new XoopsPoll($pollid); + else if ( $pollmodules == 'umfrage') + $poll = new Umfrage($pollid); + $poll_form = new XoopsThemeForm(_MD_POLL_ADDMORE, "poll_form", "polls.php"); + $question_label = new XoopsFormLabel(_MD_POLL_POLLQUESTION, $poll->getVar("question")); + $poll_form->addElement($question_label); + $option_tray = new XoopsFormElementTray(_MD_POLL_POLLOPTIONS, ""); + $barcolor_array = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . "/modules/".$pollmodules."/images/colorbars/"); + for($i = 0; $i < 10; $i++) { + $current_bar = (current($barcol... [truncated message content] |
From: <ir...@us...> - 2012-08-04 10:33:57
|
Revision: 9984 http://xoops.svn.sourceforge.net/xoops/?rev=9984&view=rev Author: irmtfan Date: 2012-08-04 10:33:49 +0000 (Sat, 04 Aug 2012) Log Message: ----------- bug fix in polls.php templates hardcore removed Modified Paths: -------------- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev9883.txt XoopsModules/newbb/branches/irmtfan/newbb/polls.php XoopsModules/newbb/branches/irmtfan/newbb/templates/blocks/newbb_block.html XoopsModules/newbb/branches/irmtfan/newbb/templates/blocks/newbb_block_author.html XoopsModules/newbb/branches/irmtfan/newbb/templates/blocks/newbb_block_post.html XoopsModules/newbb/branches/irmtfan/newbb/templates/blocks/newbb_block_text.html XoopsModules/newbb/branches/irmtfan/newbb/templates/blocks/newbb_block_topic.html XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_edit_post.html XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_poll_results.html XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_poll_view.html XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_search.html XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_searchresults.html XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewforum_subforum.html Added Paths: ----------- XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/english/style.css XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/style.css Removed Paths: ------------- XoopsModules/newbb/branches/irmtfan/newbb/templates/style.css Modified: XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev9883.txt =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev9883.txt 2012-08-03 23:18:02 UTC (rev 9983) +++ XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev9883.txt 2012-08-04 10:33:49 UTC (rev 9984) @@ -1,4 +1,11 @@ Changelog from rev.9883 +date: 2012-08-04 +================================================ +1- bug fixed: error in newbb/polls.php when the strtotime is not defined in XoopsLocal class (irmtfan) +solution: replace XoopsLocal::strtotime($end_time) by method_exists('XoopsLocal', 'strtotime') ? XoopsLocal::strtotime($end_time) : strtotime($end_time) +in newbb/polls.php +2- more hardcodes in newbb/templates has been removed + date: 2012-08-01 ================================================ 1- localization: input date localized (for other date systems like hegira) by replacing strtotime by XoopsLocal::strtotime Modified: XoopsModules/newbb/branches/irmtfan/newbb/polls.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/polls.php 2012-08-03 23:18:02 UTC (rev 9983) +++ XoopsModules/newbb/branches/irmtfan/newbb/polls.php 2012-08-04 10:33:49 UTC (rev 9984) @@ -181,7 +181,8 @@ $timezone = is_object($xoopsUser) ? $xoopsUser->getVar("timezone") : null; // Start user input time in hegira date - hacked by irmtfan (www.jadoogaran.org) // $_POST['end_time']=inputTimeToGregorian($_POST['end_time']); - $poll->setVar("end_time", userTimeToServerTime(XoopsLocal::strtotime($_POST['end_time']), $timezone)); +// if method is not exist use the original strtotime function + $poll->setVar("end_time", userTimeToServerTime(method_exists('XoopsLocal', 'strtotime') ? XoopsLocal::strtotime($_POST['end_time']) : strtotime($_POST['end_time']), $timezone)); // End user input time in hegira date - hacked by irmtfan (www.jadoogaran.org) } else { // if expiration date is not set, set it to 10 days from now @@ -327,7 +328,8 @@ $timezone = is_object($xoopsUser) ? $xoopsUser->getVar("timezone") : null; // Start user input time in hegira date - hacked by irmtfan (www.jadoogaran.org) // $end_time=inputTimeToGregorian($end_time); - $poll->setVar("end_time", userTimeToServerTime(XoopsLocal::strtotime($end_time), $timezone)); +// if method is not exist use the original strtotime function + $poll->setVar("end_time", userTimeToServerTime(method_exists('XoopsLocal', 'strtotime') ? XoopsLocal::strtotime($end_time) : strtotime($end_time), $timezone)); // End user input time in hegira date - hacked by irmtfan (www.jadoogaran.org) } @@ -535,7 +537,8 @@ $timezone = is_object($xoopsUser) ? $xoopsUser->getVar("timezone") : null; // Start user input time in hegira date - hacked by irmtfan (www.jadoogaran.org) // $end_time=inputTimeToGregorian($end_time); - $poll->setVar("end_time", userTimeToServerTime(XoopsLocal::strtotime($end_time), $timezone)); +// if method is not exist use the original strtotime function + $poll->setVar("end_time", userTimeToServerTime(method_exists('XoopsLocal', 'strtotime') ? XoopsLocal::strtotime($end_time) : strtotime($end_time), $timezone)); // End user input time in hegira date - hacked by irmtfan (www.jadoogaran.org) } else { $poll->setVar("end_time", time() + (86400 * 10)); Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/blocks/newbb_block.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/blocks/newbb_block.html 2012-08-03 23:18:02 UTC (rev 9983) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/blocks/newbb_block.html 2012-08-04 10:33:49 UTC (rev 9984) @@ -1,55 +1,58 @@ -<table class="outer" cellspacing="1"> - <{if $block.disp_mode == 0}> - <tr> - <th class="head" nowrap="nowrap"><{$smarty.const._MB_NEWBB_FORUM}></th> - <th class="head" nowrap="nowrap"><{$smarty.const._MB_NEWBB_TOPIC}></th> - <th class="head" align="center" nowrap="nowrap"><{$smarty.const._MB_NEWBB_RPLS}></th> - <th class="head" align="center" nowrap="nowrap"><{$smarty.const._MB_NEWBB_VIEWS}></th> - <th class="head" align="center" nowrap="nowrap"><{$smarty.const._MB_NEWBB_LPOST}></th> - </tr> - - <{foreachq item=topic from=$block.topics}> - <tr class="<{cycle values="even,odd"}>"> - <td><{$topic.seo_forum_url}></td> - <td><{$topic.seo_url}></td> - <td align="center"><{$topic.replies}></td> - <td align="center"><{$topic.views}></td> - <td align="right"><{$topic.time}><br /><{$topic.topic_poster}></td> - </tr> - <{/foreach}> - - <{elseif $block.disp_mode == 1}> - - <tr> - <th class="head" nowrap="nowrap"><{$smarty.const._MB_NEWBB_TOPIC}></th> - <th class="head" align="center" nowrap="nowrap"><{$smarty.const._MB_NEWBB_RPLS}></th> - <th class="head" align="center" nowrap="nowrap"><{$smarty.const._MB_NEWBB_LPOST}></th> - </tr> - - <{foreachq item=topic from=$block.topics}> - <tr class="<{cycle values="even,odd"}>"> - <td><{$topic.seo_url}></td> - <td align="center"><{$topic.replies}></td> - <td align="right"><{$topic.time}><br /><{$topic.topic_poster}></td> - </tr> - <{/foreach}> - - <{elseif $block.disp_mode == 2}> - - <{foreachq item=topic from=$block.topics}> - <tr class="<{cycle values="even,odd"}>"> - <td><{$topic.seo_url}></td> - </tr> - <{/foreach}> - - <{/if}> - -</table> - -<{if $block.indexNav}> - <div style="text-align:right; padding: 5px;"> - <{$block.seo_top_allposts}> | - <{$block.seo_top_alltopics}> | - <{$block.seo_top_allforums}> - </div> +<table class="outer" cellspacing="1"> + <{if $block.disp_mode == 0}> + <tr> + <th class="head" nowrap="nowrap"><{$smarty.const._MB_NEWBB_FORUM}></th> + <th class="head" nowrap="nowrap"><{$smarty.const._MB_NEWBB_TOPIC}></th> + <th class="head" align="center" nowrap="nowrap"><{$smarty.const._MB_NEWBB_RPLS}></th> + <th class="head" align="center" nowrap="nowrap"><{$smarty.const._MB_NEWBB_VIEWS}></th> + <th class="head" align="center" nowrap="nowrap"><{$smarty.const._MB_NEWBB_LPOST}></th> + </tr> + + <{foreachq item=topic from=$block.topics}> + <tr class="<{cycle values="even,odd"}>"> + <td><{$topic.seo_forum_url}></td> + <td><{$topic.seo_url}></td> + <td align="center"><{$topic.replies}></td> + <td align="center"><{$topic.views}></td> +<!-- irmtfan hardcode removed align="right" --> + <td class="align_right"><{$topic.time}><br /><{$topic.topic_poster}></td> + </tr> + <{/foreach}> + + <{elseif $block.disp_mode == 1}> + + <tr> + <th class="head" nowrap="nowrap"><{$smarty.const._MB_NEWBB_TOPIC}></th> + <th class="head" align="center" nowrap="nowrap"><{$smarty.const._MB_NEWBB_RPLS}></th> + <th class="head" align="center" nowrap="nowrap"><{$smarty.const._MB_NEWBB_LPOST}></th> + </tr> + + <{foreachq item=topic from=$block.topics}> + <tr class="<{cycle values="even,odd"}>"> + <td><{$topic.seo_url}></td> + <td align="center"><{$topic.replies}></td> +<!-- irmtfan hardcode removed align="right" --> + <td class="align_right"><{$topic.time}><br /><{$topic.topic_poster}></td> + </tr> + <{/foreach}> + + <{elseif $block.disp_mode == 2}> + + <{foreachq item=topic from=$block.topics}> + <tr class="<{cycle values="even,odd"}>"> + <td><{$topic.seo_url}></td> + </tr> + <{/foreach}> + + <{/if}> + +</table> + +<{if $block.indexNav}> +<!-- irmtfan hardcode removed style="text-align:right; padding: 5px;" --> + <div class="pagenav"> + <{$block.seo_top_allposts}> | + <{$block.seo_top_alltopics}> | + <{$block.seo_top_allforums}> + </div> <{/if}> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/blocks/newbb_block_author.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/blocks/newbb_block_author.html 2012-08-03 23:18:02 UTC (rev 9983) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/blocks/newbb_block_author.html 2012-08-04 10:33:49 UTC (rev 9984) @@ -1,31 +1,32 @@ -<table class="outer" cellspacing="1"> - - <{if $block.disp_mode == 0}> - <tr> - <th class="head" nowrap="nowrap"><{$smarty.const._MB_NEWBB_AUTHOR}></th> - <th class="head" align="center" nowrap="nowrap"><{$smarty.const._MB_NEWBB_COUNT}></th> - </tr> - - <{foreachq item=author key=uid from=$block.authors}> - <tr class="<{cycle values="even,odd"}>"> - <td><a href="<{$xoops_url}>/userinfo.php?uid=<{$uid}>"><{$author.name}></a></td> - <td align="center"><{$author.count}></td> - </tr> - <{/foreach}> - - <{elseif $block.disp_mode == 1}> - - <{foreachq item=author key=uid from=$block.authors}> - <tr class="<{cycle values="even,odd"}>"> - <td><a href="<{$xoops_url}>/userinfo.php?uid=<{$uid}>"><{$author.name}></a> <{$author.count}></td> - </tr> - <{/foreach}> - - <{/if}> - -</table> -<{if $block.indexNav}> -<div style="text-align:right; padding: 5px;"> -<a href="<{$xoops_url}>/modules/newbb/"><{$smarty.const._MB_NEWBB_VSTFRMS}></a> -</div> +<table class="outer" cellspacing="1"> + + <{if $block.disp_mode == 0}> + <tr> + <th class="head" nowrap="nowrap"><{$smarty.const._MB_NEWBB_AUTHOR}></th> + <th class="head" align="center" nowrap="nowrap"><{$smarty.const._MB_NEWBB_COUNT}></th> + </tr> + + <{foreachq item=author key=uid from=$block.authors}> + <tr class="<{cycle values="even,odd"}>"> + <td><a href="<{$xoops_url}>/userinfo.php?uid=<{$uid}>"><{$author.name}></a></td> + <td align="center"><{$author.count}></td> + </tr> + <{/foreach}> + + <{elseif $block.disp_mode == 1}> + + <{foreachq item=author key=uid from=$block.authors}> + <tr class="<{cycle values="even,odd"}>"> + <td><a href="<{$xoops_url}>/userinfo.php?uid=<{$uid}>"><{$author.name}></a> <{$author.count}></td> + </tr> + <{/foreach}> + + <{/if}> + +</table> +<{if $block.indexNav}> +<!-- irmtfan hardcode removed style="text-align:right; padding: 5px;" --> +<div class="pagenav"> +<a href="<{$xoops_url}>/modules/newbb/"><{$smarty.const._MB_NEWBB_VSTFRMS}></a> +</div> <{/if}> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/blocks/newbb_block_post.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/blocks/newbb_block_post.html 2012-08-03 23:18:02 UTC (rev 9983) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/blocks/newbb_block_post.html 2012-08-04 10:33:49 UTC (rev 9984) @@ -1,61 +1,64 @@ -<table class="outer" cellspacing="1"> -<{if $block.disp_mode == 0}> - <tr> - <th class="head" nowrap="nowrap"><{$smarty.const._MB_NEWBB_FORUM}></th> - <th class="head" nowrap="nowrap"><{$smarty.const._MB_NEWBB_TITLE}></th> - <th class="head" align="center" nowrap="nowrap"><{$smarty.const._MB_NEWBB_AUTHOR}></th> - </tr> - - <{foreachq item=topic from=$block.topics}> - <tr class="<{cycle values="even,odd"}>"> - <td><{$topic.seo_forum_url}></td> - <td><{$topic.seo_url}></td> - <td align="right"><{$topic.time}><br /><{$topic.topic_poster}></td> - </tr> - <{/foreach}> - - <{elseif $block.disp_mode == 1}> - - <tr> - <th class="head" nowrap="nowrap"><{$smarty.const._MB_NEWBB_TOPIC}></th> - <th class="head" align="center" nowrap="nowrap"><{$smarty.const._MB_NEWBB_AUTHOR}></th> - </tr> - - <{foreachq item=topic from=$block.topics}> - <tr class="<{cycle values="even,odd"}>"> - <td><{$topic.seo_url}></td> - <td align="right"><{$topic.time}><br /><{$topic.topic_poster}></td> - </tr> - <{/foreach}> - - <{elseif $block.disp_mode == 2}> - - <{foreachq item=topic from=$block.topics}> - <tr class="<{cycle values="even,odd"}>"> - <td><{$topic.seo_url}></td> - </tr> - <{/foreach}> - -<{else}> - <tr> - <td> - <{foreachq item=topic from=$block.topics}> - <div><strong><a href="<{$xoops_url}>/modules/newbb/viewtopic.php?forum=<{$topic.forum_id}>&post_id=<{$topic.post_id}>#forumpost<{$topic.post_id}>"><{$topic.title}></a></strong></div> - <div> - <a href="<{$xoops_url}>/modules/newbb/viewforum.php?forum=<{$topic.forum_id}>"><{$topic.forum_name}></a> | - <{$topic.topic_poster}> | <{$topic.time}> - </div> - <div style="padding: 5px 0px 10px 0px;"><{$topic.post_text}></div> - <{/foreach}> - </td> - </tr> - <{/if}> - -</table> - -<{if $block.indexNav}> - <div style="text-align:right; padding: 5px;"> - <{$block.seo_top_allposts}> | - <{$block.seo_top_allforums}> - </div> +<table class="outer" cellspacing="1"> +<{if $block.disp_mode == 0}> + <tr> + <th class="head" nowrap="nowrap"><{$smarty.const._MB_NEWBB_FORUM}></th> + <th class="head" nowrap="nowrap"><{$smarty.const._MB_NEWBB_TITLE}></th> + <th class="head" align="center" nowrap="nowrap"><{$smarty.const._MB_NEWBB_AUTHOR}></th> + </tr> + + <{foreachq item=topic from=$block.topics}> + <tr class="<{cycle values="even,odd"}>"> + <td><{$topic.seo_forum_url}></td> + <td><{$topic.seo_url}></td> +<!-- irmtfan hardcode removed align="right" --> + <td class="align_right"><{$topic.time}><br /><{$topic.topic_poster}></td> + </tr> + <{/foreach}> + + <{elseif $block.disp_mode == 1}> + + <tr> + <th class="head" nowrap="nowrap"><{$smarty.const._MB_NEWBB_TOPIC}></th> + <th class="head" align="center" nowrap="nowrap"><{$smarty.const._MB_NEWBB_AUTHOR}></th> + </tr> + + <{foreachq item=topic from=$block.topics}> + <tr class="<{cycle values="even,odd"}>"> + <td><{$topic.seo_url}></td> +<!-- irmtfan hardcode removed align="right" --> + <td class="align_right"><{$topic.time}><br /><{$topic.topic_poster}></td> + </tr> + <{/foreach}> + + <{elseif $block.disp_mode == 2}> + + <{foreachq item=topic from=$block.topics}> + <tr class="<{cycle values="even,odd"}>"> + <td><{$topic.seo_url}></td> + </tr> + <{/foreach}> + +<{else}> + <tr> + <td> + <{foreachq item=topic from=$block.topics}> + <div><strong><a href="<{$xoops_url}>/modules/newbb/viewtopic.php?forum=<{$topic.forum_id}>&post_id=<{$topic.post_id}>#forumpost<{$topic.post_id}>"><{$topic.title}></a></strong></div> + <div> + <a href="<{$xoops_url}>/modules/newbb/viewforum.php?forum=<{$topic.forum_id}>"><{$topic.forum_name}></a> | + <{$topic.topic_poster}> | <{$topic.time}> + </div> + <div style="padding: 5px 0px 10px 0px;"><{$topic.post_text}></div> + <{/foreach}> + </td> + </tr> + <{/if}> + +</table> + +<{if $block.indexNav}> +<!-- irmtfan hardcode removed style="text-align:right; padding: 5px;" --> + <div class="pagenav"> + <{$block.seo_top_allposts}> | + <{$block.seo_top_allforums}> + </div> <{/if}> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/blocks/newbb_block_text.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/blocks/newbb_block_text.html 2012-08-03 23:18:02 UTC (rev 9983) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/blocks/newbb_block_text.html 2012-08-04 10:33:49 UTC (rev 9984) @@ -1,15 +1,16 @@ -<{foreachq item=topic from=$block.topics}> -<div><strong><a href="<{$xoops_url}>/modules/newbb/viewtopic.php?forum=<{$topic.forum_id}>&post_id=<{$topic.post_id}>#forumpost<{$topic.post_id}>"><{$topic.title}></a></strong></div> -<div> -<a href="<{$xoops_url}>/modules/newbb/viewforum.php?forum=<{$topic.forum_id}>"><{$topic.forum_name}></a> -<{$topic.topic_poster}> <{$topic.time}> -</div> -<div style="padding: 5px 0px 10px 0px;"><{$topic.post_text}></div> -<{/foreach}> - -<{if $block.indexNav}> -<div style="text-align:right; padding: 5px;"> -<a href="<{$xoops_url}>/modules/newbb/viewpost.php"><{$smarty.const._MB_NEWBB_ALLPOSTS}></a> | -<a href="<{$xoops_url}>/modules/newbb/"><{$smarty.const._MB_NEWBB_VSTFRMS}></a> -</div> +<{foreachq item=topic from=$block.topics}> +<div><strong><a href="<{$xoops_url}>/modules/newbb/viewtopic.php?forum=<{$topic.forum_id}>&post_id=<{$topic.post_id}>#forumpost<{$topic.post_id}>"><{$topic.title}></a></strong></div> +<div> +<a href="<{$xoops_url}>/modules/newbb/viewforum.php?forum=<{$topic.forum_id}>"><{$topic.forum_name}></a> +<{$topic.topic_poster}> <{$topic.time}> +</div> +<div style="padding: 5px 0px 10px 0px;"><{$topic.post_text}></div> +<{/foreach}> + +<{if $block.indexNav}> +<!-- irmtfan hardcode removed style="text-align:right; padding: 5px;" --> +<div class="pagenav"> +<a href="<{$xoops_url}>/modules/newbb/viewpost.php"><{$smarty.const._MB_NEWBB_ALLPOSTS}></a> | +<a href="<{$xoops_url}>/modules/newbb/"><{$smarty.const._MB_NEWBB_VSTFRMS}></a> +</div> <{/if}> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/blocks/newbb_block_topic.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/blocks/newbb_block_topic.html 2012-08-03 23:18:02 UTC (rev 9983) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/blocks/newbb_block_topic.html 2012-08-04 10:33:49 UTC (rev 9984) @@ -1,53 +1,56 @@ -<table class="outer" cellspacing="1"> - - <{if $block.disp_mode == 0}> - <tr> - <th class="head" nowrap="nowrap"><{$smarty.const._MB_NEWBB_FORUM}></th> - <th class="head" nowrap="nowrap"><{$smarty.const._MB_NEWBB_TITLE}></th> - <th class="head" align="center" nowrap="nowrap"><{$smarty.const._MB_NEWBB_RPLS}></th> - <th class="head" align="center" nowrap="nowrap"><{$smarty.const._MB_NEWBB_VIEWS}></th> - <th class="head" align="center" nowrap="nowrap"><{$smarty.const._MB_NEWBB_AUTHOR}></th> - </tr> - - <{foreachq item=topic from=$block.topics}> - <tr class="<{cycle values="even,odd"}>"> - <td><{$topic.seo_forum_url}></td> - <td><{$topic.seo_url}></td> - <td align="center"><{$topic.replies}></td> - <td align="center"><{$topic.views}></td> - <td align="right"><{$topic.time}><br /><{$topic.topic_poster}></td> - </tr> - <{/foreach}> - - <{elseif $block.disp_mode == 1}> - - <tr> - <th class="head" nowrap="nowrap"><{$smarty.const._MB_NEWBB_TOPIC}></th> - <th class="head" align="center" nowrap="nowrap"><{$smarty.const._MB_NEWBB_AUTHOR}></th> - </tr> - - <{foreachq item=topic from=$block.topics}> - <tr class="<{cycle values="even,odd"}>"> - <td><{$topic.seo_url}></td> - <td align="right"><{$topic.time}><br /><{$topic.topic_poster}></td> - </tr> - <{/foreach}> - - <{elseif $block.disp_mode == 2}> - - <{foreachq item=topic from=$block.topics}> - <tr class="<{cycle values="even,odd"}>"> - <td><{$topic.seo_url}></td> - </tr> - <{/foreach}> - - <{/if}> - -</table> - -<{if $block.indexNav}> - <div style="text-align:right; padding: 5px;"> - <{$block.seo_top_allposts}> | - <{$block.seo_top_allforums}> - </div> +<table class="outer" cellspacing="1"> + + <{if $block.disp_mode == 0}> + <tr> + <th class="head" nowrap="nowrap"><{$smarty.const._MB_NEWBB_FORUM}></th> + <th class="head" nowrap="nowrap"><{$smarty.const._MB_NEWBB_TITLE}></th> + <th class="head" align="center" nowrap="nowrap"><{$smarty.const._MB_NEWBB_RPLS}></th> + <th class="head" align="center" nowrap="nowrap"><{$smarty.const._MB_NEWBB_VIEWS}></th> + <th class="head" align="center" nowrap="nowrap"><{$smarty.const._MB_NEWBB_AUTHOR}></th> + </tr> + + <{foreachq item=topic from=$block.topics}> + <tr class="<{cycle values="even,odd"}>"> + <td><{$topic.seo_forum_url}></td> + <td><{$topic.seo_url}></td> + <td align="center"><{$topic.replies}></td> + <td align="center"><{$topic.views}></td> +<!-- irmtfan hardcode removed align="right" --> + <td class="align_right"><{$topic.time}><br /><{$topic.topic_poster}></td> + </tr> + <{/foreach}> + + <{elseif $block.disp_mode == 1}> + + <tr> + <th class="head" nowrap="nowrap"><{$smarty.const._MB_NEWBB_TOPIC}></th> + <th class="head" align="center" nowrap="nowrap"><{$smarty.const._MB_NEWBB_AUTHOR}></th> + </tr> + + <{foreachq item=topic from=$block.topics}> + <tr class="<{cycle values="even,odd"}>"> + <td><{$topic.seo_url}></td> +<!-- irmtfan hardcode removed align="right" --> + <td class="align_right"><{$topic.time}><br /><{$topic.topic_poster}></td> + </tr> + <{/foreach}> + + <{elseif $block.disp_mode == 2}> + + <{foreachq item=topic from=$block.topics}> + <tr class="<{cycle values="even,odd"}>"> + <td><{$topic.seo_url}></td> + </tr> + <{/foreach}> + + <{/if}> + +</table> + +<{if $block.indexNav}> +<!-- irmtfan hardcode removed style="text-align:right; padding: 5px;" --> + <div class="pagenav"> + <{$block.seo_top_allposts}> | + <{$block.seo_top_allforums}> + </div> <{/if}> \ No newline at end of file Added: XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/english/style.css =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/english/style.css (rev 0) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/english/style.css 2012-08-04 10:33:49 UTC (rev 9984) @@ -0,0 +1,316 @@ +/* -- style.css -- */ +.forum_header { + float : center; + overflow : hidden; + border : 1px solid #aaaaaa; + width : 100%; +} + +.forum_title { + float : left; + text-align : left; + padding : 5px; + width : 100%; + +} + +.forum_title a { + font-weight: bold; +} + + +.forum_stats { + float:center; + overflow:hidden; + text-align:left; + /* border:1px solid #aaaaaa; */ + padding:5px; +} + +.forum_stats_left { + float: left; + text-align: left; + width:45%; +} + +.forum_stats_right { + float: right; + text-align: right; + width:45%; +} + +.forum_body { + margin-top: -10px; + padding-top: 20px; + float:center; + width:99%; + overflow:hidden; +} + +.forum_footer { + float:center; + width:99%; + overflow:hidden; +} + +.index_category{ + border: 0px; + /*margin-top: -10px; + margin-bottom: 5px;*/ +} + +.ThreadUserName a { + font-weight: bold; + margin-bottom: 2px; + /*color: #000; irmtfan */ +} + +.ThreadTitle, .ThreadTitle a{ + font-weight: bold; + margin-bottom: 2px; + /*color: #fff; irmtfan */ +} + +.icon_left { + float: left; text-align: left; +} + +.icon_right { + float: right; text-align: right; +} + +div.karma +{ + background-color: transparent; + text-align: left; + border-top: 1px solid #DDDDFF; + border-left: 1px solid #DDDDFF; + border-right: 1px solid #AAAAAA; + border-bottom: 1px solid #AAAAAA; + padding: 10px; +} + +span.digest +{ +} + +span.index_title{ + float: left; + border: 0px; +} + +span.index_extra{ + float: right; + padding: 2px; + border: 0px; +} + +div.signature { + bottom: 10px; +} + +div#index_welcome{ + margin: 10px; + margin-bottom: 10px; +} +html>body div#index_welcome { + margin-bottom: 15px; +} + +#index_welcome div.title{ + font-size: 18px; + font-weight: bold; + border-bottom: dashed 1px; + padding: 5px; +} + +#index_welcome div.desc{ + padding: 5px; + font-size: 12px; + color: #000; +} + +#index_welcome div.visit{ + padding: 10px 5px; +} + +.left { text-align: left; } +.right { text-align: right; } +.floatleft { float: left;} +.floatright { float: right;} + +#index_forum a{ + font-weight: bold; +} + +table.index_category{ + border: 0px; + margin-top: -10px; + margin-bottom: 5px; +} + +table.index_category td{ + padding: 2px; +} + +table.index_category td a:first-letter{} + +table.index_category .desc, table.index_category .desc a{ + font-weight: normal !important; + padding-left: 0; + margin-top: 5px; + margin-bottom: 0px; +} + +table.index_category .desc:first-letter, table.index_category .desc a:first-letter{} + +#index_forum span.item{ + padding: 0px 0px 0px 0px; + margin: 0px; + border: 0px; +} + +#index_forum span.extra{ + float: right; + text-align: left; + margin: 0px; +} + +div#forum_header{ + margin: 5px; +} +#forum_header div{ + padding-top: 5px; +} + + + +/* -- dropdown menu -- */ + +div.dropdown{ + float: left; +} + +div.dropdown .menu, div.dropdown .userbar{ + font-weight: bold; + float: left; + margin: 0px 1px; + border: 0px !important; + padding: 0px; +} + +div.dropdown .item{ + font-weight: bold; + padding: 2px 5px; + white-space: nowrap; + border: 0px !important; +} + +div.dropdown ul, div.dropdown table { + width: 135px; +} +/* -- dropdown menu -- */ + +/* -- user level -- */ +table.userlevel{ + width: 90%; + border: 0px; + padding: 0px; + border-collapse: collapse; + border-spacing: 0; + text-align: left; +} + +table.userlevel td{ + height: 13px; + padding: 0px; +} + +table.userlevel td.end{ + width: 3px; +} + +table.userlevel td.end img{ + width: 3px; + height: 13px; +} + +table.userlevel td.center{ + width: 100%; +} + +table.userlevel td.center img{ + height: 12px; +} +/* -- user level -- */ + +span.online_admin{ + color:#FFA34F; +} + +span.online_moderator{ + color:#006600; +} + + +/* + * From http://www.positioniseverything.net/easyclearing.html + */ +.clear:after { + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; +} +.clear {display: inline-table;} +/* Hides from IE-mac \*/ +* html .clear {height: 1%;} +.clear {display: block;} +/* End hide from IE-mac */ + +/* color -- dropdown menu for Forum */ +div.dropdown a, div.dropdown .menubar a{ + /* irmtfan remove hardcode color color:#FFF; */ +} + +div.dropdown .menu, div.dropdown .menubar, div.dropdown .item, div.dropdown .separator{ + /* irmtfan remove hardcode color background-color: #436792;*/ + /* same color set as in your theme/style.ss .th{} is recommended */ + /* irmtfan remove hardcode color color:#FFF; */ +} + +div.dropdown .separator{ + border: 1px inset #e0e0e0; +} + +div.dropdown .menu a:hover, div.dropdown .userbar a:hover{ + color: #333; +} +/* irmtfan class added for solve some hard codes */ +.post_edit { + float: right; + padding: 5px; + margin-top: 10px; + border:1px solid #000; +} +.post_ip { + float: right; + padding: 5px; + margin-top: 10px; +} +.pagenav { + float: right; + text-align: right; + padding: 5px; +} +.align_left, #align_left { + margin-left: 0; + text-align: left; +} +.align_right, #align_right { + margin-right: 0; + text-align: right; +} + +/* color - end */ \ No newline at end of file Added: XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/style.css =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/style.css (rev 0) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/style.css 2012-08-04 10:33:49 UTC (rev 9984) @@ -0,0 +1,322 @@ +/* -- style.css -- */ +.forum_header { + float : center; + overflow : hidden; + border : 1px solid #aaaaaa; + width : 100%; +} + +.forum_title { + float : /*irmtfan left*/ right; + text-align : /*irmtfan left*/ right; + padding : 5px; + width : 100%; + +} + +.forum_title a { + font-weight: bold; +} + + +.forum_stats { + float:center; + overflow:hidden; + text-align:/*irmtfan left*/right; + /* border:1px solid #aaaaaa; */ + padding:5px; +} + +.forum_stats_left { + float: /*irmtfan left*/ right; + text-align: /*irmtfan left*/ right; + width:45%; +} + +.forum_stats_right { + float: /*irmtfan right*/left; + text-align: /*irmtfan right*/ left; + width:45%; +} + +.forum_body { + margin-top: -10px; + padding-top: 20px; + float:center; + width:99%; + overflow:hidden; +} + +.forum_footer { + float:center; + width:99%; + overflow:hidden; +} + +.index_category{ + border: 0px; + /*margin-top: -10px; + margin-bottom: 5px;*/ +} + +.ThreadUserName a { + font-weight: bold; + margin-bottom: 2px; + /*color: #000; irmtfan */ +} + +.ThreadTitle, .ThreadTitle a{ + font-weight: bold; + margin-bottom: 2px; + /*color: #fff; irmtfan */ +} + +.icon_left { + float: /*irmtfan left*/ right; text-align: /*irmtfan left*/ right; +} + +.icon_right { + float: /*irmtfan right*/ left; text-align: /*irmtfan right*/ left; +} + +div.karma +{ + background-color: transparent; + text-align: left; + border-top: 1px solid #DDDDFF; + border-left: 1px solid #DDDDFF; + border-right: 1px solid #AAAAAA; + border-bottom: 1px solid #AAAAAA; + padding: 10px; +} + +span.digest +{ +} + +span.index_title{ + float: /*irmtfan left*/ right; + border: 0px; +} + +span.index_extra{ + float: /*irmtfan right*/ left; + padding: 2px; + border: 0px; +} + +div.signature { + bottom: 10px; +} + +div#index_welcome{ + margin: 10px; + margin-bottom: 10px; +} +html>body div#index_welcome { + margin-bottom: 15px; +} + +#index_welcome div.title{ + font-size: 18px; + font-weight: bold; + border-bottom: dashed 1px; + padding: 5px; +} + +#index_welcome div.desc{ + padding: 5px; + font-size: 12px; + color: #000; +} + +#index_welcome div.visit{ + padding: 10px 5px; +} + +.left { text-align: /*irmtfan left*/ right; } +.right { text-align: /*irmtfan right*/ left; } +.floatleft { float: /*irmtfan left*/ right;} +.floatright { float: /*irmtfan right*/ left;} + +#index_forum a{ + font-weight: bold; +} + +table.index_category{ + border: 0px; + margin-top: -10px; + margin-bottom: 5px; +} + +table.index_category td{ + padding: 2px; +} + +table.index_category td a:first-letter{} + +table.index_category .desc, table.index_category .desc a{ + font-weight: normal !important; + /* irmtfan padding-left: 0; */ padding-right: 0; + margin-top: 5px; + margin-bottom: 0px; +} + +table.index_category .desc:first-letter, table.index_category .desc a:first-letter{} + +#index_forum span.item{ + padding: 0px 0px 0px 0px; + margin: 0px; + border: 0px; +} + +#index_forum span.extra{ + float: /*irmtfan right*/ left; + text-align: /*irmtfan left*/ right; + margin: 0px; +} + +div#forum_header{ + margin: 5px; +} +#forum_header div{ + padding-top: 5px; +} + + + +/* -- dropdown menu -- */ + +div.dropdown{ + float: /*irmtfan left*/ right; +} + +div.dropdown .menu, div.dropdown .userbar{ + font-weight: bold; + float: /*irmtfan left*/ right; + margin: 0px 1px; + border: 0px !important; + padding: 0px; +} + +div.dropdown .item{ + font-weight: bold; + padding: 2px 5px; + white-space: nowrap; + border: 0px !important; +} + +div.dropdown ul, div.dropdown table { + width: 135px; +} +/* -- dropdown menu -- */ + +/* -- user level -- */ +table.userlevel{ + width: 90%; + border: 0px; + padding: 0px; + border-collapse: collapse; + border-spacing: 0; + text-align: /*irmtfan left*/ right; +} + +table.userlevel td{ + height: 13px; + padding: 0px; +} + +table.userlevel td.end{ + width: 3px; +} + +table.userlevel td.end img{ + width: 3px; + height: 13px; +} + +table.userlevel td.center{ + width: 100%; +} + +table.userlevel td.center img{ + height: 12px; +} +/* -- user level -- */ + +span.online_admin{ + color:#FFA34F; +} + +span.online_moderator{ + color:#006600; +} + + +/* + * From http://www.positioniseverything.net/easyclearing.html + */ +.clear:after { + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; +} +.clear {display: inline-table;} +/* Hides from IE-mac \*/ +* html .clear {height: 1%;} +.clear {display: block;} +/* End hide from IE-mac */ + +/* color -- dropdown menu for Forum */ +div.dropdown a, div.dropdown .menubar a{ + /* irmtfan remove hardcode color color:#FFF; */ +} + +div.dropdown .menu, div.dropdown .menubar, div.dropdown .item, div.dropdown .separator{ + /* irmtfan remove hardcode color background-color: #436792;*/ + /* same color set as in your theme/style.ss .th{} is recommended */ + /* irmtfan remove hardcode color color:#FFF; */ +} + +div.dropdown .separator{ + border: 1px inset #e0e0e0; +} + +div.dropdown .menu a:hover, div.dropdown .userbar a:hover{ + color: #333; +} +/* irmtfan class added for solve some hard codes */ +.post_edit { + float: /*irmtfan right*/ left; + padding: 5px; + margin-top: 10px; + border:1px solid #000; +} +.post_ip { + float: /*irmtfan right*/ left; + padding: 5px; + margin-top: 10px; +} +.pagenav { + float: /*irmtfan right*/ left; + text-align: /*irmtfan right*/ left; + padding: 5px; +} +.align_left, #align_left { + direction: rtl; + /* irmtfan margin-left: 0; */ margin-right: 0; + text-align: /*irmtfan left*/ right; +} +.align_right, #align_right { + direction: rtl; + /* irmtfan margin-right: 0; */ margin-left: 0; + text-align: /*irmtfan right*/ left; +} +.poll { + direction: rtl; + text-align: center; + margin: 3px; +} +/* color - end */ \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_edit_post.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_edit_post.html 2012-08-03 23:18:02 UTC (rev 9983) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_edit_post.html 2012-08-04 10:33:49 UTC (rev 9984) @@ -1,89 +1,90 @@ -<div class="forum_header"> - <div class="forum_title"> - <h2><a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/index.php"><{$lang_forum_index}></a></h2> - <hr align="left" width="50%" size="1" /> - <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/index.php"><{$smarty.const._MD_FORUMINDEX}></a> - <span class="delimiter">»</span> - <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/index.php?cat=<{$category.id}>"><{$category.title}></a> - <{if $parentforum}> - <{foreachq item=forum from=$parentforum}> - <span class="delimiter">»</span> - <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/viewforum.php?forum=<{$forum.forum_id}>"><{$forum.forum_name}></a> - <{/foreach}> - <{/if}> - <span class="delimiter">»</span> - <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/viewforum.php?forum=<{$forum_id}>"><{$forum_name}></a> - <span class="delimiter">»</span> - <strong><{$form_title}></strong> - </div> -</div> -<div class="clear"></div> -<br /> - -<{if $disclaimer}> - <div class="confirmMsg"><{$disclaimer}></div> - <div class="clear"></div> - <br /> -<{/if}> - -<{if $error_message}> - <div class="errorMsg"><{$error_message}></div> - <div class="clear"></div> - <br /> -<{/if}> - -<{if $post_preview}> -<table width='100%' class='outer' cellspacing='1'> - <tr valign="top"> - <td class="head"><{$post_preview.subject}></td> - </tr> - <tr valign="top"> - <td><{$post_preview.meta}><br /><br /> - <{$post_preview.content}> - </td> - </tr> -</table> -<div class="clear"></div> -<br /> -<{/if}> - -<form name="<{$form_post.name}>" id="<{$form_post.name}>" action="<{$form_post.action}>" method="<{$form_post.method}>" <{$form_post.extra}> > -<table width='100%' class='outer' cellspacing='1'> -<{foreachq item=element from=$form_post.elements}> - <{if $element.hidden != true}> - <tr valign="top"> - <td class="head"> - <div class="xoops-form-element-caption<{if $element.required}>-required<{/if}>"><span class="caption-text"><{$element.caption}></span><span class="caption-marker">*</span></div> - <{if $element.description != ''}> - <div class="xoops-form-element-help"><{$element.description}></div> - <{/if}> - </td> - <td class="odd" style="white-space: nowrap;"><{$element.body}></td> - </tr> - <{/if}> -<{/foreach}> -</table> -<{foreachq item=element from=$form_post.elements}> - <{if $element.hidden == true}> - <{$element.body}> - <{/if}> -<{/foreach}> -</form> -<{$form_post.javascript}> -<div class="clear"></div> -<br /> - -<{if $posts_context}> -<table width='100%' class='outer' cellspacing='1'> -<{foreachq item=post from=$posts_context}> - <tr valign="top"> - <td class="head"><{$post.subject}></td> - </tr> - <tr valign="top"> - <td><{$post.meta}><br /><br /> - <{$post.content}> - </td> - </tr> -<{/foreach}> -</table> +<div class="forum_header"> + <div class="forum_title"> + <h2><a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/index.php"><{$lang_forum_index}></a></h2> +<!-- irmtfan hardcode removed align="left" --> + <hr class="align_left" width="50%" size="1" /> + <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/index.php"><{$smarty.const._MD_FORUMINDEX}></a> + <span class="delimiter">»</span> + <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/index.php?cat=<{$category.id}>"><{$category.title}></a> + <{if $parentforum}> + <{foreachq item=forum from=$parentforum}> + <span class="delimiter">»</span> + <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/viewforum.php?forum=<{$forum.forum_id}>"><{$forum.forum_name}></a> + <{/foreach}> + <{/if}> + <span class="delimiter">»</span> + <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/viewforum.php?forum=<{$forum_id}>"><{$forum_name}></a> + <span class="delimiter">»</span> + <strong><{$form_title}></strong> + </div> +</div> +<div class="clear"></div> +<br /> + +<{if $disclaimer}> + <div class="confirmMsg"><{$disclaimer}></div> + <div class="clear"></div> + <br /> +<{/if}> + +<{if $error_message}> + <div class="errorMsg"><{$error_message}></div> + <div class="clear"></div> + <br /> +<{/if}> + +<{if $post_preview}> +<table width='100%' class='outer' cellspacing='1'> + <tr valign="top"> + <td class="head"><{$post_preview.subject}></td> + </tr> + <tr valign="top"> + <td><{$post_preview.meta}><br /><br /> + <{$post_preview.content}> + </td> + </tr> +</table> +<div class="clear"></div> +<br /> +<{/if}> + +<form name="<{$form_post.name}>" id="<{$form_post.name}>" action="<{$form_post.action}>" method="<{$form_post.method}>" <{$form_post.extra}> > +<table width='100%' class='outer' cellspacing='1'> +<{foreachq item=element from=$form_post.elements}> + <{if $element.hidden != true}> + <tr valign="top"> + <td class="head"> + <div class="xoops-form-element-caption<{if $element.required}>-required<{/if}>"><span class="caption-text"><{$element.caption}></span><span class="caption-marker">*</span></div> + <{if $element.description != ''}> + <div class="xoops-form-element-help"><{$element.description}></div> + <{/if}> + </td> + <td class="odd" style="white-space: nowrap;"><{$element.body}></td> + </tr> + <{/if}> +<{/foreach}> +</table> +<{foreachq item=element from=$form_post.elements}> + <{if $element.hidden == true}> + <{$element.body}> + <{/if}> +<{/foreach}> +</form> +<{$form_post.javascript}> +<div class="clear"></div> +<br /> + +<{if $posts_context}> +<table width='100%' class='outer' cellspacing='1'> +<{foreachq item=post from=$posts_context}> + <tr valign="top"> + <td class="head"><{$post.subject}></td> + </tr> + <tr valign="top"> + <td><{$post.meta}><br /><br /> + <{$post.content}> + </td> + </tr> +<{/foreach}> +</table> <{/if}> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_poll_results.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_poll_results.html 2012-08-03 23:18:02 UTC (rev 9983) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_poll_results.html 2012-08-04 10:33:49 UTC (rev 9984) @@ -1,21 +1,24 @@ -<div style="text-align: center; margin: 3px;"> - <table width="100%" class="outer" cellspacing="1"> - <tr> - <th colspan="2"><{$poll.question}></th> - </tr> - <tr> - <td class="head" align="right" colspan="2"><{$poll.end_text}> </td> - </tr> -<{foreachq item=option from=$poll.options}> - <tr> - <td class="even" width="30%" align="left"><{$option.text}> </td> - <td class="odd" width="70%" align="left"><{$option.image}> <{$option.percent}> </td> - </tr> -<{/foreach}> - <tr> - <td class="foot" colspan="2" align="center"><{$poll.totalVotes}><br /> -<{$poll.totalVoters}></td> - </tr> - </table> -</div> +<!-- irmtfan hardcode removed style="text-align: center;margin: 3px;" --> +<div class="poll"> + <table width="100%" class="outer" cellspacing="1"> + <tr> + <th colspan="2"><{$poll.question}></th> + </tr> + <tr> +<!-- irmtfan hardcode removed align="right" --> + <td class="head" id="align_right" colspan="2"><{$poll.end_text}> </td> + </tr> +<{foreachq item=option from=$poll.options}> + <tr> +<!-- irmtfan hardcode removed align="left" --> + <td class="even" id="align_left" width="30%"><{$option.text}></td> + <td class="odd" id="align_left" width="70%"><{$option.image}> <{$option.percent}></td> + </tr> +<{/foreach}> + <tr> + <td class="foot" colspan="2" align="center"><{$poll.totalVotes}><br /> +<{$poll.totalVoters}></td> + </tr> + </table> +</div> <br /> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_poll_view.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_poll_view.html 2012-08-03 23:18:02 UTC (rev 9983) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_poll_view.html 2012-08-04 10:33:49 UTC (rev 9984) @@ -1,19 +1,20 @@ -<form action="<{$xoops_url}>/modules/<{$xoops_dirname}>/votepolls.php" method="post"> - <input type="hidden" name="topic_id" value="<{$topic_id}>" /> - <input type="hidden" name="forum" value="<{$forum_id}>" /> - <table width="100%" class="outer" cellspacing="1"> - <tr> - <th align="center" colspan="2"><input type="hidden" name="poll_id" value="<{$poll.pollId}>" /> -<{$poll.question}></th> - </tr> -<{foreachq item=option from=$poll.options}> - <tr> - <td class="even" align="left" width="2%"><{$option.input}></td> - <td class="odd" align="left" width="98%"><{$option.text}></td> - </tr> -<{/foreach}> - <tr> - <td align="center" colspan="2" class="foot"><input type="submit" value="<{$lang_vote}>" /></td> - </tr> - </table> +<form action="<{$xoops_url}>/modules/<{$xoops_dirname}>/votepolls.php" method="post"> + <input type="hidden" name="topic_id" value="<{$topic_id}>" /> + <input type="hidden" name="forum" value="<{$forum_id}>" /> + <table width="100%" class="outer" cellspacing="1"> + <tr> + <th align="center" colspan="2"><input type="hidden" name="poll_id" value="<{$poll.pollId}>" /> +<{$poll.question}></th> + </tr> +<{foreachq item=option from=$poll.options}> + <tr> +<!-- irmtfan hardcode removed align="left" --> + <td class="even" id="align_left" width="2%"><{$option.input}></td> + <td class="odd" id="align_left" width="98%"><{$option.text}></td> + </tr> +<{/foreach}> + <tr> + <td align="center" colspan="2" class="foot"><input type="submit" value="<{$lang_vote}>" /></td> + </tr> + </table> </form> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_search.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_search.html 2012-08-03 23:18:02 UTC (rev 9983) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_search.html 2012-08-04 10:33:49 UTC (rev 9984) @@ -1,69 +1,78 @@ -<div id="forum_header"> - <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/index.php"><{$forumindex}></a> - > - <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/search.php"><{$smarty.const._SR_SEARCH}></a> -</div> - -<{if $search_info}> -<{includeq file="db:newbb_searchresults.html" results=$results}> -<{/if}> -<form name="Search" action="<{$xoops_url}>/modules/<{$xoops_dirname}>/search.php" method="get"> - <table class="outer" border="0" cellpadding="1" cellspacing="0" align="center" width="95%"> - <tr> - <td><table border="0" cellpadding="1" cellspacing="1" width="100%" class="head"> - <tr> - <td class="head" width="10%" align="right"><strong><{$smarty.const._SR_KEYWORDS}></strong> </td> - <td class="even"><input type="text" name="term" /></td> - </tr> - <tr> - <td class="head" align="right"><strong><{$smarty.const._SR_TYPE}></strong> </td> - <td class="even"> - <select name="andor"> - <option value="or" selected="selected"><{$smarty.const._SR_ANY}></option> - <option value="all"><{$smarty.const._SR_ALL}></option> - <option value="exact"><{$smarty.const._SR_EXACT}></option> - </select> - </td> - </tr> - <tr> - <td class="head" align="right"><strong><{$smarty.const._MD_FORUMC}></strong> </td> - <td class="even"><{$forum_selection_box}></td> - </tr> - <tr> - <td class="head" align="right"><strong><{$smarty.const._SR_SEARCHIN}></strong> </td> - <td class="even"><input type="radio" name="searchin" value="title" /><{$smarty.const._MD_SUBJECT}> - <input type="radio" name="searchin" value="text" /><{$smarty.const._MD_BODY}> - <input type="radio" name="searchin" value="both" checked="checked" /><{$smarty.const._MD_SUBJECT}> & <{$smarty.const._MD_BODY}> </td> - </tr> - <tr> - <td class="head" align="right"><strong><{$smarty.const._MD_AUTHOR}></strong> </td> - <td class="even"><input type="text" name="uname" value="" /></td> - </tr> - <tr> - <td class="head" align="right"><strong><{$smarty.const._MD_SORTBY}></strong> </td> - <td class="even"> - <select name=="sortby"> - <option value="p.post_time desc" selected="selected"><{$smarty.const._MD_DATE}></option> - <option value="t.topic_title"><{$smarty.const._MD_TOPIC}></option> - <option value="f.forum_name"><{$smarty.const._MD_FORUM}></option> - <option value="u.uname"><{$smarty.const._MD_USERNAME}></option> - </select> - </td> - </tr> - <tr> - <td class="head" align="right"><strong><{$smarty.const._MD_SINCE}></strong> </td> - <td class="even"><{$since_selection_box}></td> - </tr> - <{if $search_rule}> - <tr> - <td class="head" align="right"><strong><{$smarty.const._SR_SEARCHRULE}></strong> </td> - <td class="even"><{$search_rule}></td> - </tr> - <{/if}> - <tr> - <td class="head" align="right"> </td> - <td class="even"><input type="submit" name="submit" value="<{$smarty.const._MD_SEARCH}>" /></td> - </table></td> - </tr> - </table> +<div id="forum_header"> + <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/index.php"><{$forumindex}></a> + > + <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/search.php"><{$smarty.const._SR_SEARCH}></a> +</div> + +<{if $search_info}> +<{includeq file="db:newbb_searchresults.html" results=$results}> +<{/if}> +<form name="Search" action="<{$xoops_url}>/modules/<{$xoops_dirname}>/search.php" method="get"> + <table class="outer" border="0" cellpadding="1" cellspacing="0" align="center" width="95%"> + <tr> + <td><table border="0" cellpadding="1" cellspacing="1" width="100%" class="head"> + <tr> +<!-- irmtfan hardcode removed align="right" --> + <td class="head" width="10%" id="align_right"><strong><{$smarty.const._SR_KEYWORDS}></strong> </td> + <td class="even"><input type="text" name="term" /></td> + </tr> + <tr> +<!-- irmtfan hardcode removed align="right" --> + <td class="head" id="align_right"><strong><{$smarty.const._SR_TYPE}></strong> </td> + <td class="even"> + <select name="andor"> + <option value="or" selected="selected"><{$smarty.const._SR_ANY}></option> + <option value="all"><{$smarty.const._SR_ALL}></option> + <option value="exact"><{$smarty.const._SR_EXACT}></option> + </select> + </td> + </tr> + <tr> +<!-- irmtfan hardcode removed align="right" --> + <td class="head" id="align_right"><strong><{$smarty.const._MD_FORUMC}></strong> </td> + <td class="even"><{$forum_selection_box}></td> + </tr> + <tr> +<!-- irmtfan hardcode removed align="right" --> + <td class="head" id="align_right"><strong><{$smarty.const._SR_SEARCHIN}></strong> </td> + <td class="even"><input type="radio" name="searchin" value="title" /><{$smarty.const._MD_SUBJECT}> + <input type="radio" name="searchin" value="text" /><{$smarty.const._MD_BODY}> + <input type="radio" name="searchin" value="both" checked="checked" /><{$smarty.const._MD_SUBJECT}> & <{$smarty.const._MD_BODY}> </td> + </tr> + <tr> +<!-- irmtfan hardcode removed align="right" --> + <td class="head" id="align_right"><strong><{$smarty.const._MD_AUTHOR}></strong> </td> + <td class="even"><input type="text" name="uname" value="" /></td> + </tr> + <tr> +<!-- irmtfan hardcode removed align="right" --> + <td class="head" id="align_right"><strong><{$smarty.const._MD_SORTBY}></strong> </td> + <td class="even"> + <select name=="sortby"> + <option value="p.post_time desc" selected="selected"><{$smarty.const._MD_DATE}></option> + <option value="t.topic_title"><{$smarty.const._MD_TOPIC}></option> + <option value="f.forum_name"><{$smarty.const._MD_FORUM}></option> + <option value="u.uname"><{$smarty.const._MD_USERNAME}></option> + </select> + </td> + </tr> + <tr> +<!-- irmtfan hardcode removed align="right" --> + <td class="head" id="align_right"><strong><{$smarty.const._MD_SINCE}></strong> </td> + <td class="even"><{$since_selection_box}></td> + </tr> + <{if $search_rule}> + <tr> +<!-- irmtfan hardcode removed align="right" --> + <td class="head" id="align_right"><strong><{$smarty.const._SR_SEARCHRULE}></strong> </td> + <td class="even"><{$search_rule}></td> + </tr> + <{/if}> + <tr> +<!-- irmtfan hardcode removed align="right" --> + <td class="head" id="align_right"> </td> + <td class="even"><input type="submit" name="submit" value="<{$smarty.const._MD_SEARCH}>" /></td> + </table></td> + </tr> + </table> </form> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_searchresults.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_searchresults.html 2012-08-03 23:18:02 UTC (rev 9983) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_searchresults.html 2012-08-04 10:33:49 UTC (rev 9984) @@ -1,41 +1,43 @@ -<div class="resultMsg"> <{$search_info}> </div> -<br /> -<{if $results}> -<table class="outer" border="0" cellpadding="0" cellspacing="0" align="center" width="95%"> - <tr> - <td><table border="0" cellpadding="4" cellspacing="1" width="100%"> - <tr class="head" align="center"> - <td><{$smarty.const._MD_FORUMC}></td> - <td><{$smarty.const._MD_SUBJECT}></td> - <td><{$smarty.const._MD_AUTHOR}></td> - <td nowrap="nowrap"><{$smarty.const._MD_POSTTIME}></td> - </tr> - <!-- start search results --> -<{section name=i loop=$results}> - <!-- start each result --> - <tr align="center"> - <td class="even"><a href="<{$results[i].forum_link}>"><{$results[i].forum_name}></a></td> - <td class="odd" align="left"><a href="<{$results[i].link}>"><{$results[i].title}></a></td> - <td class="even"><{$results[i].poster}></a></td> - <td class="odd"><{$results[i].post_time}></td> - </tr> - <!-- end each result --> -<{/section}> - <!-- end search results --> - </table></td> - </tr> -<{if $search_next or $search_prev}> - <tr> - <td><table border="0" cellpadding="4" cellspacing="1" width="100%"> - <tr class="head"> - <td align="left" width="50%"><{$search_prev}> </td><td align="right" width="50%"> <{$search_next}></td> - </tr> - </table></td> - </tr> -<{/if}> -</table> -<br /> -<{elseif $lang_nomatch}> -<div class="resultMsg"> <{$lang_nomatch}> </div> -<br /> +<div class="resultMsg"> <{$search_info}> </div> +<br /> +<{if $results}> +<table class="outer" border="0" cellpadding="0" cellspacing="0" align="center" width="95%"> + <tr> + <td><table border="0" cellpadding="4" cellspacing="1" width="100%"> + <tr class="head" align="center"> + <td><{$smarty.const._MD_FORUMC}></td> + <td><{$smarty.const._MD_SUBJECT}></td> + <td><{$smarty.const._MD_AUTHOR}></td> + <td nowrap="nowrap"><{$smarty.const._MD_POSTTIME}></td> + </tr> + <!-- start search results --> +<{section name=i loop=$results}> + <!-- start each result --> + <tr align="center"> + <td class="even"><a href="<{$results[i].forum_link}>"><{$results[i].forum_name}></a></td> +<!-- irmtfan hardcode removed align="left" --> + <td class="odd" id="align_left"><a href="<{$results[i].link}>"><{$results[i].title}></a></td> + <td class="even"><{$results[i].poster}></a></td> + <td class="odd"><{$results[i].post_time}></td> + </tr> + <!-- end each result --> +<{/section}> + <!-- end search results --> + </table></td> + </tr> +<{if $search_next or $search_prev}> + <tr> + <td><table border="0" cellpadding="4" cellspacing="1" width="100%"> + <tr class="head"> +<!-- irmtfan hardcode removed align="left" --> + <td class="align_left" width="50%"><{$search_prev}> </td><td class="align_right" width="50%"> <{$search_next}></td> + </tr> + </table></td> + </tr> +<{/if}> +</table> +<br /> +<{elseif $lang_nomatch}> +<div class="resultMsg"> <{$lang_nomatch}> </div> +<br /> <{/if}> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewforum_subforum.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewforum_subforum.html 2012-08-03 23:18:02 UTC (rev 9983) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewforum_subforum.html 2012-08-04 10:33:49 UTC (rev 9984) @@ -1,38 +1,40 @@ -<table cellspacing="1" class="outer" width="100%"> - <tr class="head" align="center"> - <td width="5%"> </td> - <td nowrap="nowrap" align="left"><{$smarty.const._MD_SUBFORUMS}></td> - <td nowrap="nowrap"> </td> - <td nowrap="nowrap"><{$smarty.const._MD_LASTPOST}></td> - </tr> - <!-- start subforums --> - <{foreachq item=sforum from=$subforum}> - <tr> - <td class="even" align="center" valign="middle"><{$sforum.forum_folder}></td> - <td class="odd" onclick="window.location='<{$xoops_url}>/modules/<{$xoops_dirname}>/viewforum.php?forum=<{$sforum.forum_id}>'"><a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/viewforum.php?forum=<{$sforum.forum_id}>"><strong><{$sforum.forum_name}></strong></a><br /> - <div id="index_forum"> - <{$sforum.forum_desc}> - <{if $sforum.forum_moderators}><br/> - <span class="extra"><{$smarty.const._MD_MODERATOR}>: </strong><{$sforum.forum_moderators}> - <{/if}> - </div> - </td> - <td class="even" align="center" valign="middle"> - <{$sforum.forum_topics}> <{$smarty.const._MD_TOPICS}> - <br /> - <{$sforum.forum_posts}> <{$smarty.const._MD_POSTS}> - </td> - <td class="odd" align="right" valign="middle"> - <{if $sforum.forum_lastpost_subject}> - <{$sforum.forum_lastpost_time}> <{$smarty.const._MD_BY}> <{$sforum.forum_lastpost_user}><br /> - <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/viewtopic.php?post_id=<{$sforum.forum_lastpost_id}>"> - <{$sforum.forum_lastpost_subject}> <img src="<{$xoops_url}>/modules/<{$xoops_dirname}>/templates/images/icon/<{$sforum.forum_lastpost_icon}>" alt="<{$smarty.const._MD_NEWBB_GOTOLASTPOST}>" title="<{$smarty.const._MD_NEWBB_GOTOLASTPOST}>" /> - </a> - <{else}> - <{$smarty.const._MD_NONEWPOSTS}> - <{/if}> - </td> - </tr> - <{/foreach}> - <!-- end subforums --> +<table cellspacing="1" class="outer" width="100%"> + <tr class="head" align="center"> + <td width="5%"> </td> +<!-- irmtfan hardcode removed align="left" --> + <td nowrap="nowrap" class="align_left"><{$smarty.const._MD_SUBFORUMS}></td> + <td nowrap="nowrap"> </td> + <td nowrap="nowrap"><{$smarty.const._MD_LASTPOST}></td> + </tr> + <!-- start subforums --> + <{foreachq item=sforum from=$subforum}> + <tr> + <td class="even" align="center" valign="middle"><{$sforum.forum_folder}></td> + <td class="odd" onclick="window.location='<{$xoops_url}>/modules/<{$xoops_dirname}>/viewforum.php?forum=<{$sforum.forum_id}>'"><a href="<{$xoops_url}>/modules/<{$xo... [truncated message content] |
From: <ir...@us...> - 2012-08-27 08:04:14
|
Revision: 10122 http://xoops.svn.sourceforge.net/xoops/?rev=10122&view=rev Author: irmtfan Date: 2012-08-27 08:04:06 +0000 (Mon, 27 Aug 2012) Log Message: ----------- remove icon_path, simplyify infobox, css3 text buttons introduced Modified Paths: -------------- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt XoopsModules/newbb/branches/irmtfan/newbb/class/forum.php XoopsModules/newbb/branches/irmtfan/newbb/class/icon.php XoopsModules/newbb/branches/irmtfan/newbb/class/user.php XoopsModules/newbb/branches/irmtfan/newbb/docs/lang_diff.txt XoopsModules/newbb/branches/irmtfan/newbb/include/images.php XoopsModules/newbb/branches/irmtfan/newbb/include/js/newbb_toggle.js XoopsModules/newbb/branches/irmtfan/newbb/language/english/main.php XoopsModules/newbb/branches/irmtfan/newbb/language/persian/main.php XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/english/style.css XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/style.css XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_index.html XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_thread.html XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewforum_subforum.html XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html XoopsModules/newbb/branches/irmtfan/newbb/viewpost.php XoopsModules/newbb/branches/irmtfan/newbb/viewtopic.php Added Paths: ----------- XoopsModules/newbb/branches/irmtfan/newbb/templates/images/icon/less.png Modified: XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt 2012-08-26 19:06:53 UTC (rev 10121) +++ XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt 2012-08-27 08:04:06 UTC (rev 10122) @@ -1,3 +1,22 @@ +date: 2012-08-27 +================================================ +1- remove icon_path and use newbb_displayImage +newbb/class/forum.php, newbb/templates/newbb_index.html, newbb/templates/newbb_viewforum_subforum.html + +2- remove icon_path and define anonym icon and use newbb_displayImage +newbb/viewpost.php, newbb/viewtopic.php, newbb/include/images.php, newbb/templates/newbb_thread.html + +3- simplyify infobox and add alt and title show/hide definitions and alt key +newbb/viewtopic.php, newbb/templates/newbb_thread.html, newbb/include/js/newbb_toggle.js, newbb/language/english/main.php newbb/docs/lang_diff.txt +newbb/templates/images/language/english/style.css +newbb/templates/images/icon/less.png + +4- a little correctness. dot removed +newbb/class/user.php + +5- feature improve: css3 text buttons introduced and used (DCrussader/irmtfan) +newbb/class/icon.php, newbb/templates/images/language/english/style.css class="forum_icon" id=$image_name + date: 2012-08-26 ================================================ 1- merge with alfred. Modified: XoopsModules/newbb/branches/irmtfan/newbb/class/forum.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/class/forum.php 2012-08-26 19:06:53 UTC (rev 10121) +++ XoopsModules/newbb/branches/irmtfan/newbb/class/forum.php 2012-08-27 08:04:06 UTC (rev 10122) @@ -804,9 +804,8 @@ } $_forum_data['forum_lastpost_subject'] = $subject; } - $icon_handler = newbb_getIconHandler(); - $_forum_data['forum_icon_path']= $icon_handler->getPath("icon"); - $_forum_data['forum_lastpost_icon'] = 'lastposticon.png'; + // irmtfan - remove icon_path and use newbb_displayImage + $_forum_data['forum_lastpost_icon'] = newbb_displayImage('lastposticon',_MD_NEWBB_GOTOLASTPOST); endif; Modified: XoopsModules/newbb/branches/irmtfan/newbb/class/icon.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/class/icon.php 2012-08-26 19:06:53 UTC (rev 10121) +++ XoopsModules/newbb/branches/irmtfan/newbb/class/icon.php 2012-08-27 08:04:06 UTC (rev 10122) @@ -150,9 +150,12 @@ function assignImage($image, $alt = "", $extra = "") { $this->setImage($image, $alt, $extra); - // START hacked by iemrfan - return $alt; - // END hacked by iemrfan + // START hacked by iemrfan - improve to CSS3 buttons + if ($alt !='') { + return "<button {$extra} id={$image}>$alt</button>"; + } + return true; + // END hacked by iemrfan - improve to CSS3 buttons } function assignImages($images) Modified: XoopsModules/newbb/branches/irmtfan/newbb/class/user.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/class/user.php 2012-08-26 19:06:53 UTC (rev 10121) +++ XoopsModules/newbb/branches/irmtfan/newbb/class/user.php 2012-08-27 08:04:06 UTC (rev 10122) @@ -180,14 +180,14 @@ $userinfo["rank_image"] = $userrank['image']; $userinfo["rank_title"] = $userrank['title']; } - // END hacked by irmtfan - easier rank getting + // END hacked by irmtfan - easier rank getting - a little correctness dot removed // START hacked by irmtfan - easier groups getting - can we use $_SESSION['xoopsUserGroups']??? //checks for user's groups $userinfo["groups"] = array(); $member_handler =& xoops_gethandler('member'); $usergroups =& $member_handler->getGroupsByUser($userinfo["uid"], true); foreach ($usergroups as $group) { - $userinfo["groups"][] .= $group->getVar('name'); + $userinfo["groups"][] = $group->getVar('name'); } // END hacked by irmtfan - easier groups getting - can we use $_SESSION['xoopsUserGroups']??? $userinfo["from"] = $user->getVar('user_from'); Modified: XoopsModules/newbb/branches/irmtfan/newbb/docs/lang_diff.txt =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/docs/lang_diff.txt 2012-08-26 19:06:53 UTC (rev 10121) +++ XoopsModules/newbb/branches/irmtfan/newbb/docs/lang_diff.txt 2012-08-27 08:04:06 UTC (rev 10122) @@ -35,3 +35,12 @@ added: define('_MD_NEWBB_MAXPIC','Images at the max. Size %s X %s pixels.'); define('_MD_NEWBB_SEARCHDISABLED','The search is disabled and can not be used.'); + +Version 4.3 rev.10109 +---------------- +main.php +--------- +revise: +define('_MD_NEWBB_SEEUSERDATA','See User information'); +added: +define('_MD_NEWBB_HIDEUSERDATA','Hide User information'); Modified: XoopsModules/newbb/branches/irmtfan/newbb/include/images.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/include/images.php 2012-08-26 19:06:53 UTC (rev 10121) +++ XoopsModules/newbb/branches/irmtfan/newbb/include/images.php 2012-08-27 08:04:06 UTC (rev 10122) @@ -25,6 +25,7 @@ */ // Forum image type +// irmtfan add anonym.png icon $forumImage[''] = $forumImage['blank'] = $forumImage['attachment'] = @@ -80,7 +81,7 @@ $forumImage['delicious'] = $forumImage['technorati'] = $forumImage['wong'] = - +$forumImage['anonym'] = "icon"; for($i = 1; $i <= 5; $i++ ) { Modified: XoopsModules/newbb/branches/irmtfan/newbb/include/js/newbb_toggle.js =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/include/js/newbb_toggle.js 2012-08-26 19:06:53 UTC (rev 10121) +++ XoopsModules/newbb/branches/irmtfan/newbb/include/js/newbb_toggle.js 2012-08-27 08:04:06 UTC (rev 10122) @@ -62,7 +62,7 @@ } } -function ToggleBlockCategory(block, icon, src_expand, src_collapse) +function ToggleBlockCategory(block, icon, src_expand, src_collapse, alt_expand, alt_collapse) { if (document.getElementById) { @@ -70,12 +70,18 @@ { document.getElementById(block).style.display = 'none'; icon.src = src_collapse; + icon.alt= alt_collapse; + icon.title= alt_collapse; + SaveCollapsed(block, true); } else { document.getElementById(block).style.display = 'block'; icon.src = src_expand; + icon.alt= alt_expand; + icon.title= alt_expand; + SaveCollapsed(block, false); } } @@ -85,12 +91,18 @@ { document.all[block].style.display = 'none'; icon.src = src_collapse; + icon.alt= alt_collapse; + icon.title= alt_collapse; + SaveCollapsed(block, true); } else { document.all[block].style.display = 'block'; icon.src = src_expand; + icon.alt= alt_expand; + icon.title= alt_expand; + SaveCollapsed(block, false); } } @@ -160,4 +172,3 @@ } return null; } - Modified: XoopsModules/newbb/branches/irmtfan/newbb/language/english/main.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/language/english/main.php 2012-08-26 19:06:53 UTC (rev 10121) +++ XoopsModules/newbb/branches/irmtfan/newbb/language/english/main.php 2012-08-27 08:04:06 UTC (rev 10122) @@ -479,10 +479,11 @@ //4.3 define("_MD_GO","Go"); -define('_MD_NEWBB_SEEUSERDATA','User information'); +define('_MD_NEWBB_SEEUSERDATA','See User information'); define('_MD_NEWBB_MAXKB','File is too big (max %s Kb possible).'); define('_MD_NEWBB_UPLOAD_ERRNODEF','undefined Error'); define('_MD_NEWBB_MAXUPLOADFILEINI','The uploaded file exceeds the upload_max_filesize directive in php.ini.'); define('_MD_NEWBB_MAXPIC','Images at the max. Size %s X %s pixels.'); define('_MD_NEWBB_SEARCHDISABLED','The search is disabled and can not be used.'); +define('_MD_NEWBB_HIDEUSERDATA','Hide User information'); ?> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/language/persian/main.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/language/persian/main.php 2012-08-26 19:06:53 UTC (rev 10121) +++ XoopsModules/newbb/branches/irmtfan/newbb/language/persian/main.php 2012-08-27 08:04:06 UTC (rev 10122) @@ -479,10 +479,11 @@ //4.3 define("_MD_GO","Go"); -define('_MD_NEWBB_SEEUSERDATA','نمایش/مخفی کردن اطلاعات کاربر'); +define('_MD_NEWBB_SEEUSERDATA','نمایش اطلاعات کاربر'); define('_MD_NEWBB_MAXKB','فایل خیلی بزرگ است (حداکثر %s Kb ممکن است).'); define('_MD_NEWBB_UPLOAD_ERRNODEF','یک ارور در بارگذاری اتفاق افتاد.'); define('_MD_NEWBB_MAXUPLOADFILEINI','فایل بارگذاری شده بیشتر از مقدار مجاز در متغیر upload_max_filesize تعریف شده در php.ini است.'); define('_MD_NEWBB_MAXPIC','تصاویر در حداکثر اندازه خود میتوانند %s X %s پیکسل داشته باشند.'); define('_MD_NEWBB_SEARCHDISABLED','امکان جستجو در سایت غیر فعال شده است. برای فعال کردن آن به مدیریت سیستم مراجعه کنید.'); +define('_MD_NEWBB_HIDEUSERDATA','مخفی کردن اطلاعات کاربر'); ?> \ No newline at end of file Added: XoopsModules/newbb/branches/irmtfan/newbb/templates/images/icon/less.png =================================================================== (Binary files differ) Property changes on: XoopsModules/newbb/branches/irmtfan/newbb/templates/images/icon/less.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/english/style.css =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/english/style.css 2012-08-26 19:06:53 UTC (rev 10121) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/english/style.css 2012-08-27 08:04:06 UTC (rev 10122) @@ -316,4 +316,42 @@ text-align: center; margin: 3px; } +.pointer { + cursor:pointer; + padding:2px; +} +/* irmtfan source: http://jsfiddle.net/VTLmj/ +you can customize each button like this: +button.forum_icon#p_edit +button.forum_icon#p_edit:hover +button.forum_icon#p_edit:active +find all image names in newbb/include/images.php +*/ +button.forum_icon { +background: #407DC7; +background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#407DC7), to(#4279B8)); +background-image: -webkit-linear-gradient(top, #407DC7, #4279B8); +background-image: -moz-linear-gradient(top, #407DC7, #4279B8); +background-image: -ms-linear-gradient(top, #407DC7, #4279B8); +background-image: -o-linear-gradient(top, #407DC7, #4279B8); +border-width: 1px; +color: white; +padding: 4px 4px; +text-shadow: 0 1px 0 gray; +border-color: white #A1C1E6 #2B4763 #A1C1E6; +border-style: solid; +border-radius: 5px; +box-shadow: 0 1px 7px #080808; +font-family: Tahoma; +} +button.forum_icon:hover { +box-shadow: 0 1px 5px #222; +} + +button.forum_icon:active { +box-shadow: inset 0 1px 7px #565656; +border-width: 1px; +border-color: white #a1c1e6 black #a1c1e6; +border-style: solid; +} /* color - end */ \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/style.css =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/style.css 2012-08-26 19:06:53 UTC (rev 10121) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/style.css 2012-08-27 08:04:06 UTC (rev 10122) @@ -319,4 +319,42 @@ text-align: center; margin: 3px; } +.pointer { + cursor:pointer; + padding:2px; +} +/* irmtfan source: http://jsfiddle.net/VTLmj/ +you can customize each button like this: +button.forum_icon#p_edit +button.forum_icon#p_edit:hover +button.forum_icon#p_edit:active +find all image names in newbb/include/images.php +*/ +button.forum_icon { +background: #407DC7; +background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#407DC7), to(#4279B8)); +background-image: -webkit-linear-gradient(top, #407DC7, #4279B8); +background-image: -moz-linear-gradient(top, #407DC7, #4279B8); +background-image: -ms-linear-gradient(top, #407DC7, #4279B8); +background-image: -o-linear-gradient(top, #407DC7, #4279B8); +border-width: 1px; +color: white; +padding: 4px 4px; +text-shadow: 0 1px 0 gray; +border-color: white #A1C1E6 #2B4763 #A1C1E6; +border-style: solid; +border-radius: 5px; +box-shadow: 0 1px 7px #080808; +font-family: Tahoma; +} +button.forum_icon:hover { +box-shadow: 0 1px 5px #222; +} + +button.forum_icon:active { +box-shadow: inset 0 1px 7px #565656; +border-width: 1px; +border-color: white #a1c1e6 black #a1c1e6; +border-style: solid; +} /* color - end */ \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_index.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_index.html 2012-08-26 19:06:53 UTC (rev 10121) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_index.html 2012-08-27 08:04:06 UTC (rev 10122) @@ -1,360 +1,360 @@ -<div class="forum_header"> -<!-- irmtfan hardcode remove style="float: left;" --> - <div class="forum_title"> - <h2><a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/index.php"><{$index_title}></a></h2> -<!-- irmtfan hardcode remove align="left" --> - <hr class="align_left" width="50%" size="1" /> - <{$index_desc}> - </div> -</div> -<div style="clear:both;"></div> - -<{if $viewer_level gt 1}> - <br /> - <div class="forum_stats"> - <div class="forum_stats_left"> - <{$smarty.const._MD_TOPIC}>: - <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/list.topic.php?status=active#admin" target="_self" title="<{$smarty.const._MD_TYPE_ADMIN}>"><{$smarty.const._MD_TYPE_ADMIN}></a> | - <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/list.topic.php?status=pending#admin" target="_self" title="<{$smarty.const._MD_TYPE_PENDING}>"><{if $wait_new_topic}>(<font color="red"><b><{$wait_new_topic}></b></font>) <{/if}><{$smarty.const._MD_TYPE_PENDING}></a> | - <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/list.topic.php?status=deleted#admin" target="_self" title="<{$smarty.const._MD_TYPE_DELETED}>"><{if $delete_topic}>(<font color="red"><b><{$delete_topic}></b></font>) <{/if}><{$smarty.const._MD_TYPE_DELETED}></a><br /> - <{$smarty.const._MD_POST2}>: - <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/viewpost.php?status=active#admin" target="_self" title="<{$smarty.const._MD_TYPE_ADMIN}>"><{$smarty.const._MD_TYPE_ADMIN}></a> | - <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/viewpost.php?status=pending#admin" target="_self" title="<{$smarty.const._MD_TYPE_PENDING}>"><{if $wait_new_post}>(<font color="red"><b><{$wait_new_post}></b></font>) <{/if}><{$smarty.const._MD_TYPE_PENDING}></a> | - <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/viewpost.php?status=deleted#admin" target="_self" title="<{$smarty.const._MD_TYPE_DELETED}>"><{if $delete_post}>(<font color="red"><b><{$delete_post}></b></font>) <{/if}><{$smarty.const._MD_TYPE_DELETED}></a> - </div> - <div class="forum_stats_right"> - <{if $report_post}><a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/admin/admin_report.php"><{$report_post}></a><{/if}> - <br /><a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/moderate.php" target="_self" title="<{$smarty.const._MD_TYPE_SUSPEND}>"><{$smarty.const._MD_TYPE_SUSPEND}></a> | - <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/admin/index.php" target="_self" title="<{$smarty.const._MD_ADMINCP}>"><{$smarty.const._MD_ADMINCP}></a> - </div> - <div style="clear:both;"></div> - </div> -<{/if}> -<br style="clear: both;" /> -<div class="dropdown"> - <{includeq file="db:newbb_index_menu.html"}> -</div> -<br style="clear: both;" /> -<br /> - -<!-- start forum categories --> -<div class="index_category"> - <!-- start forum categories --> - <{foreachq item=category from=$categories}> - <table class="index_category" cellspacing="0" width="100%"> - <tr class="head"> - <td width="3%" valign="middle" align="center"> - <img onclick="ToggleBlockCategory('<{$category.cat_element_id}>', this, '<{$category_icon.expand}>', '<{$category_icon.collapse}>')" src="<{$category.cat_icon_display}>" alt="" /> - </td> - <{if $category.cat_image}> - <td width="8%"><img src="<{$category.cat_image}>" alt="<{$category.cat_title}>" /></td> - <{/if}> -<!-- irmtfan hardcode removed align="left" --> - <td class="align_left"> - <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/index.php?cat=<{$category.cat_id}>"><{$category.cat_title}></a> - <{if $category.cat_description}><p class="desc"><{$category.cat_description}></p><{/if}> - </td> - <{if $category.cat_sponsor}> -<!-- irmtfan hardcode removed align="right" --> - <td width="15%" nowrap="nowrap" class="align_right"> - <p class="desc"><a href="<{$category.cat_sponsor.link}>" title="<{$category.cat_sponsor.title}>" target="_blank"><{$category.cat_sponsor.title}></a></p> - </td> - <{/if}> - </tr> - </table> - - <div id="<{$category.cat_element_id}>" style="display: <{$category.cat_display}>"> - <table border="0" cellspacing="2" cellpadding="0" width="100%"> - <{if $category.forums}> - <tr class="head" align="center"> - <td width="5%"> </td> - <{if $subforum_display == "expand"}> -<!-- irmtfan hardcode removed align="left" --> - <td colspan="2" width="37%" nowrap="nowrap" class="align_left"><{$smarty.const._MD_FORUM}></td> - <{else}> -<!-- irmtfan hardcode removed align="left" --> - <td width="37%" nowrap="nowrap" class="align_left"><{$smarty.const._MD_FORUM}></td> - <{/if}> - <td width="9%" nowrap="nowrap"><{$smarty.const._MD_TOPICS}></td> - <td width="9%" nowrap="nowrap"><{$smarty.const._MD_POSTS}></td> - <td width="40%" nowrap="nowrap"><{$smarty.const._MD_LASTPOST}></td> - </tr> - <{/if}> - - <!-- start forums --> - <{if $subforum_display == "expand"}> - <{foreachq item=forum from=$category.forums}> - <tr> - <td width="5%" class="even" align="center" valign="middle"><{$forum.forum_folder}></td> - <td colspan="2" class="odd"> - <div id="index_forum"> - <span class="item"><a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/viewforum.php?forum=<{$forum.forum_id}>"><{$forum.forum_name}></a> - <{if $rss_enable}> - (<a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/rss.php?f=<{$forum.forum_id}>" target="_blank" title="RSS feed">RSS</a>) - <{/if}> - <br /><{$forum.forum_desc}> - </span> - <{if $forum.forum_moderators}> - <span class="extra"> - <{$smarty.const._MD_MODERATOR}>: <{$forum.forum_moderators}> - </span> - <{/if}> - </div> - </td> - <td class="even" align="center" valign="middle"> - <{if $stats[$forum.forum_id].topic.day}><strong><{$stats[$forum.forum_id].topic.day}></strong>/<{/if}> - <{$forum.forum_topics}> - </td> - <td class="odd" align="center" valign="middle"> - <{if $stats[$forum.forum_id].post.day}><strong><{$stats[$forum.forum_id].post.day}></strong>/<{/if}> - <{$forum.forum_posts}> - </td> -<!-- irmtfan hardcode removed align="right" --> - <td class="even" class="align_right" valign="middle"> - <{if $forum.forum_lastpost_subject}> - <{$forum.forum_lastpost_time}> <{$smarty.const._MD_BY}> <{$forum.forum_lastpost_user}><br /> - <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/viewtopic.php?post_id=<{$forum.forum_lastpost_id}>"> - <{$forum.forum_lastpost_subject}> -<!-- irmtfan hardcode removed icon_path --> -<img src="<{$xoops_url}><{$forum.forum_icon_path}>/<{$forum.forum_lastpost_icon}>" alt="<{$smarty.const._MD_NEWBB_GOTOLASTPOST}>" title="<{$smarty.const._MD_NEWBB_GOTOLASTPOST}>" /> - </a> - <{else}> - <{$smarty.const._AM_NEWBB_NOTOPIC}> - <{/if}> - </td> - </tr> - - <{if $forum.subforum}> - <tr class="head" > - <td width="5%"> </td> - <td width="5%" align="center"><{$img_subforum}> </td> - <td width="32%" align="center"><{$smarty.const._MD_SUBFORUMS}> </td> - <td width="9%" nowrap="nowrap"> </td> - <td width="9%" nowrap="nowrap"> </td> - <td width="40%" nowrap="nowrap"> </td> - </tr> - <{foreachq item=subforum from=$forum.subforum}> - <tr> - <td class="odd" width="5%"> </td> - <td class="even" align="center" valign="middle" width="5%"><{$subforum.forum_folder}></td> - <td width="32%" class="odd"> - <div id="index_forum"> - <span class="item"><a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/viewforum.php?forum=<{$subforum.forum_id}>"><strong><{$subforum.forum_name}></strong></a> - <{if $rss_enable}> - (<a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/rss.php?f=<{$subforum.forum_id}>" target="_blank" title="RSS feed">RSS</a>) - <{/if}> - <br /><{$subforum.forum_desc}> - </span> - <{if $subforum.forum_moderators}> - <span class="extra"> - <{$smarty.const._MD_MODERATOR}>: <{$subforum.forum_moderators}> - </span> - <{/if}> - </div> - </td> - <td class="even" width="9%" align="center" valign="middle"> - <{if $stats[$subforum.forum_id].topic.day}><strong><{$stats[$subforum.forum_id].topic.day}></strong>/<{/if}> - <{$subforum.forum_topics}> - </td> - <td class="odd" width="9%" align="center" valign="middle"> - <{if $stats[$subforum.forum_id].post.day}><strong><{$stats[$subforum.forum_id].post.day}></strong>/<{/if}> - <{$subforum.forum_posts}> - </td> -<!-- irmtfan hardcode removed align="right" --> - - <td class="even" width="40%" class="align_right" valign="middle"> - <{if $subforum.forum_lastpost_subject}> - <{$subforum.forum_lastpost_time}> <{$smarty.const._MD_BY}> <{$subforum.forum_lastpost_user}><br /> - <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/viewtopic.php?post_id=<{$subforum.forum_lastpost_id}>"> - <{$subforum.forum_lastpost_subject}> -<!-- irmtfan hardcode removed icon_path --> -<img src="<{$xoops_url}><{$subforum.forum_icon_path}>/<{$subforum.forum_lastpost_icon}>" alt="<{$smarty.const._MD_NEWBB_GOTOLASTPOST}>" title="<{$smarty.const._MD_NEWBB_GOTOLASTPOST}>" /> - </a> - <{else}> - <{$smarty.const._AM_NEWBB_NOTOPIC}> - <{/if}> - </td> - </tr> - <{/foreach}> - <{/if}> - <{/foreach}> - - <{elseif $subforum_display == "collapse"}> - - <{foreachq item=forum from=$category.forums}> - <tr> - <{if $forum.subforum}> - <td class="even" rowspan="2" align="center" valign="middle"><{$forum.forum_folder}></td> - <{else}> - <td class="even" align="center" valign="middle"><{$forum.forum_folder}></td> - <{/if}> - <td class="odd"> - <div id="index_forum"> - <span class="item"><a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/viewforum.php?forum=<{$forum.forum_id}>"><{$forum.forum_name}></a> - <{if $rss_enable}> - (<a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/rss.php?f=<{$forum.forum_id}>" target="_blank" title="RSS feed">RSS</a>) - <{/if}> - <br /><{$forum.forum_desc}> - </span> - <{if $forum.forum_moderators}> - <span class="extra"> - <{$smarty.const._MD_MODERATOR}>: <{$forum.forum_moderators}> - </span> - <{/if}> - </div> - </td> - <td class="even" align="center" valign="middle"> - <{if $stats[$forum.forum_id].topic.day}><strong><{$stats[$forum.forum_id].topic.day}></strong>/<{/if}> - <{$forum.forum_topics}> - </td> - <td class="odd" align="center" valign="middle"> - <{if $stats[$forum.forum_id].post.day}><strong><{$stats[$forum.forum_id].post.day}></strong>/<{/if}> - <{$forum.forum_posts}> - </td> -<!-- irmtfan hardcode removed align="right" --> - <td class="even" class="align_right" valign="middle"> - <{if $forum.forum_lastpost_subject}> - <{$forum.forum_lastpost_time}> <{$smarty.const._MD_BY}> <{$forum.forum_lastpost_user}><br /> - <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/viewtopic.php?post_id=<{$forum.forum_lastpost_id}>"> - <{$forum.forum_lastpost_subject}> -<!-- irmtfan hardcode removed icon_path --> -<img src="<{$xoops_url}><{$forum.forum_icon_path}>/<{$forum.forum_lastpost_icon}>" alt="<{$smarty.const._MD_NEWBB_GOTOLASTPOST}>" title="<{$smarty.const._MD_NEWBB_GOTOLASTPOST}>" /> - </a> - <{else}> - <{$smarty.const._AM_NEWBB_NOTOPIC}> - <{/if}> - </td> - </tr> - - <{if $forum.subforum}> - <tr> -<!-- irmtfan hardcode removed align="left" --> - - <td class="odd" colspan="4" class="align_left"><{$smarty.const._MD_SUBFORUMS}> <{$img_subforum}> - <{foreachq item=subforum from=$forum.subforum}> - [<a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/viewforum.php?forum=<{$subforum.forum_id}>"><{$subforum.forum_name}></a>] - <{/foreach}> - </td> - </tr> - <{/if}> - <{/foreach}> - - <{else}> - - <{foreachq item=forum from=$category.forums}> - <tr> - <td class="even" align="center" valign="middle"><{$forum.forum_folder}></td> - <td class="odd"> - <div id="index_forum"> - <span class="item"><a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/viewforum.php?forum=<{$forum.forum_id}>"><{$forum.forum_name}></a> - <{if $rss_enable}> - (<a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/rss.php?f=<{$forum.forum_id}>" target="_blank" title="RSS feed">RSS</a>) - <{/if}> - <br /><{$forum.forum_desc}> - </span> - <{if $forum.forum_moderators}> - <span class="extra"> - <{$smarty.const._MD_MODERATOR}>: <{$forum.forum_moderators}> - </span> - <{/if}> - </div> - </td> - <td class="even" align="center" valign="middle"> - <{if $stats[$forum.forum_id].topic.day}><strong><{$stats[$forum.forum_id].topic.day}></strong>/<{/if}> - <{$forum.forum_topics}> - </td> - <td class="odd" align="center" valign="middle"> - <{if $stats[$forum.forum_id].post.day}><strong><{$stats[$forum.forum_id].post.day}></strong>/<{/if}> - <{$forum.forum_posts}> - </td> -<!-- irmtfan hardcode removed align="right" --> - <td class="even" class="align_right" valign="middle"> - <{if $forum.forum_lastpost_subject}> - <{$forum.forum_lastpost_time}> <{$smarty.const._MD_BY}> <{$forum.forum_lastpost_user}><br /> - <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/viewtopic.php?post_id=<{$forum.forum_lastpost_id}>"> - <{$forum.forum_lastpost_subject}> -<!-- irmtfan hardcode removed icon_path --> -<img src="<{$xoops_url}><{$forum.forum_icon_path}>/<{$forum.forum_lastpost_icon}>" alt="<{$smarty.const._MD_NEWBB_GOTOLASTPOST}>" title="<{$smarty.const._MD_NEWBB_GOTOLASTPOST}>" /> - </a> - <{else}> - <{$smarty.const._AM_NEWBB_NOTOPIC}> - <{/if}> - </td> - </tr> - <{/foreach}> - - <{/if}> - <!-- end forums --> - </table> - <br /> - </div> - <{/foreach}> - <!-- end forum categories --> -</div> -<!-- irmtfan hardcode removed style="float: left; text-align: left;" --> -<div class="icon_left"> - <{$img_forum_new}> = <{$smarty.const._MD_NEWPOSTS}><br /> - <{$img_forum}> = <{$smarty.const._MD_NONEWPOSTS}><br /> -</div> -<br style="clear:both;"/> -<!-- irmtfan hardcode removed style="float: right; text-align: right;" --> -<div class="icon_right"> - <form action="<{$xoops_url}>/modules/<{$xoops_dirname}>/search.php" method="post" name="search" id="search"> - <input name="term" id="term" type="text" size="20" /> - <input type="hidden" name="forum" id="forum" value="all" /> - <input type="hidden" name="sortby" id="sortby" value="p.post_time desc" /> - <input type="hidden" name="searchin" id="searchin" value="both" /> - <input type="submit" name="submit" id="submit" value="<{$smarty.const._MD_SEARCH}>" /> - <br /> - [ <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/search.php"><{$smarty.const._MD_ADVSEARCH}></a> ] - </form> - <{if $rss_button}> - <br /> - <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/rss.php?c=<{$viewcat}>" target="_blank" title="RSS FEED"> - <{$rss_button}> - </a> - <br /><font size="0.7em;"><a href="http://www.simple-xoops.de">NewBB Version <{$version/100}></a></font> - <br /> - <{/if}> -</div> -<br style="clear: both;" /> -<{if $currenttime}> - <div> - <div class="even" style="padding: 5px; line-height: 150%;"> - <span style="padding: 2px;"><{$online.statistik}></span> - <strong><{$smarty.const._MD_NEWBB_STATS}></strong> - </div> - - <div class="forum_stats odd" style="padding: 5px; line-height: 150%;"> - <div class="forum_stats_left odd"> - <{$currenttime}><br /> - <{$smarty.const._MD_TOTALTOPICSC}> - <strong><a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/list.topic.php" title="<{$smarty.const._MD_ALL}>"><{$stats[0].topic.total}></a></strong> - | <{$smarty.const._MD_TOTALPOSTSC}><strong><a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/viewpost.php" title="<{$smarty.const._MD_ALLPOSTS}>"><{$stats[0].post.total}></a></strong> - <{if $stats[0].digest.total}> - | <{$smarty.const._MD_TOTALDIGESTSC}><strong><a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/list.topic.php?status=digest" title="<{$smarty.const._MD_TOTALDIGESTSC}>"><{$stats[0].digest.total}></a></strong> - <{/if}> - <{if $userstats}> - <br /><br /> - <{$userstats.lastvisit}><br /><{$userstats.lastpost}> - <{/if}> - </div> - <div class="forum_stats_right odd"> - <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/viewpost.php?status=new" title="<{$smarty.const._MD_VIEW_NEWPOSTS}>"><{$smarty.const._MD_VIEW_NEWPOSTS}></a><br /> - <{$smarty.const._MD_TODAYTOPICSC}><strong><{$stats[0].topic.day|default:0}></strong> - | <{$smarty.const._MD_TODAYPOSTSC}><strong><{$stats[0].post.day|default:0}></strong> - <{if $userstats}> - <br /><br /> - <{$userstats.topics}> | <{$userstats.posts}><{if $userstats.digests}><br /><{$userstats.digests}><{/if}> - <{/if}> - </div> - </div> - </div> - <br style="clear:both;"/> -<{/if}> -<br style="clear: both;" /> -<{if $online}> - <{includeq file="db:newbb_online.html"}> -<{/if}> -<{includeq file='db:newbb_notification_select.html'}> +<div class="forum_header"> +<!-- irmtfan hardcode remove style="float: left;" --> + <div class="forum_title"> + <h2><a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/index.php"><{$index_title}></a></h2> +<!-- irmtfan hardcode remove align="left" --> + <hr class="align_left" width="50%" size="1" /> + <{$index_desc}> + </div> +</div> +<div style="clear:both;"></div> + +<{if $viewer_level gt 1}> + <br /> + <div class="forum_stats"> + <div class="forum_stats_left"> + <{$smarty.const._MD_TOPIC}>: + <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/list.topic.php?status=active#admin" target="_self" title="<{$smarty.const._MD_TYPE_ADMIN}>"><{$smarty.const._MD_TYPE_ADMIN}></a> | + <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/list.topic.php?status=pending#admin" target="_self" title="<{$smarty.const._MD_TYPE_PENDING}>"><{if $wait_new_topic}>(<font color="red"><b><{$wait_new_topic}></b></font>) <{/if}><{$smarty.const._MD_TYPE_PENDING}></a> | + <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/list.topic.php?status=deleted#admin" target="_self" title="<{$smarty.const._MD_TYPE_DELETED}>"><{if $delete_topic}>(<font color="red"><b><{$delete_topic}></b></font>) <{/if}><{$smarty.const._MD_TYPE_DELETED}></a><br /> + <{$smarty.const._MD_POST2}>: + <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/viewpost.php?status=active#admin" target="_self" title="<{$smarty.const._MD_TYPE_ADMIN}>"><{$smarty.const._MD_TYPE_ADMIN}></a> | + <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/viewpost.php?status=pending#admin" target="_self" title="<{$smarty.const._MD_TYPE_PENDING}>"><{if $wait_new_post}>(<font color="red"><b><{$wait_new_post}></b></font>) <{/if}><{$smarty.const._MD_TYPE_PENDING}></a> | + <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/viewpost.php?status=deleted#admin" target="_self" title="<{$smarty.const._MD_TYPE_DELETED}>"><{if $delete_post}>(<font color="red"><b><{$delete_post}></b></font>) <{/if}><{$smarty.const._MD_TYPE_DELETED}></a> + </div> + <div class="forum_stats_right"> + <{if $report_post}><a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/admin/admin_report.php"><{$report_post}></a><{/if}> + <br /><a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/moderate.php" target="_self" title="<{$smarty.const._MD_TYPE_SUSPEND}>"><{$smarty.const._MD_TYPE_SUSPEND}></a> | + <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/admin/index.php" target="_self" title="<{$smarty.const._MD_ADMINCP}>"><{$smarty.const._MD_ADMINCP}></a> + </div> + <div style="clear:both;"></div> + </div> +<{/if}> +<br style="clear: both;" /> +<div class="dropdown"> + <{includeq file="db:newbb_index_menu.html"}> +</div> +<br style="clear: both;" /> +<br /> + +<!-- start forum categories --> +<div class="index_category"> + <!-- start forum categories --> + <{foreachq item=category from=$categories}> + <table class="index_category" cellspacing="0" width="100%"> + <tr class="head"> + <td width="3%" valign="middle" align="center"> + <img onclick="ToggleBlockCategory('<{$category.cat_element_id}>', this, '<{$category_icon.expand}>', '<{$category_icon.collapse}>')" src="<{$category.cat_icon_display}>" alt="" /> + </td> + <{if $category.cat_image}> + <td width="8%"><img src="<{$category.cat_image}>" alt="<{$category.cat_title}>" /></td> + <{/if}> +<!-- irmtfan hardcode removed align="left" --> + <td class="align_left"> + <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/index.php?cat=<{$category.cat_id}>"><{$category.cat_title}></a> + <{if $category.cat_description}><p class="desc"><{$category.cat_description}></p><{/if}> + </td> + <{if $category.cat_sponsor}> +<!-- irmtfan hardcode removed align="right" --> + <td width="15%" nowrap="nowrap" class="align_right"> + <p class="desc"><a href="<{$category.cat_sponsor.link}>" title="<{$category.cat_sponsor.title}>" target="_blank"><{$category.cat_sponsor.title}></a></p> + </td> + <{/if}> + </tr> + </table> + + <div id="<{$category.cat_element_id}>" style="display: <{$category.cat_display}>"> + <table border="0" cellspacing="2" cellpadding="0" width="100%"> + <{if $category.forums}> + <tr class="head" align="center"> + <td width="5%"> </td> + <{if $subforum_display == "expand"}> +<!-- irmtfan hardcode removed align="left" --> + <td colspan="2" width="37%" nowrap="nowrap" class="align_left"><{$smarty.const._MD_FORUM}></td> + <{else}> +<!-- irmtfan hardcode removed align="left" --> + <td width="37%" nowrap="nowrap" class="align_left"><{$smarty.const._MD_FORUM}></td> + <{/if}> + <td width="9%" nowrap="nowrap"><{$smarty.const._MD_TOPICS}></td> + <td width="9%" nowrap="nowrap"><{$smarty.const._MD_POSTS}></td> + <td width="40%" nowrap="nowrap"><{$smarty.const._MD_LASTPOST}></td> + </tr> + <{/if}> + + <!-- start forums --> + <{if $subforum_display == "expand"}> + <{foreachq item=forum from=$category.forums}> + <tr> + <td width="5%" class="even" align="center" valign="middle"><{$forum.forum_folder}></td> + <td colspan="2" class="odd"> + <div id="index_forum"> + <span class="item"><a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/viewforum.php?forum=<{$forum.forum_id}>"><{$forum.forum_name}></a> + <{if $rss_enable}> + (<a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/rss.php?f=<{$forum.forum_id}>" target="_blank" title="RSS feed">RSS</a>) + <{/if}> + <br /><{$forum.forum_desc}> + </span> + <{if $forum.forum_moderators}> + <span class="extra"> + <{$smarty.const._MD_MODERATOR}>: <{$forum.forum_moderators}> + </span> + <{/if}> + </div> + </td> + <td class="even" align="center" valign="middle"> + <{if $stats[$forum.forum_id].topic.day}><strong><{$stats[$forum.forum_id].topic.day}></strong>/<{/if}> + <{$forum.forum_topics}> + </td> + <td class="odd" align="center" valign="middle"> + <{if $stats[$forum.forum_id].post.day}><strong><{$stats[$forum.forum_id].post.day}></strong>/<{/if}> + <{$forum.forum_posts}> + </td> +<!-- irmtfan hardcode removed align="right" --> + <td class="even" class="align_right" valign="middle"> + <{if $forum.forum_lastpost_subject}> + <{$forum.forum_lastpost_time}> <{$smarty.const._MD_BY}> <{$forum.forum_lastpost_user}><br /> + <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/viewtopic.php?post_id=<{$forum.forum_lastpost_id}>"> + <{$forum.forum_lastpost_subject}> +<!-- irmtfan remove icon_path --> +<{$forum.forum_lastpost_icon}> + </a> + <{else}> + <{$smarty.const._AM_NEWBB_NOTOPIC}> + <{/if}> + </td> + </tr> + + <{if $forum.subforum}> + <tr class="head" > + <td width="5%"> </td> + <td width="5%" align="center"><{$img_subforum}> </td> + <td width="32%" align="center"><{$smarty.const._MD_SUBFORUMS}> </td> + <td width="9%" nowrap="nowrap"> </td> + <td width="9%" nowrap="nowrap"> </td> + <td width="40%" nowrap="nowrap"> </td> + </tr> + <{foreachq item=subforum from=$forum.subforum}> + <tr> + <td class="odd" width="5%"> </td> + <td class="even" align="center" valign="middle" width="5%"><{$subforum.forum_folder}></td> + <td width="32%" class="odd"> + <div id="index_forum"> + <span class="item"><a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/viewforum.php?forum=<{$subforum.forum_id}>"><strong><{$subforum.forum_name}></strong></a> + <{if $rss_enable}> + (<a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/rss.php?f=<{$subforum.forum_id}>" target="_blank" title="RSS feed">RSS</a>) + <{/if}> + <br /><{$subforum.forum_desc}> + </span> + <{if $subforum.forum_moderators}> + <span class="extra"> + <{$smarty.const._MD_MODERATOR}>: <{$subforum.forum_moderators}> + </span> + <{/if}> + </div> + </td> + <td class="even" width="9%" align="center" valign="middle"> + <{if $stats[$subforum.forum_id].topic.day}><strong><{$stats[$subforum.forum_id].topic.day}></strong>/<{/if}> + <{$subforum.forum_topics}> + </td> + <td class="odd" width="9%" align="center" valign="middle"> + <{if $stats[$subforum.forum_id].post.day}><strong><{$stats[$subforum.forum_id].post.day}></strong>/<{/if}> + <{$subforum.forum_posts}> + </td> +<!-- irmtfan hardcode removed align="right" --> + + <td class="even" width="40%" class="align_right" valign="middle"> + <{if $subforum.forum_lastpost_subject}> + <{$subforum.forum_lastpost_time}> <{$smarty.const._MD_BY}> <{$subforum.forum_lastpost_user}><br /> + <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/viewtopic.php?post_id=<{$subforum.forum_lastpost_id}>"> + <{$subforum.forum_lastpost_subject}> +<!-- irmtfan remove icon_path --> +<{$subforum.forum_lastpost_icon}> + </a> + <{else}> + <{$smarty.const._AM_NEWBB_NOTOPIC}> + <{/if}> + </td> + </tr> + <{/foreach}> + <{/if}> + <{/foreach}> + + <{elseif $subforum_display == "collapse"}> + + <{foreachq item=forum from=$category.forums}> + <tr> + <{if $forum.subforum}> + <td class="even" rowspan="2" align="center" valign="middle"><{$forum.forum_folder}></td> + <{else}> + <td class="even" align="center" valign="middle"><{$forum.forum_folder}></td> + <{/if}> + <td class="odd"> + <div id="index_forum"> + <span class="item"><a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/viewforum.php?forum=<{$forum.forum_id}>"><{$forum.forum_name}></a> + <{if $rss_enable}> + (<a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/rss.php?f=<{$forum.forum_id}>" target="_blank" title="RSS feed">RSS</a>) + <{/if}> + <br /><{$forum.forum_desc}> + </span> + <{if $forum.forum_moderators}> + <span class="extra"> + <{$smarty.const._MD_MODERATOR}>: <{$forum.forum_moderators}> + </span> + <{/if}> + </div> + </td> + <td class="even" align="center" valign="middle"> + <{if $stats[$forum.forum_id].topic.day}><strong><{$stats[$forum.forum_id].topic.day}></strong>/<{/if}> + <{$forum.forum_topics}> + </td> + <td class="odd" align="center" valign="middle"> + <{if $stats[$forum.forum_id].post.day}><strong><{$stats[$forum.forum_id].post.day}></strong>/<{/if}> + <{$forum.forum_posts}> + </td> +<!-- irmtfan hardcode removed align="right" --> + <td class="even" class="align_right" valign="middle"> + <{if $forum.forum_lastpost_subject}> + <{$forum.forum_lastpost_time}> <{$smarty.const._MD_BY}> <{$forum.forum_lastpost_user}><br /> + <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/viewtopic.php?post_id=<{$forum.forum_lastpost_id}>"> + <{$forum.forum_lastpost_subject}> +<!-- irmtfan remove icon_path --> +<{$forum.forum_lastpost_icon}> + </a> + <{else}> + <{$smarty.const._AM_NEWBB_NOTOPIC}> + <{/if}> + </td> + </tr> + + <{if $forum.subforum}> + <tr> +<!-- irmtfan hardcode removed align="left" --> + + <td class="odd" colspan="4" class="align_left"><{$smarty.const._MD_SUBFORUMS}> <{$img_subforum}> + <{foreachq item=subforum from=$forum.subforum}> + [<a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/viewforum.php?forum=<{$subforum.forum_id}>"><{$subforum.forum_name}></a>] + <{/foreach}> + </td> + </tr> + <{/if}> + <{/foreach}> + + <{else}> + + <{foreachq item=forum from=$category.forums}> + <tr> + <td class="even" align="center" valign="middle"><{$forum.forum_folder}></td> + <td class="odd"> + <div id="index_forum"> + <span class="item"><a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/viewforum.php?forum=<{$forum.forum_id}>"><{$forum.forum_name}></a> + <{if $rss_enable}> + (<a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/rss.php?f=<{$forum.forum_id}>" target="_blank" title="RSS feed">RSS</a>) + <{/if}> + <br /><{$forum.forum_desc}> + </span> + <{if $forum.forum_moderators}> + <span class="extra"> + <{$smarty.const._MD_MODERATOR}>: <{$forum.forum_moderators}> + </span> + <{/if}> + </div> + </td> + <td class="even" align="center" valign="middle"> + <{if $stats[$forum.forum_id].topic.day}><strong><{$stats[$forum.forum_id].topic.day}></strong>/<{/if}> + <{$forum.forum_topics}> + </td> + <td class="odd" align="center" valign="middle"> + <{if $stats[$forum.forum_id].post.day}><strong><{$stats[$forum.forum_id].post.day}></strong>/<{/if}> + <{$forum.forum_posts}> + </td> +<!-- irmtfan hardcode removed align="right" --> + <td class="even" class="align_right" valign="middle"> + <{if $forum.forum_lastpost_subject}> + <{$forum.forum_lastpost_time}> <{$smarty.const._MD_BY}> <{$forum.forum_lastpost_user}><br /> + <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/viewtopic.php?post_id=<{$forum.forum_lastpost_id}>"> + <{$forum.forum_lastpost_subject}> +<!-- irmtfan remove icon_path --> +<{$forum.forum_lastpost_icon}> + </a> + <{else}> + <{$smarty.const._AM_NEWBB_NOTOPIC}> + <{/if}> + </td> + </tr> + <{/foreach}> + + <{/if}> + <!-- end forums --> + </table> + <br /> + </div> + <{/foreach}> + <!-- end forum categories --> +</div> +<!-- irmtfan hardcode removed style="float: left; text-align: left;" --> +<div class="icon_left"> + <{$img_forum_new}> = <{$smarty.const._MD_NEWPOSTS}><br /> + <{$img_forum}> = <{$smarty.const._MD_NONEWPOSTS}><br /> +</div> +<br style="clear:both;"/> +<!-- irmtfan hardcode removed style="float: right; text-align: right;" --> +<div class="icon_right"> + <form action="<{$xoops_url}>/modules/<{$xoops_dirname}>/search.php" method="post" name="search" id="search"> + <input name="term" id="term" type="text" size="20" /> + <input type="hidden" name="forum" id="forum" value="all" /> + <input type="hidden" name="sortby" id="sortby" value="p.post_time desc" /> + <input type="hidden" name="searchin" id="searchin" value="both" /> + <input type="submit" name="submit" id="submit" value="<{$smarty.const._MD_SEARCH}>" /> + <br /> + [ <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/search.php"><{$smarty.const._MD_ADVSEARCH}></a> ] + </form> + <{if $rss_button}> + <br /> + <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/rss.php?c=<{$viewcat}>" target="_blank" title="RSS FEED"> + <{$rss_button}> + </a> + <br /><font size="0.7em;"><a href="http://www.simple-xoops.de">NewBB Version <{$version/100}></a></font> + <br /> + <{/if}> +</div> +<br style="clear: both;" /> +<{if $currenttime}> + <div> + <div class="even" style="padding: 5px; line-height: 150%;"> + <span style="padding: 2px;"><{$online.statistik}></span> + <strong><{$smarty.const._MD_NEWBB_STATS}></strong> + </div> + + <div class="forum_stats odd" style="padding: 5px; line-height: 150%;"> + <div class="forum_stats_left odd"> + <{$currenttime}><br /> + <{$smarty.const._MD_TOTALTOPICSC}> + <strong><a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/list.topic.php" title="<{$smarty.const._MD_ALL}>"><{$stats[0].topic.total}></a></strong> + | <{$smarty.const._MD_TOTALPOSTSC}><strong><a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/viewpost.php" title="<{$smarty.const._MD_ALLPOSTS}>"><{$stats[0].post.total}></a></strong> + <{if $stats[0].digest.total}> + | <{$smarty.const._MD_TOTALDIGESTSC}><strong><a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/list.topic.php?status=digest" title="<{$smarty.const._MD_TOTALDIGESTSC}>"><{$stats[0].digest.total}></a></strong> + <{/if}> + <{if $userstats}> + <br /><br /> + <{$userstats.lastvisit}><br /><{$userstats.lastpost}> + <{/if}> + </div> + <div class="forum_stats_right odd"> + <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/viewpost.php?status=new" title="<{$smarty.const._MD_VIEW_NEWPOSTS}>"><{$smarty.const._MD_VIEW_NEWPOSTS}></a><br /> + <{$smarty.const._MD_TODAYTOPICSC}><strong><{$stats[0].topic.day|default:0}></strong> + | <{$smarty.const._MD_TODAYPOSTSC}><strong><{$stats[0].post.day|default:0}></strong> + <{if $userstats}> + <br /><br /> + <{$userstats.topics}> | <{$userstats.posts}><{if $userstats.digests}><br /><{$userstats.digests}><{/if}> + <{/if}> + </div> + </div> + </div> + <br style="clear:both;"/> +<{/if}> +<br style="clear: both;" /> +<{if $online}> + <{includeq file="db:newbb_online.html"}> +<{/if}> +<{includeq file='db:newbb_notification_select.html'}> <!-- end module contents --> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_thread.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_thread.html 2012-08-26 19:06:53 UTC (rev 10121) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_thread.html 2012-08-27 08:04:06 UTC (rev 10122) @@ -28,14 +28,20 @@ <{if $topic_post.poster.avatar != "blank.gif"}> <br /><img class="comUserImg" src="<{$xoops_upload_url}>/<{$topic_post.poster.avatar}>" alt="" /> <{else}> -<!-- irmtfan hardcode removed icon_path --> - <br /><img class="comUserImg" src="<{$xoops_url}><{$icon_path}>/anonym.png" alt="" /> +<!-- irmtfan remove icon_path --> + <br /><{$anonym_avatar}> <{/if}> <br /> - <{if $infobox gt 0}> - <div> -<!-- irmtfan hardcode removed icon_path --> - <img style="padding:2px;" onclick="ToggleBlockCategory('<{$topic_post.post_id}>', this, '<{$xoops_url}><{$icon_path}>/more.png', '<{$xoops_url}><{$icon_path}>/more.png')" src="<{$xoops_url}><{$icon_path}>/more.png" alt="<{$smarty.const._MD_NEWBB_SEEUSERDATA}>" title="<{$smarty.const._MD_NEWBB_SEEUSERDATA}>" /> + <{if $infobox gt 0}> + <!-- irmtfan simplify onclick method remove hardcode style="padding:2px;"--> + <div class="pointer"> + <img onclick="ToggleBlockCategory('<{$topic_post.post_id}>', this, '<{$xoops_url}><{$icon_path}>/less.png', '<{$xoops_url}><{$icon_path}>/more.png','<{$smarty.const._MD_NEWBB_HIDEUSERDATA}>','<{$smarty.const._MD_NEWBB_SEEUSERDATA}>')" + <{if $infobox == 1}> + src="<{$xoops_url}><{$icon_path}>/more.png" alt="<{$smarty.const._MD_NEWBB_SEEUSERDATA}>" title="<{$smarty.const._MD_NEWBB_SEEUSERDATA}>" + <{else}> + src="<{$xoops_url}><{$icon_path}>/less.png" alt="<{$smarty.const._MD_NEWBB_HIDEUSERDATA}>" title="<{$smarty.const._MD_NEWBB_HIDEUSERDATA}>" + <{/if}> + /> </div> <div id="<{$topic_post.post_id}>" <{if $infobox == 1}> style="display: none;" @@ -126,8 +132,9 @@ <!-- irmtfan removed hardcode style="text-align:left;" --> <td class="left"> <{if $topic_post.thread_action}> - <{foreachq item=btn from=$topic_post.thread_action}> - <a href="<{$btn.link}>&post_id=<{$topic_post.post_id}>" title="<{$btn.name}>" <{if $btn.target}>target="<{$btn.target}>"<{/if}>> <{$btn.image}></a> + <{foreachq item=btn from=$topic_post.thread_action}> + <!-- irmtfan add alt key --> + <a href="<{$btn.link}>&post_id=<{$topic_post.post_id}>" alt="<{$btn.name}>" title="<{$btn.name}>" <{if $btn.target}>target="<{$btn.target}>"<{/if}>> <{$btn.image}></a> <{/foreach}> <{/if}> </td> @@ -140,8 +147,9 @@ <input type="checkbox" name="post_id[]" id="post_id[<{$topic_post.post_id}>]" value="<{$topic_post.post_id}>" /> <{else}> <{if $topic_post.thread_buttons}> - <{foreachq item=btn from=$topic_post.thread_buttons}> - <a href="<{$btn.link}>&post_id=<{$topic_post.post_id}>" title="<{$btn.name}>"> <{$btn.image}></a> + <{foreachq item=btn from=$topic_post.thread_buttons}> + <!-- irmtfan add alt key --> + <a href="<{$btn.link}>&post_id=<{$topic_post.post_id}>" alt="<{$btn.name}>" title="<{$btn.name}>"> <{$btn.image}></a> <{/foreach}> <{/if}> <{/if}> Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewforum_subforum.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewforum_subforum.html 2012-08-26 19:06:53 UTC (rev 10121) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewforum_subforum.html 2012-08-27 08:04:06 UTC (rev 10122) @@ -29,8 +29,8 @@ <{$sforum.forum_lastpost_time}> <{$smarty.const._MD_BY}> <{$sforum.forum_lastpost_user}><br /> <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/viewtopic.php?post_id=<{$sforum.forum_lastpost_id}>"> <{$sforum.forum_lastpost_subject}> -<!-- irmtfan hardcode removed icon_path --> -<img src="<{$xoops_url}><{$sforum.forum_icon_path}>/<{$sforum.forum_lastpost_icon}>" alt="<{$smarty.const._MD_NEWBB_GOTOLASTPOST}>" title="<{$smarty.const._MD_NEWBB_GOTOLASTPOST}>" /> +<!-- irmtfan removed icon_path --> +<{$sforum.forum_lastpost_icon}> </a> <{else}> <{$smarty.const._MD_NONEWPOSTS}> Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html 2012-08-26 19:06:53 UTC (rev 10121) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html 2012-08-27 08:04:06 UTC (rev 10122) @@ -95,7 +95,7 @@ </span> <!-- irmtfan hardcode removed style="float: right; text-align:right;"" --> <span class="icon_right"> - <{$forum_reply}><{$forum_addpoll}> <{$forum_post_or_register}> + <{$forum_reply}> <{$forum_addpoll}> <{$forum_post_or_register}> </span> </div> <div class="clear"></div> Modified: XoopsModules/newbb/branches/irmtfan/newbb/viewpost.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/viewpost.php 2012-08-26 19:06:53 UTC (rev 10121) +++ XoopsModules/newbb/branches/irmtfan/newbb/viewpost.php 2012-08-27 08:04:06 UTC (rev 10122) @@ -175,8 +175,8 @@ } $xoopsTpl->assign('xoops_module_header', $xoops_module_header); $xoopsTpl->assign('xoops_pagetitle', $xoops_pagetitle); -$icon_handler = newbb_getIconHandler(); -$xoopsTpl->assign("icon_path", $icon_handler->getPath("icon")); +// irmtfan - remove icon_path and use newbb_displayImage +$xoopsTpl->assign("anonym_avatar", newbb_displayImage('anonym')); $userid_array=array(); if (count($poster_array)>0) { $member_handler =& xoops_gethandler('member'); Modified: XoopsModules/newbb/branches/irmtfan/newbb/viewtopic.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/viewtopic.php 2012-08-26 19:06:53 UTC (rev 10121) +++ XoopsModules/newbb/branches/irmtfan/newbb/viewtopic.php 2012-08-27 08:04:06 UTC (rev 10122) @@ -131,6 +131,9 @@ $infobox = intval($xoopsModuleConfig['show_infobox']); //4.05 $xoopsTpl->assign('infobox', $infobox); //4.05 $xoopsTpl->assign("parentforum", $forum_handler->getParents($forum_obj)); +// irmtfan - remove icon_path and use newbb_displayImage +$xoopsTpl->assign("anonym_avatar", newbb_displayImage('anonym')); +// icon_path use for infobox onclick image more/less $icon_handler = newbb_getIconHandler(); $xoopsTpl->assign("icon_path", $icon_handler->getPath("icon")); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ir...@us...> - 2012-08-28 07:36:42
|
Revision: 10124 http://xoops.svn.sourceforge.net/xoops/?rev=10124&view=rev Author: irmtfan Date: 2012-08-28 07:36:30 +0000 (Tue, 28 Aug 2012) Log Message: ----------- improve text links - add display.php to the package Modified Paths: -------------- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt XoopsModules/newbb/branches/irmtfan/newbb/class/icon.php XoopsModules/newbb/branches/irmtfan/newbb/include/functions.render.php XoopsModules/newbb/branches/irmtfan/newbb/include/plugin.php Added Paths: ----------- XoopsModules/newbb/branches/irmtfan/newbb/include/display.php Modified: XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt 2012-08-27 11:18:20 UTC (rev 10123) +++ XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt 2012-08-28 07:36:30 UTC (rev 10124) @@ -1,3 +1,11 @@ +date 2012-08-28 +================================================ +1- improve text link instead of buttons feature. Ability to set the display setting for each link in newbb/include/display.php +newbb/include/plugin.php, newbb/include/display.php, newbb/include/functions.render.php + +2- add id={$image} for <img> html tag +newbb/class/icon.php + date: 2012-08-27 - 2 ================================================ 1- improve text link instead of buttons to only show text buttons when: a) alt key is set b)display is not set to true c)only buttons like reply, edit Modified: XoopsModules/newbb/branches/irmtfan/newbb/class/icon.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/class/icon.php 2012-08-27 11:18:20 UTC (rev 10123) +++ XoopsModules/newbb/branches/irmtfan/newbb/class/icon.php 2012-08-28 07:36:30 UTC (rev 10124) @@ -129,7 +129,8 @@ { if (!isset($this->images[$image])) { $image_src = $this->getImageSource($image); - $this->images[$image] = "<img src=\"{$image_src}\" alt=\"{$alt}\" title=\"{$alt}\" align=\"middle\" {$extra} />"; + // irmtfan add id={$image} + $this->images[$image] = "<img src=\"{$image_src}\" alt=\"{$alt}\" title=\"{$alt}\" align=\"middle\" {$extra} id={$image} />"; } } Added: XoopsModules/newbb/branches/irmtfan/newbb/include/display.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/include/display.php (rev 0) +++ XoopsModules/newbb/branches/irmtfan/newbb/include/display.php 2012-08-28 07:36:30 UTC (rev 10124) @@ -0,0 +1,237 @@ +<?php +/** + * CBB 4.0, or newbb, the forum module for XOOPS project + * + * @copyright The XOOPS Project http://xoops.sf.net + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @author Taiwen Jiang (phppp or D.J.) <ph...@us...>, irmtfan <ir...@us...> + * @since 4.3 + * @version $Id $ + * @package module::newbb + */ + +/* + 1- Dispaly Text links instead of images and vice versa => text links=true/images=false + The overall value is defined in include/plugin.php $customConfig["display_text_links"]. + It means if you set $customConfig["display_text_links"] to true it will show all images in text links (and vice versa) + You can overwrite that overall value here for each link one by one. + If you change any setting in this file: + - the image will be shown in text (if set to true) OR, + - the text link will be shown as image (if set to false) + regardless of setting of $customConfig["display_text_links"] + =============================================================== + Find images in newbb/templates/images + =============================================================== + * Priority for image path OR style.css path: + * NEWBB_ROOT - IF EXISTS XOOPS_THEME/modules/newbb/images/, TAKE IT; + * ELSEIF EXISTS XOOPS_THEME_DEFAULT/modules/newbb/images/, TAKE IT; + * ELSE TAKE XOOPS_ROOT/modules/newbb/templates/images/. + =============================================================== + 2- If you choose to show text links (set to true): + 2-1- customize the text show in style.css with the help of class="forum_icon" id=$image_name + eg: + For buttons: + all buttons: + button.forum_icon + button.forum_icon:hover + button.forum_icon:active + + each button (p_edit): + button.forum_icon#p_edit + button.forum_icon#p_edit:hover + button.forum_icon#p_edit:active + + For other images: + all images: + span.forum_icon + span.forum_icon:hover + span.forum_icon:active + each image (pdf): + span.forum_icon#pdf + span.forum_icon#pdf:hover + span.forum_icon#pdf:active + + 2-2- no style means plain text links + + 3- If you choose to show images (set to false): + 3-1- customize the image show in style.css with the help of class="forum_icon" id=$image_name + all images: + img.forum_icon + img.forum_icon:hover + img.forum_icon:active + + each image (p_edit): + img.forum_icon#p_edit + img.forum_icon#p_edit:hover + img.forum_icon#p_edit:active + 3-2- no style means just image +*/ + +// uncomment to show text link instead of images (set to true) +$displayText[''] = +//$displayText['blank'] = + +//$displayText['attachment'] = +//$displayText['whosonline'] = +//$displayText['statistik'] = +//$displayText['lastposticon'] = + +//$displayText['plus'] = +//$displayText['minus'] = + +//$displayText['forum'] = +//$displayText['forum_new'] = + +//$displayText['topic'] = +//$displayText['topic_hot'] = +//$displayText['topic_sticky'] = +//$displayText['topic_digest'] = +//$displayText['topic_locked'] = +//$displayText['topic_new'] = +//$displayText['topic_hot_new'] = +//$displayText['topic_my'] = + +//$displayText['post'] = + +//$displayText['poll'] = +//$displayText['rss'] = +//$displayText['pdf'] = +//$displayText['subforum'] = + +//$displayText['admin_move'] = +//$displayText['admin_merge'] = +//$displayText['admin_edit'] = +//$displayText['admin_delete'] = + +//$displayText['document'] = + +//$displayText['previous'] = +//$displayText['next'] = +//$displayText['right'] = +//$displayText['down'] = +//$displayText['up'] = +//$displayText['printer'] = +//$displayText['new_forum'] = + +//$displayText['facebook'] = +//$displayText['twitter'] = +//$displayText['linkedin'] = +//$displayText['googleplus'] = +//$displayText['stumbleupon'] = +//$displayText['friendfeed'] = +//$displayText['digg'] = +//$displayText['reddit'] = +//$displayText['delicious'] = +//$displayText['technorati'] = +//$displayText['wong'] = +//$displayText['anonym'] = + +$displayText['p_delete'] = +$displayText['p_reply'] = +$displayText['p_quote'] = +$displayText['p_edit'] = +$displayText['p_report'] = + +$displayText['t_new'] = +$displayText['t_poll'] = +$displayText['t_qr'] = +$displayText['t_reply'] = + +//$displayText['online'] = +//$displayText['offline'] = + +//$displayText['new_subforum'] = + +$displayText['p_bann'] = + +true; + +for($i = 1; $i <= 5; $i++ ) { + //$displayText['rate'.$i] = true; +} + +// uncomment to show images instead of text links (set to false) +$displayText[''] = +//$displayText['blank'] = + +//$displayText['attachment'] = +//$displayText['whosonline'] = +//$displayText['statistik'] = +//$displayText['lastposticon'] = + +//$displayText['plus'] = +//$displayText['minus'] = + +//$displayText['forum'] = +//$displayText['forum_new'] = + +//$displayText['topic'] = +//$displayText['topic_hot'] = +//$displayText['topic_sticky'] = +//$displayText['topic_digest'] = +//$displayText['topic_locked'] = +//$displayText['topic_new'] = +//$displayText['topic_hot_new'] = +//$displayText['topic_my'] = + +//$displayText['post'] = + +//$displayText['poll'] = +//$displayText['rss'] = +//$displayText['pdf'] = +//$displayText['subforum'] = + +//$displayText['admin_move'] = +//$displayText['admin_merge'] = +//$displayText['admin_edit'] = +//$displayText['admin_delete'] = + +//$displayText['document'] = + +//$displayText['previous'] = +//$displayText['next'] = +//$displayText['right'] = +//$displayText['down'] = +//$displayText['up'] = +//$displayText['printer'] = +//$displayText['new_forum'] = + +//$displayText['facebook'] = +//$displayText['twitter'] = +//$displayText['linkedin'] = +//$displayText['googleplus'] = +//$displayText['stumbleupon'] = +//$displayText['friendfeed'] = +//$displayText['digg'] = +//$displayText['reddit'] = +//$displayText['delicious'] = +//$displayText['technorati'] = +//$displayText['wong'] = +//$displayText['anonym'] = + +//$displayText['p_delete'] = +//$displayText['p_reply'] = +//$displayText['p_quote'] = +//$displayText['p_edit'] = +//$displayText['p_report'] = + +//$displayText['t_new'] = +//$displayText['t_poll'] = +//$displayText['t_qr'] = +//$displayText['t_reply'] = + +//$displayText['online'] = +//$displayText['offline'] = + +//$displayText['new_subforum'] = + +//$displayText['p_bann'] = + +false; + +for($i = 1; $i <= 5; $i++ ) { + //$displayText['rate'.$i] = false; +} + +return $displayText; +?> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/include/functions.render.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/include/functions.render.php 2012-08-27 11:18:20 UTC (rev 10123) +++ XoopsModules/newbb/branches/irmtfan/newbb/include/functions.render.php 2012-08-28 07:36:30 UTC (rev 10124) @@ -99,8 +99,15 @@ // START hacked by irmtfan // to show text links instead of buttons - func_num_args()==2 => only when $image, $alt is set and optional $display not set global $xoopsModuleConfig; - if (!empty($xoopsModuleConfig['display_text_links']) && func_num_args()== 2){ - $display=false; + if (func_num_args()== 2){ + // overall setting + if( !empty($xoopsModuleConfig['display_text_links']) ){ + $display=false; + } + // if set for each link => overwrite $display + if (isset($xoopsModuleConfig['display_text_each_link'][$image])){ + $display = empty($xoopsModuleConfig['display_text_each_link'][$image]); + } } // END hacked by irmtfan if (empty($display)) { Modified: XoopsModules/newbb/branches/irmtfan/newbb/include/plugin.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/include/plugin.php 2012-08-27 11:18:20 UTC (rev 10123) +++ XoopsModules/newbb/branches/irmtfan/newbb/include/plugin.php 2012-08-28 07:36:30 UTC (rev 10124) @@ -85,8 +85,16 @@ $customConfig["do_latestedit"] = 1; // START hacked by irmtfan -// Display text links instead of image buttons for edit, reply, .... set true or false +// Dispaly Text links instead of images and vice versa => text links=true/images=false +// This is overall value. +// It means if you set $customConfig["display_text_links"] to true it will show all images in text links (and vice versa) $customConfig["display_text_links"] = false; +// Dispaly Text links instead of images and vice versa => text links=true/images=false +// This is for each link. +// It means you can overwrite the above $customConfig["display_text_links"] overall value for each link one by one. +// go to /modules/newbb/include/display.php to set for each link +$customConfig["display_text_each_link"] = include XOOPS_ROOT_PATH."/modules/newbb/include/display.php"; // END hacked by irmtfan + return $customConfig; ?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ir...@us...> - 2012-09-10 06:44:43
|
Revision: 10169 http://xoops.svn.sourceforge.net/xoops/?rev=10169&view=rev Author: irmtfan Date: 2012-09-10 06:44:36 +0000 (Mon, 10 Sep 2012) Log Message: ----------- rank smarty variables like 3.08, full URL, up icon Modified Paths: -------------- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt XoopsModules/newbb/branches/irmtfan/newbb/class/user.php XoopsModules/newbb/branches/irmtfan/newbb/polls.php XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_thread.html XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewpost.html XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html XoopsModules/newbb/branches/irmtfan/newbb/topicmanager.php XoopsModules/newbb/branches/irmtfan/newbb/viewforum.php XoopsModules/newbb/branches/irmtfan/newbb/viewpost.php Modified: XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt 2012-09-09 18:20:46 UTC (rev 10168) +++ XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt 2012-09-10 06:44:36 UTC (rev 10169) @@ -1,3 +1,15 @@ +date 2012-09-10 +=============================== +1- back rank_image and rank_title to rank.image rank.title smarty variables to make consistency with old newbb versions. +in newbb/class/user.php, newbb/templates/newbb_thread.html + +2- change some reletive URLs to Full URLs (Roby73/irmtfan) +in newbb/viewforum.php, newbb/topicmanager.php, newbb/polls.php, newbb/templates/newbb_viewtopic.html + +3- add up and down icons smarty variables to templates. +in newbb/viewpost.php, newbb/templates/newbb_viewpost.html, newbb/templates/newbb_viewtopic.html + + date 2012-09-09 ================== 1- some changes in persian language notifications. Modified: XoopsModules/newbb/branches/irmtfan/newbb/class/user.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/class/user.php 2012-09-09 18:20:46 UTC (rev 10168) +++ XoopsModules/newbb/branches/irmtfan/newbb/class/user.php 2012-09-10 06:44:36 UTC (rev 10169) @@ -174,11 +174,12 @@ $userinfo["link"] = "<a href=\"".XOOPS_URL . "/userinfo.php?uid=" . $user->getVar("uid") ."\">".$userinfo["name"]."</a>"; $userinfo["avatar"] = $user->getVar('user_avatar'); - // START hacked by irmtfan - easier rank getting + // START hacked by irmtfan - easier rank getting - consistency with previous version back rank.title and rank.image $userrank = $user->rank(); + $userinfo["rank"]= array(); if (isset($userrank['image']) && $userrank['image']) { - $userinfo["rank_image"] = $userrank['image']; - $userinfo["rank_title"] = $userrank['title']; + $userinfo["rank"]["image"] = $userrank['image']; + $userinfo["rank"]["title"] = $userrank['title']; } // END hacked by irmtfan - easier rank getting - a little correctness dot removed // START hacked by irmtfan - easier groups getting - can we use $_SESSION['xoopsUserGroups']??? Modified: XoopsModules/newbb/branches/irmtfan/newbb/polls.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/polls.php 2012-09-09 18:20:46 UTC (rev 10168) +++ XoopsModules/newbb/branches/irmtfan/newbb/polls.php 2012-09-10 06:44:36 UTC (rev 10169) @@ -239,7 +239,8 @@ xoops_error($poll->getHtmlErrors()); exit(); } - redirect_header("viewtopic.php?topic_id={$topic_id}",1,_MD_POLL_DBUPDATED); + // irmtfan full URL + redirect_header(XOOPS_URL."/modules/".$xoopsModule->getVar("dirname")."/viewtopic.php?topic_id={$topic_id}",1,_MD_POLL_DBUPDATED); //exit(); } @@ -261,7 +262,8 @@ $expire_text = new XoopsFormText(_MD_POLL_EXPIRATION . "<br /><small>" . _MD_POLL_FORMAT . "<br />" . sprintf(_MD_POLL_CURRENTTIME, formatTimestamp(time(), "Y-m-d H:i:s")) . "</small>", "end_time", 20, 19, $date); $poll_form->addElement($expire_text); } else { - $restart_label = new XoopsFormLabel(_MD_POLL_EXPIRATION, sprintf(_MD_POLL_EXPIREDAT, $date) . "<br /><a href='polls.php?op=restart&poll_id=" . $poll->getVar("poll_id") . "'>" . _MD_POLL_RESTART . "</a>"); + // irmtfan full URL + $restart_label = new XoopsFormLabel(_MD_POLL_EXPIRATION, sprintf(_MD_POLL_EXPIREDAT, $date) . "<br /><a href='".XOOPS_URL."/modules/".$xoopsModule->getVar("dirname")."/polls.php?op=restart&poll_id=" . $poll->getVar("poll_id") . "'>" . _MD_POLL_RESTART . "</a>"); $poll_form->addElement($restart_label); } $weight_text = new XoopsFormText(_MD_POLL_DISPLAYORDER, "weight", 6, 5, $poll->getVar("weight")); @@ -295,7 +297,8 @@ unset($color_select, $color_label, $option_id_hidden, $option_text); $i++; } - $more_label = new XoopsFormLabel("", "<br /><a href='polls.php?op=addmore&poll_id=" . $poll->getVar("poll_id") . "&topic_id=" . $topic_id . "'>" . _MD_POLL_ADDMORE . "</a>"); + // irmtfan full URL + $more_label = new XoopsFormLabel("", "<br /><a href='".XOOPS_URL."/modules/".$xoopsModule->getVar("dirname")."/polls.php?op=addmore&poll_id=" . $poll->getVar("poll_id") . "&topic_id=" . $topic_id . "'>" . _MD_POLL_ADDMORE . "</a>"); $option_tray->addElement($more_label); $poll_form->addElement($option_tray); $op_hidden = new XoopsFormHidden("op", "update"); Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_thread.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_thread.html 2012-09-09 18:20:46 UTC (rev 10168) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_thread.html 2012-09-10 06:44:36 UTC (rev 10169) @@ -21,8 +21,8 @@ <{if $topic_post.poster.uid gt -1}> <td width="20%" class="odd" rowspan="2" valign="top"> <{if $topic_post.poster.uid != 0}> -<!-- START hacked by irmtfan --> - <div class="comUserRankText"><{if $topic_post.poster.rank_title !=""}> <{$topic_post.poster.rank_title}><br /><img src="<{$xoops_upload_url}>/<{$topic_post.poster.rank_image}>" alt="<{$topic_post.poster.rank_title}>" /><{/if}></div> +<!-- START hacked by irmtfan rank_title -> rank.title --> + <div class="comUserRankText"><{if $topic_post.poster.rank.title !=""}> <{$topic_post.poster.rank.title}><br /><img src="<{$xoops_upload_url}>/<{$topic_post.poster.rank.image}>" alt="<{$topic_post.poster.rank.title}>" /><{/if}></div> <!-- END hacked by irmtfan --> <{if $topic_post.poster.avatar != "blank.gif"}> Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewpost.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewpost.html 2012-09-09 18:20:46 UTC (rev 10168) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewpost.html 2012-09-10 06:44:36 UTC (rev 10169) @@ -47,8 +47,8 @@ <br /> <div style="padding: 5px;"> - <!-- irmtfan correct prev and next icons --> - <a id="threadtop"></a><{$down}><a href="#threadbottom"><{$smarty.const._MD_BOTTOM}></a> <{$previous}> <a href="viewtopic.php?viewmode=flat&order=<{$order_current}>&topic_id=<{$topic_id}>&forum=<{$forum_id}>&move=prev&topic_time=<{$topic_time}>"><{$smarty.const._MD_PREVTOPIC}></a> <{$next}> <a href="viewtopic.php?viewmode=flat&order=<{$order_current}>&topic_id=<{$topic_id}>&forum=<{$forum_id}>&move=next&topic_time=<{$topic_time}>"><{$smarty.const._MD_NEXTTOPIC}></a> + <!-- irmtfan remove prev and next icons --> + <a id="threadtop"></a><{$down}><a href="#threadbottom"><{$smarty.const._MD_BOTTOM}></a> </div> <br /> @@ -111,7 +111,8 @@ <div> <!-- irmtfan hardcode removed style="float: left; text-align:left;" --> <div class="icon_left"> - <a id="threadbottom"></a><a href="#threadtop"><{$smarty.const._MD_TOP}></a> + <!-- irmtfan add up button --> + <a id="threadbottom"></a><{$p_up}><a href="#threadtop"><{$smarty.const._MD_TOP}></a> </div> <!-- irmtfan hardcode removed style="float: right; text-align:right;" --> <div class="icon_right"> Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html 2012-09-09 18:20:46 UTC (rev 10168) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html 2012-09-10 06:44:36 UTC (rev 10169) @@ -96,7 +96,7 @@ <!-- irmtfan hardcode removed style="float: left; text-align:left;"" --> <span class="icon_left"> <!-- irmtfan correct prev and next icons --> - <a id="threadtop"></a><{$down}><a href="#threadbottom"><{$smarty.const._MD_BOTTOM}></a> <{$previous}> <a href="viewtopic.php?order=<{$order_current}>&topic_id=<{$topic_id}>&forum=<{$forum_id}>&move=prev"><{$smarty.const._MD_PREVTOPIC}></a> <{$next}> <a href="viewtopic.php?order=<{$order_current}>&topic_id=<{$topic_id}>&forum=<{$forum_id}>&move=next"><{$smarty.const._MD_NEXTTOPIC}></a> + <a id="threadtop"></a><{$down}><a href="#threadbottom"><{$smarty.const._MD_BOTTOM}></a> <{$previous}> <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/viewtopic.php?order=<{$order_current}>&topic_id=<{$topic_id}>&forum=<{$forum_id}>&move=prev"><{$smarty.const._MD_PREVTOPIC}></a> <{$next}> <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/viewtopic.php?order=<{$order_current}>&topic_id=<{$topic_id}>&forum=<{$forum_id}>&move=next"><{$smarty.const._MD_NEXTTOPIC}></a> </span> <!-- irmtfan hardcode removed style="float: right; text-align:right;"" --> <span class="icon_right"> @@ -198,8 +198,8 @@ <div> <div class="left"> - <!-- irmtfan correct prev and next icons --> - <a id="threadbottom"></a><a href="#threadtop"><{$smarty.const._MD_TOP}></a> <{$previous}> <a href="viewtopic.php?viewmode=flat&order=<{$order_current}>&topic_id=<{$topic_id}>&forum=<{$forum_id}>&move=prev"><{$smarty.const._MD_PREVTOPIC}></a> <{$next}> <a href="viewtopic.php?viewmode=flat&order=<{$order_current}>&topic_id=<{$topic_id}>&forum=<{$forum_id}>&move=next"><{$smarty.const._MD_NEXTTOPIC}></a> + <!-- irmtfan correct prev and next icons add up--> + <a id="threadbottom"></a><{$p_up}><a href="#threadtop"><{$smarty.const._MD_TOP}></a> <{$previous}> <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/viewtopic.php?viewmode=flat&order=<{$order_current}>&topic_id=<{$topic_id}>&forum=<{$forum_id}>&move=prev"><{$smarty.const._MD_PREVTOPIC}></a> <{$next}> <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/viewtopic.php?viewmode=flat&order=<{$order_current}>&topic_id=<{$topic_id}>&forum=<{$forum_id}>&move=next"><{$smarty.const._MD_NEXTTOPIC}></a> </div> <!-- irmtfan hardcode removed style="float: right; text-align:right;"" --> <div class="icon_right"> Modified: XoopsModules/newbb/branches/irmtfan/newbb/topicmanager.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/topicmanager.php 2012-09-09 18:20:46 UTC (rev 10168) +++ XoopsModules/newbb/branches/irmtfan/newbb/topicmanager.php 2012-09-10 06:44:36 UTC (rev 10169) @@ -103,7 +103,8 @@ //sync($topic_id, "topic"); //xoops_notification_deletebyitem ($xoopsModule->getVar('mid'), 'thread', $topic_id); } - echo $action[$mode]['msg']."<p><a href='".XOOPS_URL."/modules/newbb/viewforum.php?forum=$forum'>"._MD_RETURNTOTHEFORUM."</a></p><p><a href='index.php'>"._MD_RETURNFORUMINDEX."</a></p>"; + // irmtfan full URL + echo $action[$mode]['msg']."<p><a href='".XOOPS_URL."/modules/".$xoopsModule->getVar("dirname")."/viewforum.php?forum=$forum'>"._MD_RETURNTOTHEFORUM."</a></p><p><a href='index.php'>"._MD_RETURNFORUMINDEX."</a></p>"; } elseif ('restore' == $mode) { //$topic_handler =& xoops_getmodulehandler('topic', 'newbb'); $forums = array(); @@ -123,7 +124,7 @@ $forum_handler->synchronization($forums_obj[$id]); } unset($topics_obj, $forums_obj); - echo $action[$mode]['msg']."<p><a href='viewforum.php?forum=$forum'>"._MD_RETURNTOTHEFORUM."</a></p><p><a href='index.php'>"._MD_RETURNFORUMINDEX."</a></p>"; + echo $action[$mode]['msg']."<p><a href='".XOOPS_URL."/modules/".$xoopsModule->getVar("dirname")."viewforum.php?forum=$forum'>"._MD_RETURNTOTHEFORUM."</a></p><p><a href='index.php'>"._MD_RETURNFORUMINDEX."</a></p>"; } elseif ('merge' == $mode) { $post_handler =& xoops_getmodulehandler('post', 'newbb'); @@ -191,9 +192,10 @@ } echo $action[$mode]['msg']. - "<p><a href='".XOOPS_URL."/modules/newbb/viewtopic.php?topic_id=$newtopic'>"._MD_VIEWTHETOPIC."</a></p>". - "<p><a href='".XOOPS_URL."/modules/newbb/viewforum.php?forum=$forum'>"._MD_RETURNTOTHEFORUM."</a></p>". - "<p><a href='".XOOPS_URL."/modules/newbb/index.php'>"._MD_RETURNFORUMINDEX."</a></p>"; + // irmtfan full URL + "<p><a href='".XOOPS_URL."/modules/".$xoopsModule->getVar("dirname")."/viewtopic.php?topic_id=$newtopic'>"._MD_VIEWTHETOPIC."</a></p>". + "<p><a href='".XOOPS_URL."/modules/".$xoopsModule->getVar("dirname")."/viewforum.php?forum=$forum'>"._MD_RETURNTOTHEFORUM."</a></p>". + "<p><a href='".XOOPS_URL."/modules/".$xoopsModule->getVar("dirname")."/index.php'>"._MD_RETURNFORUMINDEX."</a></p>"; } elseif ('move' == $mode) { if ($newforum > 0) { $topic_id = $topic_id[0]; @@ -209,8 +211,8 @@ } $forum_handler->synchronization($forum); $forum_handler->synchronization($newforum); - - echo $action[$mode]['msg']."<p><a href='viewtopic.php?topic_id=$topic_id&forum=$newforum'>"._MD_GOTONEWFORUM."</a></p><p><a href='".XOOPS_URL."/modules/newbb/index.php'>"._MD_RETURNFORUMINDEX."</a></p>"; +// irmtfan full URL + echo $action[$mode]['msg']."<p><a href='".XOOPS_URL."/modules/".$xoopsModule->getVar("dirname")."/viewtopic.php?topic_id=$topic_id&forum=$newforum'>"._MD_GOTONEWFORUM."</a></p><p><a href='".XOOPS_URL."/modules/newbb/index.php'>"._MD_RETURNFORUMINDEX."</a></p>"; } else { redirect_header("javascript:history.go(-1)",2,_MD_ERRORFORUM); } @@ -248,7 +250,8 @@ $userstats_handler->insert($user_stat); } } - echo $action[$mode]['msg']."<p><a href='".XOOPS_URL."/modules/newbb/viewtopic.php?topic_id=$topic_id&forum=$forum'>"._MD_VIEWTHETOPIC."</a></p><p><a href='".XOOPS_URL."/modules/newbb/viewforum.php?forum=$forum'>"._MD_RETURNFORUMINDEX."</a></p>"; +// irmtfan full URL + echo $action[$mode]['msg']."<p><a href='".XOOPS_URL."/modules/".$xoopsModule->getVar("dirname")."/viewtopic.php?topic_id=$topic_id&forum=$forum'>"._MD_VIEWTHETOPIC."</a></p><p><a href='".XOOPS_URL."/modules/newbb/viewforum.php?forum=$forum'>"._MD_RETURNFORUMINDEX."</a></p>"; } } else { // No submit $mode = $_GET['mode']; Modified: XoopsModules/newbb/branches/irmtfan/newbb/viewforum.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/viewforum.php 2012-09-09 18:20:46 UTC (rev 10168) +++ XoopsModules/newbb/branches/irmtfan/newbb/viewforum.php 2012-09-10 06:44:36 UTC (rev 10169) @@ -95,10 +95,11 @@ } if ($forum_handler->getPermission($forum_obj, "post")) { - $xoopsTpl->assign('forum_post_or_register', "<a href=\"".XOOPS_URL."/modules/newbb/newtopic.php?forum={$forum_id}\">".newbb_displayImage('t_new', _MD_POSTNEW)."</a>"); + // irmtfan full URL + $xoopsTpl->assign('forum_post_or_register', "<a href=\"".XOOPS_URL."/modules/".$xoopsModule->getVar("dirname")."/newtopic.php?forum={$forum_id}\">".newbb_displayImage('t_new', _MD_POSTNEW)."</a>"); if ($forum_handler->getPermission($forum_obj, "addpoll") && $pollmodules) { $t_poll = newbb_displayImage('t_poll',_MD_ADDPOLL); - $xoopsTpl->assign('forum_addpoll', "<a href=\"".XOOPS_URL."/modules/newbb/newtopic.php?op=add&forum={$forum_id}\">{$t_poll}</a>"); + $xoopsTpl->assign('forum_addpoll', "<a href=\"".XOOPS_URL."/modules/".$xoopsModule->getVar("dirname")."/newtopic.php?op=add&forum={$forum_id}\">{$t_poll}</a>"); } } else { if ( !empty($GLOBALS["xoopsModuleConfig"]["show_reg"]) && !is_object($xoopsUser)) { Modified: XoopsModules/newbb/branches/irmtfan/newbb/viewpost.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/viewpost.php 2012-09-09 18:20:46 UTC (rev 10168) +++ XoopsModules/newbb/branches/irmtfan/newbb/viewpost.php 2012-09-10 06:44:36 UTC (rev 10169) @@ -370,7 +370,8 @@ $lang_title .= ' ('.XoopsUser::getUnameFromId($uid).')'; } $xoopsTpl->assign('lang_title',$lang_title); -$xoopsTpl->assign('up',newbb_displayImage('up',_MD_TOP)); +// irmtfan up to p_up +$xoopsTpl->assign('p_up',newbb_displayImage('up',_MD_TOP)); $xoopsTpl->assign('groupbar_enable', $xoopsModuleConfig['groupbar_enabled']); $xoopsTpl->assign('anonymous_prefix', $xoopsModuleConfig['anonymous_prefix']); $xoopsTpl->assign('down',newbb_displayImage('down', _MD_BOTTOM)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ir...@us...> - 2012-09-11 10:42:02
|
Revision: 10171 http://xoops.svn.sourceforge.net/xoops/?rev=10171&view=rev Author: irmtfan Date: 2012-09-11 10:41:55 +0000 (Tue, 11 Sep 2012) Log Message: ----------- fix viewtopic admin mode, fix notification redirect, revoke last rev 10170 in xoops_version.php Revision Links: -------------- http://xoops.svn.sourceforge.net/xoops/?rev=10170&view=rev Modified Paths: -------------- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt XoopsModules/newbb/branches/irmtfan/newbb/include/notification.inc.php XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_notification_select.html XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_thread.html XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html XoopsModules/newbb/branches/irmtfan/newbb/xoops_version.php Modified: XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt 2012-09-10 10:57:32 UTC (rev 10170) +++ XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt 2012-09-11 10:41:55 UTC (rev 10171) @@ -1,3 +1,16 @@ +date 2012-09-11 +=============================== +1- bug fix: viewtopic admin mode action incorrectly on the topic instead of selected posts of the topic.(important) +in newbb/templates/newbb_viewtopic.html +2- change some reletive URLs to Full URLs (Roby73/irmtfan) +in newbb/notification.inc.ini +3- bug fix: redirect was not correct in subdomain (value=xoops_url removed) +in newbb/templates/newbb_notification_select.html +4- advertise post should not have admin buttons. +in newbb/templates/newbb_thread.html +5- revoke the last change rev 10170 and revert to rev 10102 +in newbb/xoops_version.php + date 2012-09-10 =============================== 1- bug fix: notification not show in newbb/viewtopic.php?post_id=XXXX URLs Modified: XoopsModules/newbb/branches/irmtfan/newbb/include/notification.inc.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/include/notification.inc.php 2012-09-10 10:57:32 UTC (rev 10170) +++ XoopsModules/newbb/branches/irmtfan/newbb/include/notification.inc.php 2012-09-11 10:41:55 UTC (rev 10171) @@ -52,7 +52,8 @@ // Assume we have a valid forum id $sql = 'SELECT forum_name FROM ' . $xoopsDB->prefix('bb_forums') . ' WHERE forum_id = '.$item_id; if (!$result = $xoopsDB->query($sql)) { - redirect_header("index.php", 2, _MD_ERRORFORUM); + // irmtfan full URL + redirect_header(XOOPS_URL . '/modules/' . $module->getVar('dirname') . "index.php", 2, _MD_ERRORFORUM); exit(); } $result_array = $xoopsDB->fetchArray($result); @@ -65,7 +66,8 @@ // Assume we have a valid topid id $sql = 'SELECT t.topic_title,f.forum_id,f.forum_name FROM '.$xoopsDB->prefix('bb_topics') . ' t, ' . $xoopsDB->prefix('bb_forums') . ' f WHERE t.forum_id = f.forum_id AND t.topic_id = '. $item_id . ' limit 1'; if (!$result = $xoopsDB->query($sql)) { - redirect_header("index.php", 2, _MD_ERROROCCURED); + // irmtfan full URL + redirect_header(XOOPS_URL . '/modules/' . $module->getVar('dirname') . "index.php", 2, _MD_ERROROCCURED); exit(); } $result_array = $xoopsDB->fetchArray($result); @@ -78,7 +80,8 @@ // Assume we have a valid post id $sql = 'SELECT subject,topic_id,forum_id FROM ' . $xoopsDB->prefix('bb_posts') . ' WHERE post_id = ' . $item_id . ' LIMIT 1'; if (!$result = $xoopsDB->query($sql)) { - redirect_header("index.php", 2, _MD_ERROROCCURED); + // irmtfan full URL + redirect_header(XOOPS_URL . '/modules/' . $module->getVar('dirname') . "index.php", 2, _MD_ERROROCCURED); exit(); } $result_array = $xoopsDB->fetchArray($result); Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_notification_select.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_notification_select.html 2012-09-10 10:57:32 UTC (rev 10170) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_notification_select.html 2012-09-11 10:41:55 UTC (rev 10171) @@ -1,7 +1,8 @@ <{if $xoops_notification.show}> <form name="notification_select" action="<{$xoops_url}>/modules/<{$xoops_dirname}>/<{$xoops_notification.target_page}>" method="post"> <h4 class="txtcenter"><{$lang_activenotifications}> </h4> - <input type="hidden" name="not_redirect" value="<{$xoops_url}><{$xoops_notification.redirect_script}>" /> + <!-- irmtfan remove value=xoops_url --> + <input type="hidden" name="not_redirect" value="<{$xoops_notification.redirect_script}>" /> <input type="hidden" name="XOOPS_TOKEN_REQUEST" value="<{php}>echo $GLOBALS['xoopsSecurity']->createToken();<{/php}>" /> <table class="outer"> <tr> Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_thread.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_thread.html 2012-09-10 10:57:32 UTC (rev 10170) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_thread.html 2012-09-11 10:41:55 UTC (rev 10171) @@ -131,7 +131,8 @@ </td> <!-- irmtfan removed hardcode style="text-align:right;" --> <td class="right"> - <{if $mode gt 1}> + <!-- irmtfan if the post is not advertise --> + <{if $mode gt 1 && $topic_post.poster.uid gt -1}> <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/action.post.php?post_id=<{$topic_post.post_id}>&op=split&mode=1" target="_self" title="<{$smarty.const._MD_SPLIT_ONE}>"><{$smarty.const._MD_SPLIT_ONE}></a> | <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/action.post.php?post_id=<{$topic_post.post_id}>&op=split&mode=2" target="_self" title="<{$smarty.const._MD_SPLIT_TREE}>"><{$smarty.const._MD_SPLIT_TREE}></a> | <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/action.post.php?post_id=<{$topic_post.post_id}>&op=split&mode=3" target="_self" title="<{$smarty.const._MD_SPLIT_ALL}>"><{$smarty.const._MD_SPLIT_ALL}></a> | Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html 2012-09-10 10:57:32 UTC (rev 10170) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html 2012-09-11 10:41:55 UTC (rev 10171) @@ -53,8 +53,8 @@ <!-- irmtfan hardcode removed style="float: right; text-align: right;" --> <div class="icon_right" id="admin"> <{if $mode gt 1}> - <!-- irmtfan mistype forum_posts_admin => form_posts_admin --> - <form name="form_posts_admin" action="topicmanager.php" method="POST" onsubmit="javascript: if(window.document.form_posts_admin.op.value < 1){return false;}"> + <!-- irmtfan mistype forum_posts_admin => form_posts_admin - action="topicmanager.php" => action="action.post.php" --> + <form name="form_posts_admin" action="action.post.php" method="POST" onsubmit="javascript: if(window.document.form_posts_admin.op.value < 1){return false;}"> <{$smarty.const._ALL}>: <input type="checkbox" name="post_check" id="post_check" value="1" onclick="xoopsCheckAll('form_posts_admin', 'post_check');" /> <!-- irmtfan mistype mode => op --> <select name="op"> Modified: XoopsModules/newbb/branches/irmtfan/newbb/xoops_version.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/xoops_version.php 2012-09-10 10:57:32 UTC (rev 10170) +++ XoopsModules/newbb/branches/irmtfan/newbb/xoops_version.php 2012-09-11 10:41:55 UTC (rev 10171) @@ -721,8 +721,7 @@ $modversion['notification']['category'][1]['title'] = _MI_NEWBB_THREAD_NOTIFY; $modversion['notification']['category'][1]['description'] = _MI_NEWBB_THREAD_NOTIFYDSC; $modversion['notification']['category'][1]['subscribe_from'] = 'viewtopic.php'; -// irmtfan remove because "item_name" can be "topic_id" and/or "post_id" -// $modversion['notification']['category'][1]['item_name'] = 'topic_id'; +$modversion['notification']['category'][1]['item_name'] = 'topic_id'; $modversion['notification']['category'][1]['allow_bookmark'] = 1; $modversion['notification']['category'][2]['name'] = 'forum'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ir...@us...> - 2012-09-18 09:52:05
|
Revision: 10184 http://xoops.svn.sourceforge.net/xoops/?rev=10184&view=rev Author: irmtfan Date: 2012-09-18 09:51:54 +0000 (Tue, 18 Sep 2012) Log Message: ----------- bug fix: delete, pending, restore functionality (very important) Modified Paths: -------------- XoopsModules/newbb/branches/irmtfan/newbb/action.topic.php XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_synchronization.php XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt XoopsModules/newbb/branches/irmtfan/newbb/class/post.php XoopsModules/newbb/branches/irmtfan/newbb/class/topic.php XoopsModules/newbb/branches/irmtfan/newbb/docs/lang_diff.txt XoopsModules/newbb/branches/irmtfan/newbb/language/english/main.php XoopsModules/newbb/branches/irmtfan/newbb/language/persian/main.php XoopsModules/newbb/branches/irmtfan/newbb/list.topic.php XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewall.html XoopsModules/newbb/branches/irmtfan/newbb/topicmanager.php XoopsModules/newbb/branches/irmtfan/newbb/viewforum.php XoopsModules/newbb/branches/irmtfan/newbb/viewtopic.php Modified: XoopsModules/newbb/branches/irmtfan/newbb/action.topic.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/action.topic.php 2012-09-17 13:16:30 UTC (rev 10183) +++ XoopsModules/newbb/branches/irmtfan/newbb/action.topic.php 2012-09-18 09:51:54 UTC (rev 10184) @@ -96,7 +96,8 @@ $topics_obj =& $topic_handler->getAll(new Criteria("topic_id", "(".implode(",", $topic_id).")", "IN")); foreach (array_keys($topics_obj) as $id) { $topic_obj =& $topics_obj[$id]; - $topic_handler->delete($topic_obj,true); + // irmtfan should be set to false to not delete topic from database + $topic_handler->delete($topic_obj,false); $topic_handler->synchronization($topic_obj); $forums[$topic_obj->getVar("forum_id")] = 1; } Modified: XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_synchronization.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_synchronization.php 2012-09-17 13:16:30 UTC (rev 10183) +++ XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_synchronization.php 2012-09-18 09:51:54 UTC (rev 10184) @@ -9,7 +9,7 @@ * @version $Id: admin_synchronization.php 62 2012-08-17 10:15:26Z alfred $ * @package module::newbb */ - +// irmtfan - TODO - should be changed completly with Newbb new function newbb_synchronization include 'admin_header.php'; xoops_cp_header(); @@ -84,7 +84,8 @@ $forums_obj[$key]->setVar("forum_posts", $posts); } } - $sql = "SELECT COUNT(*) AS total FROM ".$xoopsDB->prefix("bb_topics")." WHERE approved=1 AND forum_id = ".$key; + // irmtfan approved=1 AND + $sql = "SELECT COUNT(*) AS total FROM ".$xoopsDB->prefix("bb_topics")." WHERE forum_id = ".$key; $result = $xoopsDB->query($sql); if ( $row = $xoopsDB->fetchArray($result) ) { if ($forums_obj[$key]->getVar("forum_topics") != $row['total']) { @@ -105,9 +106,10 @@ if ($start >= ($count = $topic_handler->getCount(new Criteria("approved", 1))) ) { break; } + // irmtfan WHERE approved=1 $sql = " SELECT topic_id, topic_last_post_id, topic_replies". " FROM " . $xoopsDB->prefix("bb_topics") . - " WHERE approved=1"; + " "; $result = $xoopsDB->query($sql, $limit, $start); while ( list($topic_id, $last_post, $replies) = $xoopsDB->fetchRow($result) ) { $sql = " SELECT MAX(post_id) AS last_post, COUNT(*) - 1 AS replies ". @@ -133,14 +135,16 @@ if ($start >= ($count = $post_handler->getCount(new Criteria("approved", 1))) ) { break; } + // irmtfan WHERE approved=1 AND $sql = " SELECT topic_id". " FROM " . $xoopsDB->prefix("bb_topics") . - " WHERE approved=1"; + " "; $result = $xoopsDB->query($sql, $limit, $start); while ( list($topic_id) = $xoopsDB->fetchRow($result) ) { + // irmtfan approved=1 AND $sql = " SELECT MIN(post_id) AS top_post". " FROM " . $xoopsDB->prefix("bb_posts") . - " WHERE approved=1 AND topic_id = {$topic_id}"; + " WHERE topic_id = {$topic_id}"; $ret = $xoopsDB->query($sql); list($top_post) = $xoopsDB->fetchRow($ret); $sql = " UPDATE ".$xoopsDB->prefix("bb_posts"). @@ -174,21 +178,22 @@ " FROM " . $xoopsDB->prefix("users"); $result = $xoopsDB->query($sql, $limit, $start); while ( list($uid) = $xoopsDB->fetchRow($result) ) { + // irmtfan approved=1 AND $sql = " SELECT count(*)". " FROM " . $xoopsDB->prefix("bb_topics") . - " WHERE approved=1 AND topic_poster = {$uid}"; + " WHERE topic_poster = {$uid}"; $ret = $xoopsDB->query($sql); list($topics) = $xoopsDB->fetchRow($ret); - + // irmtfan approved=1 AND $sql = " SELECT count(*)". " FROM " . $xoopsDB->prefix("bb_topics") . - " WHERE approved=1 AND topic_digest > 0 AND topic_poster = {$uid}"; + " WHERE topic_digest > 0 AND topic_poster = {$uid}"; $ret = $xoopsDB->query($sql); list($digests) = $xoopsDB->fetchRow($ret); - + // irmtfan approved=1 AND $sql = " SELECT count(*), MAX(post_time)". " FROM " . $xoopsDB->prefix("bb_posts") . - " WHERE approved=1 AND uid = {$uid}"; + " WHERE uid = {$uid}"; $ret = $xoopsDB->query($sql); list($posts, $lastpost) = $xoopsDB->fetchRow($ret); Modified: XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt 2012-09-17 13:16:30 UTC (rev 10183) +++ XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt 2012-09-18 09:51:54 UTC (rev 10184) @@ -1,3 +1,45 @@ +date 2012-09-18 +=================================== +1- bug fix: in topic delete process: in view all and view forum: after delete selected topics all topics and their posts will be wrongly deleted from database.(very important) +in newbb/action.topic.php + +2- bug fix: in post restore process: it will not approve post if approved = -1 (deleted) (important) +in newbb/class/post.php + +3- bug fix: in post delete process: wrongly set new pid for not approved posts and set pid=0(very important) +in newbb/class/post.php + +4- bug fix: wrongly check topic is not object after set it as object (important) +in newbb/class/topic.php + +5- bug fix: in view all topic page: if empty($_GET(status)) it will show all topics include deleted and pendings. +in newbb/list.topic.php + +6- bug fix: sync topic not added after delete +in newbb/topicmanager.php + +7- bug fix: remove unneeded codes: manually approve posts after restore +in newbb/topicmanager.php + +8- improve: ability to restore a topic in viewtopic page +in newbb/topicmanager.php, newbb/viewtopic.php +newbb/language/english/main.php, newbb/docs/lang_diff.txt + +9- fix: slash "/" missing in URL +in newbb/topicmanager.php + +10- fix: add "mode" smarty variable in viewforum to see admin links +in newbb/viewforum.php + +11- improve: in view all topic page: show all admin links in admin mode in the initial page loading +newbb/templates/newbb_viewall.html + +12- bug fix: admin main sync wrongly delete all pending and deleted posts/topics (very important) +in newbb/admin_synchronization.php + +13- bug fix: admin main sync (misc) wrongly delete all pending and deleted posts/topics when the pending_expire=0 in newbb/include/plugin.php (very important) +in newbb/class/post.php, newbb/class/topic.php + date 2012-09-16 =================================== 1- improve: Add forum_post_prefix smarty variable to have unique Ids for posts. Add js function to scroll to current post in viewtopic.php links. Modified: XoopsModules/newbb/branches/irmtfan/newbb/class/post.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/class/post.php 2012-09-17 13:16:30 UTC (rev 10183) +++ XoopsModules/newbb/branches/irmtfan/newbb/class/post.php 2012-09-18 09:51:54 UTC (rev 10184) @@ -634,7 +634,8 @@ $post_id = $post->getVar("post_id"); $wasApproved = $post->getVar("approved"); - if (empty($force) && $wasApproved) { + // irmtfan approve post if the approved = 0 (pending) or -1 (deleted) + if (empty($force) && $wasApproved > 0) { return true; } $post->setVar("approved", 1); @@ -913,10 +914,12 @@ unset($poster); } } - - $sql = "UPDATE " . $this->db->prefix("bb_posts") . " SET pid = " . $post->getVar('pid') . " WHERE pid=" . $post->getVar('post_id'); - if (!$result = $this->db->queryF($sql)) { - //xoops_error($this->db->error()); + // irmtfan - just update the pid for approved posts when the post is not topic (pid=0) + if (!$post->isTopic()) { + $sql = "UPDATE " . $this->db->prefix("bb_posts") . " SET pid = " . $post->getVar('pid') . " WHERE approved=1 AND pid=" . $post->getVar('post_id'); + if (!$result = $this->db->queryF($sql)) { + //xoops_error($this->db->error()); + } } } @@ -1010,6 +1013,12 @@ */ function cleanExpires($expire = 0) { + // irmtfan if 0 no cleanup look include/plugin.php + if (!func_num_args()){ + $newbbConfig = newbb_load_config(); + $expire = isset($newbbConfig["pending_expire"]) ? intval($newbbConfig["pending_expire"]) : 7; + } + if (empty($expire)) return false; $crit_expire = new CriteriaCompo(new Criteria("approved", 0, "<=")); //if (!empty($expire)) { $crit_expire->add(new Criteria("post_time", time()-intval($expire), "<")); Modified: XoopsModules/newbb/branches/irmtfan/newbb/class/topic.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/class/topic.php 2012-09-17 13:16:30 UTC (rev 10183) +++ XoopsModules/newbb/branches/irmtfan/newbb/class/topic.php 2012-09-18 09:51:54 UTC (rev 10184) @@ -414,6 +414,12 @@ */ function cleanExpires($expire = 0) { + // irmtfan if 0 no cleanup look include/plugin.php + if (!func_num_args()){ + $newbbConfig = newbb_load_config(); + $expire = isset($newbbConfig["pending_expire"]) ? intval($newbbConfig["pending_expire"]) : 7; + } + if (empty($expire)) return false; $crit_expire = new CriteriaCompo(new Criteria("approved", 0, "<=")); $crit_expire->add(new Criteria("topic_time", time() - intval($expire), "<")); return $this->deleteAll($crit_expire, true/*, true*/); @@ -424,7 +430,8 @@ if (!is_object($object)) { $object =& $this->get(intval($object)); } - if (!is_object($object) || !$object->getVar("topic_id")) return false; + // irmtfan bad coding error - $object is object now + if (!$object->getVar("topic_id")) return false; $sql = " SELECT MAX(post_id) AS last_post, COUNT(*) AS total ". " FROM " . $this->db->prefix("bb_posts") . Modified: XoopsModules/newbb/branches/irmtfan/newbb/docs/lang_diff.txt =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/docs/lang_diff.txt 2012-09-17 13:16:30 UTC (rev 10183) +++ XoopsModules/newbb/branches/irmtfan/newbb/docs/lang_diff.txt 2012-09-18 09:51:54 UTC (rev 10184) @@ -46,3 +46,7 @@ define('_MD_NEWBB_HIDEUSERDATA','Hide User information'); define('_MD_NEWBB_HIDE','Hide'); define('_MD_NEWBB_SEE','See'); + +define('_MD_RESTORETOPIC','Restore this topic'); +define('_MD_TOPICRESTORE','The topic has been restored.'); +define('_MD_DESC_RESTORE','Once you press the restore button at the bottom of this form the topic you have selected, and all its related posts, will be restored.'); Modified: XoopsModules/newbb/branches/irmtfan/newbb/language/english/main.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/language/english/main.php 2012-09-17 13:16:30 UTC (rev 10183) +++ XoopsModules/newbb/branches/irmtfan/newbb/language/english/main.php 2012-09-18 09:51:54 UTC (rev 10184) @@ -154,6 +154,8 @@ define('_MD_MERGETOPIC','Merge this topic'); define('_MD_MOVETOPIC','Move this topic'); define('_MD_DELETETOPIC','Delete this topic'); +// irmtfan add restore to viewtopic +define('_MD_RESTORETOPIC','Restore this topic'); define('_MD_TOP','Top'); define('_MD_BOTTOM','Bottom'); define('_MD_PREVTOPIC','Previous Topic'); @@ -285,6 +287,8 @@ define('_MD_ERROR_BACK','Error - Please go back and try again.'); define('_MD_GOTONEWFORUM','View the updated topic'); define('_MD_TOPICDELETE','The topic has been deleted.'); +// irmtfan add restore to viewtopic +define('_MD_TOPICRESTORE','The topic has been restored.'); define('_MD_TOPICMERGE','The topic has been merged.'); define('_MD_TOPICMOVE','The topic has been moved.'); define('_MD_TOPICLOCK','The topic has been locked.'); @@ -303,6 +307,8 @@ define('_MD_DIGEST','Digest'); define('_MD_UNDIGEST','unDigest'); define('_MD_DESC_DELETE','Once you press the delete button at the bottom of this form the topic you have selected, and all its related posts, will be <strong>permanently</strong> removed.'); +// irmtfan add restore to viewtopic +define('_MD_DESC_RESTORE','Once you press the restore button at the bottom of this form the topic you have selected, and all its related posts, will be restored.'); define('_MD_DESC_MOVE','Once you press the move button at the bottom of this form the topic you have selected, and its related posts, will be moved to the forum you have selected.'); define('_MD_DESC_MERGE','Once you press the merge button at the bottom of this form the topic you have selected, and its related posts, will be merged to the topic you have selected.<br /><strong>The destination topic ID must be smaller than current one</strong>.'); define('_MD_DESC_LOCK','Once you press the lock button at the bottom of this form the topic you have selected will be locked. You may unlock it at a later time if you like.'); Modified: XoopsModules/newbb/branches/irmtfan/newbb/language/persian/main.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/language/persian/main.php 2012-09-17 13:16:30 UTC (rev 10183) +++ XoopsModules/newbb/branches/irmtfan/newbb/language/persian/main.php 2012-09-18 09:51:54 UTC (rev 10184) @@ -62,7 +62,7 @@ //page_header.php define('_MD_MODERATEDBY','نظارت توسط'); define('_MD_SEARCH','جستجو'); -define('_MD_FORUMINDEX','%s صفحهی اصلی انجمنها'); +define('_MD_FORUMINDEX','صفحهی اصلی انجمنها'); define('_MD_POSTNEW','ارسال عنوان جدید'); define('_MD_REGTOPOST','برای ارسال پیام باید ابتدا ثبت نام کنید'); @@ -154,6 +154,8 @@ define('_MD_MERGETOPIC','این عنوان را ادغام کن'); define('_MD_MOVETOPIC','این عنوان را منتقل کن'); define('_MD_DELETETOPIC','این عنوان را حذف کن'); +// irmtfan add restore to viewtopic +define('_MD_RESTORETOPIC','این عنوان را بازیابی کن'); define('_MD_TOP','بالا'); define('_MD_BOTTOM','پایین'); define('_MD_PREVTOPIC','پیام قبلی'); @@ -284,14 +286,16 @@ define('_MD_RETURNFORUMINDEX','بازگشت به صفحهی اصلی انجمنها'); define('_MD_ERROR_BACK','خطا - لطفا بازگردید و دوباره سعی کنید.'); define('_MD_GOTONEWFORUM','دیدن عنوانهای به روز شده'); -define('_MD_TOPICDELETE','عنوان حذف شده.'); -define('_MD_TOPICMERGE','عنوان ادغام شده.'); -define('_MD_TOPICMOVE','عنوان منتقل شده.'); -define('_MD_TOPICLOCK','عنوان مورد نظر قفل شده.'); +define('_MD_TOPICDELETE','عنوان حذف شده است.'); +// irmtfan add restore to viewtopic +define('_MD_TOPICRESTORE','عنوان بازیابی شده است.'); +define('_MD_TOPICMERGE','عنوان ادغام شده است.'); +define('_MD_TOPICMOVE','عنوان منتقل شده است.'); +define('_MD_TOPICLOCK','عنوان مورد نظر قفل شده است.'); define('_MD_TOPICUNLOCK','قفل عنوان مورد نظر باز شد.'); -define('_MD_TOPICSTICKY','عنوان مورد نظر مهم(چسبان) شده.'); +define('_MD_TOPICSTICKY','عنوان مورد نظر مهم(چسبان) شده است.'); define('_MD_TOPICUNSTICKY','عنوان مورد نظر از حالت مهم(چسبان) در آمده.'); -define('_MD_TOPICDIGEST','عنوان خلاصه شده.'); +define('_MD_TOPICDIGEST','عنوان خلاصه شده است.'); define('_MD_TOPICUNDIGEST','عنوان از خلاصه درآمده.'); define('_MD_DELETE','حذف کن'); define('_MD_MOVE','منتقلکن'); @@ -303,6 +307,7 @@ define('_MD_DIGEST','خلاصه کن'); define('_MD_UNDIGEST','غیر خلاصه کن'); define('_MD_DESC_DELETE','وقتی شما دکمه حذف کن را در پایین میزنید؛ این عنوان که انتخاب کرده اید به همراه تمام پیامهای نوشته شده و متعلق به آن <strong>کاملاً</strong>حذف خواهند شد.'); +define('_MD_DESC_RESTORE','وقتی شما دکمه بازیابی کن را در پایین میزنید؛ این عنوان که انتخاب کرده اید به همراه تمام پیامهای نوشته شده و متعلق به آن بازیابی خواهند شد.'); define('_MD_DESC_MOVE','وقتی شما دکمه منتقل کن در پایین را میزنید، این عنوان که انتخاب کرده اید به همراه تمام پیامهای نوشته شده و متعلق به آن به انجمنی که انتخاب کرده اید منتقل میشود.'); define('_MD_DESC_MERGE','وقتی شما دکمه ادغام کن در پایین را میزنید، این عنوان که انتخاب کرده اید به همراه تمام پیامهای نوشته شده و متعلق به آن با عنوانی که انتخاب خواهید کرد ادغام می شود.<br /><strong>شماره شناسایی (ID) عنوان مقصد باید کوچکتر از این عنوان باشد</strong>.'); define('_MD_DESC_LOCK','وقتی شما دکمه قفل کن در پایین را میزنید، این عنوان که انتخاب کرده اید قفل خواهد شد. شما بعدا اگر بخواهید دوباره می توانید آن را از حالت قفل خارج کنید.'); Modified: XoopsModules/newbb/branches/irmtfan/newbb/list.topic.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/list.topic.php 2012-09-17 13:16:30 UTC (rev 10183) +++ XoopsModules/newbb/branches/irmtfan/newbb/list.topic.php 2012-09-18 09:51:54 UTC (rev 10184) @@ -33,6 +33,8 @@ $type = intval( @$_GET['type'] ); $status = (!empty($_GET['status']) && in_array($_GET['status'], array("active", "pending", "deleted", "digest", "unreplied", "unread")))? $_GET['status'] : "all"; +//irmtfan parse status for rendering topic correctly - if empty($_GET(status)) it will show all topics include deleted and pendings. +$topic_renderer->parseVar('status',$status); $mode = (!empty($status) && in_array($status, array("active", "pending", "deleted"))) ? 2 : (!empty($_GET['mode']) ? intval($_GET['mode']) : 0); $isadmin = $GLOBALS["xoopsUserIsAdmin"]; Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewall.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewall.html 2012-09-17 13:16:30 UTC (rev 10183) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewall.html 2012-09-18 09:51:54 UTC (rev 10184) @@ -45,13 +45,16 @@ <input type="hidden" name="forum_id" value="<{$forum_id}>" /> <input type="submit" name="submit" value="<{$smarty.const._SUBMIT}>" /> | <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/list.topic.php" target="_self" title="<{$smarty.const._MD_TYPE_VIEW}>"><{$smarty.const._MD_TYPE_VIEW}></a> -<{elseif $mode eq 1}> +<!-- irmtfan remove < { elseif $mode eq 1} > to show all admin links in admin mode in the initial page loading --> +<{else}> <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/list.topic.php?status=active#admin" target="_self" title="<{$smarty.const._MD_TYPE_ADMIN}>"><{$smarty.const._MD_TYPE_ADMIN}></a> | <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/list.topic.php?status=pending#admin" target="_self" title="<{$smarty.const._MD_TYPE_PENDING}>"><{$smarty.const._MD_TYPE_PENDING}></a> | <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/list.topic.php?status=deleted#admin" target="_self" title="<{$smarty.const._MD_TYPE_DELETED}>"><{$smarty.const._MD_TYPE_DELETED}></a> | <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/moderate.php" target="_self" title="<{$smarty.const._MD_TYPE_SUSPEND}>"><{$smarty.const._MD_TYPE_SUSPEND}></a> -<{else}> -<a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/list.topic.php?mode=1#admin" target="_self" title="<{$smarty.const._MD_TYPE_VIEW}>"><{$smarty.const._MD_TYPE_VIEW}></a> +<!-- irmtfan remove < { else } > no need for mode=1 +< { else } > +<!--<a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/list.topic.php?mode=1#admin" target="_self" title="<{$smarty.const._MD_TYPE_VIEW}>"><{$smarty.const._MD_TYPE_VIEW}></a> +--> <{/if}> </div> <br /> Modified: XoopsModules/newbb/branches/irmtfan/newbb/topicmanager.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/topicmanager.php 2012-09-17 13:16:30 UTC (rev 10183) +++ XoopsModules/newbb/branches/irmtfan/newbb/topicmanager.php 2012-09-18 09:51:54 UTC (rev 10184) @@ -70,8 +70,8 @@ $online_handler =& xoops_getmodulehandler('online', 'newbb'); $online_handler->init($forum); } - -$action_array = array('merge', 'delete','move','lock','unlock','sticky','unsticky','digest','undigest'); +// irmtfan add restore to viewtopic +$action_array = array('merge', 'delete','restore', 'move','lock','unlock','sticky','unsticky','digest','undigest'); foreach ($action_array as $_action) { $action[$_action] = array( "name" => $_action, @@ -98,6 +98,8 @@ foreach ($topic_id as $tid) { $topic_obj =& $topic_handler->get($tid); $topic_handler->delete($topic_obj,false); + // irmtfan - sync topic after delete + $topic_handler->synchronization($topic_obj); $forum_handler->synchronization($forum); //$topic_obj->loadFilters("delete"); //sync($topic_id, "topic"); @@ -115,16 +117,20 @@ $topic_handler->synchronization($topic_obj); $forums[$topic_obj->getVar("forum_id")] = 1; } - $criteria = new Criteria('topic_id', "(".implode(",", $topic_id).")", "IN"); - $post_handler =& xoops_getmodulehandler('post', 'newbb'); - $post_handler->updateAll("approved", 1, $criteria, true); + //irmtfan remove - no need to approve posts manually - see class/post.php approve function $criteria_forum = new Criteria("forum_id", "(".implode(",", array_keys($forums)).")", "IN"); $forums_obj =& $forum_handler->getAll($criteria_forum); foreach (array_keys($forums_obj) as $id) { $forum_handler->synchronization($forums_obj[$id]); } - unset($topics_obj, $forums_obj); - echo $action[$mode]['msg']."<p><a href='".XOOPS_URL."/modules/".$xoopsModule->getVar("dirname")."viewforum.php?forum=$forum'>"._MD_RETURNTOTHEFORUM."</a></p><p><a href='index.php'>"._MD_RETURNFORUMINDEX."</a></p>"; + unset($topics_obj, $forums_obj); + // irmtfan add restore to viewtopic + $restoretopic_id=$topic_obj->getVar("topic_id"); + // irmtfan / missing in URL + echo $action[$mode]['msg']. + "<p><a href='".XOOPS_URL."/modules/".$xoopsModule->getVar("dirname")."/viewtopic.php?topic_id=$restoretopic_id'>"._MD_VIEWTHETOPIC."</a></p>". + "<p><a href='".XOOPS_URL."/modules/".$xoopsModule->getVar("dirname")."/viewforum.php?forum=$forum'>"._MD_RETURNTOTHEFORUM."</a></p>". + "<p><a href='index.php'>"._MD_RETURNFORUMINDEX."</a></p>"; } elseif ('merge' == $mode) { $post_handler =& xoops_getmodulehandler('post', 'newbb'); Modified: XoopsModules/newbb/branches/irmtfan/newbb/viewforum.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/viewforum.php 2012-09-17 13:16:30 UTC (rev 10183) +++ XoopsModules/newbb/branches/irmtfan/newbb/viewforum.php 2012-09-18 09:51:54 UTC (rev 10184) @@ -44,6 +44,8 @@ $forum_id = intval($_GET['forum']); $type = @intval($_GET['type']); $status = (!empty($_GET['status']) && in_array($_GET['status'], array("active", "pending", "deleted", "digest", "unreplied", "unread")))? $_GET['status'] : ""; +// irmtfan add mode +$mode = (!empty($status) && in_array($status, array("active", "pending", "deleted"))) ? 2 : (!empty($_GET['mode']) ? intval($_GET['mode']) : 0); $forum_handler = xoops_getmodulehandler('forum', 'newbb'); $forum_obj = $forum_handler->get($forum_id); @@ -81,8 +83,11 @@ /* Only admin has access to admin mode */ if (!$isadmin) { $status = (!empty($status) && in_array($status, array("active", "pending", "deleted"))) ? "" : $status; + // irmtfan add mode + $mode=0; } - +// irmtfan add mode +$xoopsTpl->assign('mode', $mode); $xoopsTpl->assign('status', $status); if ( $isadmin ) { $xoopsTpl->assign('forum_index_cpanel',array("link" => "admin/index.php", "name" => _MD_ADMINCP)); Modified: XoopsModules/newbb/branches/irmtfan/newbb/viewtopic.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/viewtopic.php 2012-09-17 13:16:30 UTC (rev 10183) +++ XoopsModules/newbb/branches/irmtfan/newbb/viewtopic.php 2012-09-18 09:51:54 UTC (rev 10184) @@ -312,6 +312,8 @@ $ad_merge = ""; $ad_move = ""; $ad_delete = ""; +// irmtfan add restore to viewtopic +$ad_restore=""; $ad_lock = ""; $ad_unlock = ""; $ad_sticky = ""; @@ -319,6 +321,9 @@ $ad_digest = ""; $ad_undigest = ""; +// START irmtfan add restore to viewtopic +// if the topic is active +if ($topic_obj->getVar('approved') > 0 ){ $admin_actions['merge'] = array( "link" => XOOPS_URL.'/modules/'.$xoopsModule->getVar("dirname", "n").'/topicmanager.php?mode=merge&topic_id='.$topic_id, "name" => _MD_MERGETOPIC, @@ -364,6 +369,15 @@ "image" => $ad_undigest, "name" => _MD_UNDIGESTTOPIC); } +// if the topic is pending/deleted then restore/approve +}else{ +$admin_actions['restore'] = array( + "link" => XOOPS_URL.'/modules/'.$xoopsModule->getVar("dirname", "n").'/topicmanager.php?mode=restore&topic_id='.$topic_id, + "name" => _MD_RESTORETOPIC, + "image" => $ad_restore); +} +// END irmtfan add restore to viewtopic + $xoopsTpl->assign_by_ref('admin_actions', $admin_actions); $xoopsTpl->assign('viewer_level', intval(($isadmin) ? 2 : is_object($xoopsUser)) ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ir...@us...> - 2012-08-06 06:31:04
|
Revision: 9992 http://xoops.svn.sourceforge.net/xoops/?rev=9992&view=rev Author: irmtfan Date: 2012-08-06 06:30:55 +0000 (Mon, 06 Aug 2012) Log Message: ----------- hardcodes fix in search, icon path, templates and english style readme added Modified Paths: -------------- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev9883.txt XoopsModules/newbb/branches/irmtfan/newbb/class/forum.php XoopsModules/newbb/branches/irmtfan/newbb/search.php XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/english/style.css XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_index.html XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_thread.html XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewforum_subforum.html XoopsModules/newbb/branches/irmtfan/newbb/viewpost.php XoopsModules/newbb/branches/irmtfan/newbb/viewtopic.php Added Paths: ----------- XoopsModules/newbb/branches/irmtfan/newbb/docs/readme.txt Modified: XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev9883.txt =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev9883.txt 2012-08-05 23:03:22 UTC (rev 9991) +++ XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev9883.txt 2012-08-06 06:30:55 UTC (rev 9992) @@ -1,4 +1,19 @@ Changelog from rev.9883 +date: 2012-08-06 +================================================ +1- hardcode fix: using header php command instead of redirect_header XOOPS function (deka87/irmtfan) +in newbb/search.php +(Also hardcoded in latest core in xoops2.5.5/htdocs/search.php) + +2- hardcode fix: icon_path smarty variable was hardcoded in viewtopic and viewpost and is not defined in class/forum.php (irmtfan) +in newbb/viewtopic.php, newbb/viewpost.php, newbb/class/forum.php + +3- hardcode icons and some hardcodes has been solved in templates: +in newbb/templates/newbb_thread.html, newbb/templates/newbb_index.html, newbb/templates/newbb_viewforum_subforum.html + +4- add readme.txt +in docs/readme.txt + date: 2012-08-04 ================================================ 1- bug fixed: error in newbb/polls.php when the strtotime is not defined in XoopsLocal class (irmtfan) Modified: XoopsModules/newbb/branches/irmtfan/newbb/class/forum.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/class/forum.php 2012-08-05 23:03:22 UTC (rev 9991) +++ XoopsModules/newbb/branches/irmtfan/newbb/class/forum.php 2012-08-06 06:30:55 UTC (rev 9992) @@ -1,905 +1,909 @@ -<?php -/** - * Newbb module - * - * You may not change or alter any portion of this comment or credits - * of supporting developers from this source code or any supporting source code - * which is considered copyrighted (c) material of the original comment or credit authors. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ - * @license http://www.fsf.org/copyleft/gpl.html GNU public license - * @package newbb - * @since 4.0 - * @author Taiwen Jiang <ph...@us...> - * @version $Id: forum.php 2169 2008-09-23 13:37:10Z phppp $ - */ - -if (!defined("XOOPS_ROOT_PATH")) { - exit(); -} - -class Forum extends XoopsObject -{ - - function Forum() - { - $this->__construct(); - } - - - function __construct() - { - $this->XoopsObject(); - $this->initVar('forum_id', XOBJ_DTYPE_INT); - $this->initVar('forum_name', XOBJ_DTYPE_TXTBOX); - $this->initVar('forum_desc', XOBJ_DTYPE_TXTBOX); - $this->initVar('forum_moderator', XOBJ_DTYPE_ARRAY, serialize(array())); - $this->initVar('forum_topics', XOBJ_DTYPE_INT); - $this->initVar('forum_posts', XOBJ_DTYPE_INT); - $this->initVar('forum_last_post_id', XOBJ_DTYPE_INT); - $this->initVar('cat_id', XOBJ_DTYPE_INT); - $this->initVar('parent_forum', XOBJ_DTYPE_INT); - $this->initVar('hot_threshold', XOBJ_DTYPE_INT, 20); - $this->initVar('attach_maxkb', XOBJ_DTYPE_INT, 500); - $this->initVar('attach_ext', XOBJ_DTYPE_SOURCE, "zip|jpg|gif|png"); - $this->initVar('forum_order', XOBJ_DTYPE_INT, 99); - $this->initVar("dohtml", XOBJ_DTYPE_INT, 1); - } - - function disp_forumModerators() - { - global $xoopsModuleConfig; - - $ret = ""; - if (!$valid_moderators = $this->getVar("forum_moderator")) { - return $ret; - } - require_once XOOPS_ROOT_PATH . "/modules/newbb/include/functions.user.php"; - $moderators = newbb_getUnameFromIds($valid_moderators, !empty($xoopsModuleConfig['show_realname']), true); - $ret = implode(", ", $moderators); - return $ret; - } -} - -class NewbbForumHandler extends XoopsPersistableObjectHandler -{ - - function __construct(&$db) - { - parent::__construct($db, "bb_forums", 'Forum', 'forum_id', 'forum_name'); - } - - function NewbbForumHandler(&$db) - { - $this->__construct($db); - } - - - function insert($forum) - { - if (!parent::insert($forum, true)) { - return false; - } - - if ($forum->isNew()) { - $this->applyPermissionTemplate($forum); - } - - return $forum->getVar('forum_id'); - } - - function delete(&$forum) - { - global $xoopsModule; - // RMV-NOTIFY - xoops_notification_deletebyitem ($xoopsModule->getVar('mid'), 'forum', $forum->getVar('forum_id')); - // Get list of all topics in forum, to delete them too - $topic_handler =& xoops_getmodulehandler('topic', 'newbb'); - $topic_handler->deleteAll(new Criteria("forum_id", $forum->getVar('forum_id')), true, true); - $this->updateAll("parent_forum", $forum->getVar('parent_forum'), new Criteria("parent_forum", $forum->getVar('forum_id'))); - $this->deletePermission($forum); - return parent::delete($forum); - } - - function getIdsByPermission($perm = "access") - { - $perm_handler = xoops_getmodulehandler('permission', 'newbb'); - return $perm_handler->getForums($perm); - } - - function &getByPermission($cat = 0, $permission = "access", $tags = null, $asObject = true) - { - $_cachedForums = array(); - if ( !$valid_ids = $this->getIdsByPermission($permission) ) { - return $_cachedForums; - } - - $criteria = new CriteriaCompo( new Criteria("forum_id", "(" . implode(", ", $valid_ids) . ")", "IN") ); - if (is_numeric($cat) && $cat> 0) { - $criteria->add(new Criteria("cat_id", intval($cat))); - } elseif (is_array($cat) && count($cat) >0) { - $criteria->add(new Criteria("cat_id", "(" . implode(", ", $cat) . ")", "IN")); - } - $criteria->setSort("forum_order"); - $criteria->setOrder("ASC"); - $_cachedForums =& $this->getAll($criteria, $tags, $asObject); - return $_cachedForums; - } - - function &getForumsByCategory($categoryid = 0, $permission = "", $asObject = true, $tags = null) - { - $forums =& $this->getByPermission($categoryid, $permission, $tags); - if ($asObject) return $forums; - - $forums_array = array(); - $array_cat=array(); - $array_forum=array(); - if (!is_array($forums)) return array(); - foreach (array_keys($forums) as $forumid) { - $forum =& $forums[$forumid]; - $forums_array[$forum->getVar('parent_forum')][$forumid] = array( - 'cid' => $forum->getVar('cat_id'), - 'title' => $forum->getVar('forum_name') - ); - } - if (!isset($forums_array[0])) { - $ret = array(); - return $ret; - } - foreach ($forums_array[0] as $key => $forum) { - if (isset($forums_array[$key])) { - $forum['sub'] = $forums_array[$key]; - } - $array_forum[$forum['cid']][$key] = $forum; - } - ksort($array_forum); - unset($forums); - unset($forums_array); - return $array_forum; - } - - function getAllTopics(&$forum, $criteria = null) - { - global $xoopsModule, $xoopsConfig, $xoopsModuleConfig, $myts, $xoopsUser, $viewall_forums; - - require_once XOOPS_ROOT_PATH . "/modules/newbb/include/functions.render.php"; - require_once XOOPS_ROOT_PATH . "/modules/newbb/include/functions.session.php"; - require_once XOOPS_ROOT_PATH . "/modules/newbb/include/functions.time.php"; - require_once XOOPS_ROOT_PATH . "/modules/newbb/include/functions.read.php"; - require_once XOOPS_ROOT_PATH . "/modules/newbb/include/functions.topic.php"; - - $criteria_vars = array("startdate", "start", "sort", "order", "type", "status", "excerpt"); - foreach ($criteria_vars as $var) { - ${$var} = $criteria[$var]; - } - - $topic_lastread = newbb_getcookie('LT', true); - - if (is_object($forum)) { - $criteria_forum = ' AND t.forum_id = ' . $forum->getVar('forum_id'); - $hot_threshold = $forum->getVar('hot_threshold'); - } else { - $hot_threshold = 10; - if (is_array($forum) && count($forum) > 0) { - $criteria_forum = ' AND t.forum_id IN (' . implode(',', array_keys($forum)) . ')'; - } elseif (!empty($forum)) { - $criteria_forum = ' AND t.forum_id =' . intval($forum); - } else { - $criteria_forum = ''; - } - } - - $criteria_post = ($startdate) ? ' p.post_time > ' . $startdate : " 1 = 1 "; - $criteria_topic = empty($type) ? '' : " AND t.type_id={$type}"; - $criteria_extra = ''; - $criteria_approve = ' AND t.approved = 1'; - $post_on = ' p.post_id = t.topic_last_post_id'; - $leftjoin = ' LEFT JOIN ' . $this->db->prefix('bb_posts') . ' p ON p.post_id = t.topic_last_post_id'; - $sort_array = array(); - switch ($status) { - case 'digest': - $criteria_extra = ' AND t.topic_digest = 1'; - break; - - case 'unreplied': - $criteria_extra = ' AND t.topic_replies < 1'; - break; - - case 'unread': - if (empty($xoopsModuleConfig["read_mode"])) { - } elseif ($xoopsModuleConfig["read_mode"] ==2) { - $leftjoin .= ' LEFT JOIN ' . $this->db->prefix('bb_reads_topic') . ' r ON r.read_item = t.topic_id'; - $criteria_post .= ' AND (r.read_id IS NULL OR r.post_id < t.topic_last_post_id)'; - } elseif ($xoopsModuleConfig["read_mode"] == 1) { - $topics = array(); - $topic_lastread = newbb_getcookie('LT', true); - if (count($topic_lastread)>0) { - foreach ($topic_lastread as $id => $time) { - if ($time > $time_criterion) $topics[] = $id; - } - } - if (count($topics)>0) { - $criteria_extra = ' AND t.topic_id NOT IN (' . implode(",", $topics) . ')'; - } - if ($lastvisit = max($GLOBALS['last_visit'], $startdate)) { - $criteria_post = ' p.post_time > ' . max($GLOBALS['last_visit'], $startdate); - } - } - break; - - case 'pending': - $post_on = ' p.topic_id = t.topic_id'; - $criteria_post .= ' AND p.pid = 0'; - $criteria_approve = ' AND t.approved = 0'; - break; - - case 'deleted': - $criteria_approve = ' AND t.approved = -1'; - break; - - case 'all': // For viewall.php; do not display sticky topics at first - case 'active': // same as "all" - break; - - default: - if ($startdate > 0) { - $criteria_post = ' (p.post_time > ' . $startdate . ' OR t.topic_sticky=1)'; - } - $sort_array[] = 't.topic_sticky DESC'; - break; - } - - $select = 't.*, ' . - ' p.post_time as last_post_time, p.poster_name as last_poster_name, p.icon, p.post_id, p.uid'; - $from = $this->db->prefix("bb_topics") . ' t ' . $leftjoin; - $where = $criteria_post. $criteria_topic. $criteria_forum . $criteria_extra . $criteria_approve; - - if ($excerpt) { - $select .= ', p.post_karma, p.require_reply, pt.post_text'; - $from .= ' LEFT JOIN ' . $this->db->prefix('bb_posts_text') . ' pt ON pt.post_id = t.topic_last_post_id'; - } - if ($sort == "u.uname") { - $sort = "t.topic_poster"; - } - - $sort_array[] = trim($sort . ' ' . $order); - $sortby = implode(", ", array_filter($sort_array) ); - if (empty($sortby)) $sortby = 't.topic_last_post_id DESC'; - - - $sql = 'SELECT ' . $select . - ' FROM ' . $from . - ' WHERE ' . $where . - ' ORDER BY ' . $sortby; - - if (!$result = $this->db->query($sql, $xoopsModuleConfig['topics_per_page'], $start)) { - redirect_header('index.php', 2, _MD_ERROROCCURED); - exit(); - } - - $sticky = 0; - $topics = array(); - $posters = array(); - $reads = array(); - $types = array(); - - $type_handler =& xoops_getmodulehandler('type', 'newbb'); - $typen = $type_handler->getByForum($forum->getVar('forum_id')); - while ($myrow = $this->db->fetchArray($result)) { - - if ($myrow['topic_sticky']) { - $sticky++; - } - - // ------------------------------------------------------ - // topic_icon: priority: sticky -> digest -> regular - - if ($myrow['topic_haspoll']) { - if ($myrow['topic_sticky']) { - $topic_icon = newbb_displayImage('topic_sticky', _MD_TOPICSTICKY) . '<br />' . newbb_displayImage('poll', _MD_TOPICHASPOLL); - } else { - $topic_icon = newbb_displayImage('poll', _MD_TOPICHASPOLL); - } - } elseif ($myrow['topic_sticky']) { - $topic_icon = newbb_displayImage('topic_sticky', _MD_TOPICSTICKY); - } elseif (!empty($myrow['icon'])) { - $topic_icon = '<img src="' . XOOPS_URL . '/images/subject/' . htmlspecialchars($myrow['icon']) . '" alt="" />'; - } else { - $topic_icon = '<img src="' . XOOPS_URL . '/images/icons/no_posticon.gif" alt="" />'; - } - - // ------------------------------------------------------ - // rating_img - $rating = number_format($myrow['rating'] / 2, 0); - $rating_img = newbb_displayImage( ($rating < 1) ? 'blank' : 'rate' . $rating ); - - // ------------------------------------------------------ - // topic_page_jump - $topic_page_jump = ''; - $topic_page_jump_icon = ''; - $totalpages = ceil(($myrow['topic_replies'] + 1) / $xoopsModuleConfig['posts_per_page']); - if ($totalpages > 1) { - $topic_page_jump .= ' '; - $append = false; - for ($i = 1; $i <= $totalpages; $i++) { - if ($i > 3 && $i < $totalpages) { - if (!$append) { - $topic_page_jump .= "..."; - $append = true; - } - } else { - $topic_page_jump .= '[<a href="' . XOOPS_URL . '/modules/newbb/viewtopic.php?topic_id=' . $myrow['topic_id'] . '&start=' . (($i - 1) * $xoopsModuleConfig['posts_per_page']) . '">' . $i . '</a>]'; - $topic_page_jump_icon = "<a href='" . XOOPS_URL . "/modules/newbb/viewtopic.php?post_id=" . $myrow['post_id'] . "&start=" . (($i - 1) * $xoopsModuleConfig['posts_per_page']) . "'>" . newbb_displayImage('lastposticon',_MD_NEWBB_GOTOLASTPOST) . "</a>"; - } - } - } - else { - $topic_page_jump_icon = "<a href='" . XOOPS_URL . "/modules/newbb/viewtopic.php?post_id=" . $myrow['post_id'] . "'>" . newbb_displayImage('lastposticon',_MD_NEWBB_GOTOLASTPOST) . "</a>"; - } - - // ------------------------------------------------------ - // => topic array - if (!empty($viewall_forums[$myrow['forum_id']])) { - $forum_link = '<a href="' . XOOPS_URL . '/modules/newbb/viewforum.php?forum=' . $myrow['forum_id'] . '">' . $viewall_forums[$myrow['forum_id']]['forum_name'] . '</a>'; - } else { - $forum_link = ''; - } - - $topic_title = $myts->htmlSpecialChars( $myrow['topic_title'] ); - if ($myrow['type_id'] > 0) { - $topic_title = '<font color="'.$typen[$myrow["type_id"]]["type_color"].'">['.$typen[$myrow["type_id"]]["type_name"].']</font> '.$topic_title.''; - } - if ($myrow['topic_digest']) { - $topic_title = "<span class='digest'>" . $topic_title . "</span>"; - } - - if ( $excerpt == 0 ) { - $topic_excerpt = ""; - } elseif ( ($myrow['post_karma'] > 0 || $myrow['require_reply'] > 0) && !newbb_isAdmin($forum) ) { - $topic_excerpt = ""; - } else { - $topic_excerpt = xoops_substr(newbb_html2text($myts->displayTarea($myrow['post_text'])), 0, $excerpt); - $topic_excerpt = str_replace("[", "[", $myts->htmlSpecialChars($topic_excerpt)); - } - - /* users */ - $posters[$myrow['topic_poster']] = 1; - $posters[$myrow['uid']] = 1; - // reads - if (!empty($xoopsModuleConfig["read_mode"])) { - $reads[$myrow['topic_id']] = ($xoopsModuleConfig["read_mode"] == 1) ? $myrow['last_post_time'] : $myrow["topic_last_post_id"]; - } - - $topic_poster = newbb_getUnameFromId($myrow['topic_poster'], $xoopsModuleConfig['show_realname'], true); - $topic_last_poster = newbb_getUnameFromId($myrow['uid'], $xoopsModuleConfig['show_realname'], true); - $topic_isRead = newbb_isRead("topic", $reads); - - $topic_prefix = (!empty($typen[$myrow['type_id']])) ? getTopicTitle("", $typen[$myrow['type_id']]["type_name"], $typen[$myrow['type_id']]["type_color"]) : ""; - - // ------------------------------------------------------ - // topic_folder: priority: newhot -> hot/new -> regular - if ($myrow['topic_status'] == 1) { - $topic_folder = 'topic_locked'; - $topic_folder_text = _MD_TOPICLOCKED; - } else { - if ($myrow['topic_digest']) { - $topic_folder = 'topic_digest'; - $topic_folder_text = _MD_TOPICDIGEST; - } elseif ($myrow['topic_replies'] >= $hot_threshold) { - $topic_folder = empty($topic_isRead[$myrow['topic_id']]) ? 'topic_hot_new' : 'topic_hot'; - $topic_folder_text = empty($topic_isRead[$myrow['topic_id']]) ? _MD_MORETHAN : _MD_MORETHAN2; - } else { - $topic_folder = empty($topic_isRead[$myrow['topic_id']]) ? 'topic_new' : 'topic'; - $topic_folder_text = empty($topic_isRead[$myrow['topic_id']]) ? _MD_NEWPOSTS : _MD_NONEWPOSTS; - } - } - - - $topics[$myrow['topic_id']] = array( - 'topic_id' => $myrow['topic_id'], - 'topic_icon' => $topic_icon, - 'type_id' => $myrow['type_id'], - 'type_text' => $topic_prefix, - 'topic_title' => $topic_title, - //'topic_link' => XOOPS_URL . '/modules/newbb/viewtopic.php?topic_id=' . $myrow['topic_id'], - 'topic_link' => 'viewtopic.php?topic_id=' . $myrow['topic_id'], - 'rating_img' => $rating_img, - 'topic_page_jump' => $topic_page_jump, - 'topic_page_jump_icon' => $topic_page_jump_icon, - 'topic_replies' => $myrow['topic_replies'], - 'topic_poster_uid' => $myrow['topic_poster'], - 'topic_poster_name' => $myts->htmlSpecialChars( ($myrow['poster_name']) ? $myrow['poster_name'] : $xoopsConfig['anonymous'] ), - 'topic_views' => $myrow['topic_views'], - 'topic_time' => newbb_formatTimestamp($myrow['topic_time']), - 'topic_last_posttime' => newbb_formatTimestamp($myrow['last_post_time']), - 'topic_last_poster_uid' => $myrow['uid'], - 'topic_last_poster_name' => $myts->htmlSpecialChars( ($myrow['last_poster_name']) ? $myrow['last_poster_name'] : $xoopsConfig['anonymous'] ), - 'topic_forum_link' => $forum_link, - 'topic_excerpt' => $topic_excerpt, - 'stick' => empty($myrow['topic_sticky']), - //"stats" => array($myrow['topic_status'], $myrow['topic_digest'], $myrow['topic_replies']), - "topic_poster" => $topic_poster, - "topic_last_poster" => $topic_last_poster, - "topic_folder" => newbb_displayImage($topic_folder,$topic_folder_text), - ); - - - } - - if ( count($topics) > 0) { - $sql = " SELECT DISTINCT topic_id FROM " . $this->db->prefix("bb_posts"). - " WHERE attachment != ''" . - " AND topic_id IN (" . implode(',', array_keys($topics)) . ")"; - if ($result = $this->db->query($sql)) { - while (list($topic_id) = $this->db->fetchRow($result)) { - $topics[$topic_id]['attachment'] = ' ' . newbb_displayImage('attachment', _MD_TOPICSHASATT); - } - } - } - return array($topics, $sticky); - } - - function getTopicCount(&$forum, $startdate, $type) - { - global $xoopsModuleConfig; - require_once XOOPS_ROOT_PATH . "/modules/newbb/include/functions.session.php"; - - $criteria_extra = ''; - $criteria_approve = ' AND t.approved = 1'; // any others? - $leftjoin = ' LEFT JOIN ' . $this->db->prefix('bb_posts') . ' p ON p.post_id = t.topic_last_post_id'; - $criteria_post = ' p.post_time > ' . $startdate; - switch ($type) { - case 'digest': - $criteria_extra = ' AND topic_digest = 1'; - break; - case 'unreplied': - $criteria_extra = ' AND topic_replies < 1'; - break; - case 'unread': - if (empty($xoopsModuleConfig["read_mode"])) { - } elseif ($xoopsModuleConfig["read_mode"] ==2) { - $leftjoin .= ' LEFT JOIN ' . $this->db->prefix('bb_reads_topic') . ' r ON r.read_item = t.topic_id'; - $criteria_post .= ' AND (r.read_id IS NULL OR r.post_id < t.topic_last_post_id)'; - } elseif ($xoopsModuleConfig["read_mode"] == 1) { - $criteria_post = ' p.post_time > ' . max($GLOBALS['last_visit'], $startdate); - $topics = array(); - $topic_lastread = newbb_getcookie('LT', true); - if (count($topic_lastread)>0) foreach ($topic_lastread as $id=>$time) { - if ($time > $time_criterion) $topics[] = $id; - } - if (count($topics)>0) { - $criteria_extra = ' AND t.topic_id NOT IN (' . implode(",", $topics) . ')'; - } - } - break; - case 'pending': - $criteria_approve = ' AND t.approved = 0'; - break; - case 'deleted': - $criteria_approve = ' AND t.approved = -1'; - break; - case 'all': - break; - default: - $criteria_post = ' (p.post_time > ' . $startdate . ' OR t.topic_sticky=1)'; - break; - } - if (is_object($forum)) { - $criteria_forum = ' AND t.forum_id = ' . $forum->getVar('forum_id'); - } else { - if (is_array($forum) && count($forum) > 0) { - $criteria_forum = ' AND t.forum_id IN (' . implode(',', array_keys($forum)) . ')'; - } elseif (!empty($forum)) { - $criteria_forum = ' AND t.forum_id =' . intval($forum); - } else { - $criteria_forum = ''; - } - } - - $sql = 'SELECT COUNT(*) as count FROM ' . $this->db->prefix("bb_topics") . ' t ' . $leftjoin; - $sql .= ' WHERE ' . $criteria_post . $criteria_forum . $criteria_extra . $criteria_approve; - if (!$result = $this->db->query($sql)) { - //xoops_error($this->db->error().'<br />'.$sql); - return null; - } - $myrow = $this->db->fetchArray($result); - $count = $myrow['count']; - return $count; - } - - // get permission - function getPermission($forum, $type = "access", $checkCategory = true) - { - global $xoopsUser, $xoopsModule; - static $_cachedPerms; - - if ($type == "all") return true; - if ($GLOBALS["xoopsUserIsAdmin"] && $xoopsModule->getVar("dirname") == "newbb") { - return true; - } - - if (!is_object($forum)) $forum =& $this->get($forum); - - if (!empty($checkCategory)) { - $category_handler =& xoops_getmodulehandler('category', 'newbb'); - $categoryPerm = $category_handler->getPermission($forum->getVar('cat_id')); - if (!$categoryPerm) return false; - } - - $type = strtolower($type); - if ("moderate" == $type) { - require_once XOOPS_ROOT_PATH . "/modules/newbb/include/functions.user.php"; - $permission = newbb_isModerator($forum); - } else { - $forum_id = $forum->getVar('forum_id'); - $perm_handler =& xoops_getmodulehandler('permission', 'newbb'); - $permission = $perm_handler->getPermission("forum", $type, $forum_id); - } - return $permission; - } - - function deletePermission(&$forum) - { - $perm_handler =& xoops_getmodulehandler('permission', 'newbb'); - return $perm_handler->deleteByForum($forum->getVar("forum_id")); - } - - function applyPermissionTemplate(&$forum) - { - $perm_handler =& xoops_getmodulehandler('permission', 'newbb'); - return $perm_handler->applyTemplate($forum->getVar("forum_id")); - } - - /* - function isForum($forum) - { - $count = false; - $sql = 'SELECT COUNT(*) as count FROM ' . $this->db->prefix("bb_forums"); - $sql .= ' WHERE forum_id=' . $forum ; - if ($result = $this->db->query($sql)) { - $myrow = $this->db->fetchArray($result); - $count = $myrow['count']; - } - return $count; - } - */ - - /** - * clean orphan items from database - * - * @return bool true on success - */ - function cleanOrphan() - { - parent::cleanOrphan($this->db->prefix("bb_categories"), "cat_id"); - - if (version_compare( mysql_get_server_info(), "4.1.0", "ge" )): - /* - $sql = "DELETE FROM ".$this->table. - " WHERE (parent_forum >0 AND parent_forum NOT IN ( SELECT DISTINCT forum_id FROM ".$this->table.") )"; - */ - $sql = " DELETE {$this->table} FROM {$this->table}" . - " LEFT JOIN {$this->table} AS aa ON {$this->table}.parent_forum = aa.forum_id ". - " WHERE {$this->table}.parent_forum>0 AND (aa.forum_id IS NULL)"; - if (!$result = $this->db->queryF($sql)): - //xoops_error("cleanOrphan error:". $sql); - endif; - else: - $this->identifierName = "parent_forum"; - $forum_list = $this->getList(new Criteria("parent_forum", 0, ">")); - $this->identifierName = "forum_name"; - if ($parent_forums = @array_values($forum_list)) { - $parent_list = $this->getIds(new Criteria("forum_id", "(" . implode(", ", $parent_forums) . ")", "IN")); - foreach ($forum_list as $forum_id => $parent_forum) { - if (in_array($parent_forum, $parent_list)) continue; - $forum_obj =& $this->get($forum_id); - $this->delete($forum_obj); - unset($forum_obj); - } - } - endif; - - return true; - } - - /** - * forum data synchronization - * - * @param mixed $object null for all forums; integer for forum_id; object for forum object - * @param integer $mode 1 for stats only; 2 for forum index data only; 0 for both - * - */ - function synchronization($object = null) - { - if (empty($object)) { - $forums = $this->getIds(); - foreach ($forums as $id) { - $this->synchronization($id); - } - return true; - } - - if (!is_object($object)) { - $object =& $this->get(intval($object)); - } - - if (!$object->getVar("forum_id")) return false; - $sql = "SELECT MAX(post_id) AS last_post, COUNT(*) AS total FROM " . $this->db->prefix("bb_posts") . " AS p LEFT JOIN " . $this->db->prefix("bb_topics") . " AS t ON p.topic_id=t.topic_id WHERE p.approved=1 AND t.approved=1 AND p.forum_id = ".$object->getVar("forum_id"); - - if ( $result = $this->db->query($sql)) { - $last_post = 0; - $posts = 0; - if ( $row = $this->db->fetchArray($result) ) { - $last_post = intval($row['last_post']); - $posts = intval($row['total']); - } - if ($object->getVar("forum_last_post_id") != $last_post) { - $object->setVar("forum_last_post_id", $last_post); - } - if ($object->getVar("forum_posts") != $posts) { - $object->setVar("forum_posts", $posts); - } - } - - $sql = "SELECT COUNT(*) AS total FROM " . $this->db->prefix("bb_topics") . " WHERE approved=1 AND forum_id = " . $object->getVar("forum_id"); - if ( $result = $this->db->query($sql) ) { - if ( $row = $this->db->fetchArray($result) ) { - if ($object->getVar("forum_topics") != $row['total']) { - $object->setVar("forum_topics", $row['total']); - } - } - } - $object->setDirty(); - return $this->insert($object, true); - } - - function getSubforumStats($subforums = null) - { - $stats = array(); - - require_once XOOPS_ROOT_PATH . "/modules/newbb/include/functions.forum.php"; - - $_subforums = newbb_getSubForum(); - if (empty($subforums)) { - $sub_forums = $_subforums; - } else { - foreach ($subforums as $id) { - $sub_forums[$id] =& $_subforums[$id]; - } - } - - $forums_id = array(); - foreach (array_keys($sub_forums) as $id) { - if (empty($sub_forums[$id])) continue; - $forums_id = array_merge($forums_id, $sub_forums[$id]); - } - if (!$forums_id) { - return $stats; - } - $sql = " SELECT forum_posts AS posts, forum_topics AS topics, forum_id AS id". - " FROM " . $this->table . - " WHERE forum_id IN (". implode(", ", $forums_id).")"; - if ( !$result = $this->db->query($sql) ) { - return $stats; - } - - $forum_stats = array(); - while( $row = $this->db->fetchArray($result) ) { - $forum_stats[$row["id"]] = array("topics" => $row["topics"], "posts" => $row["posts"]); - } - - foreach (array_keys($sub_forums) as $id) { - if (empty($sub_forums[$id])) continue; - $stats[$id] = array( "topics" => 0, "posts" => 0 ); - foreach ($sub_forums[$id] as $fid) { - $stats[$id]["topics"] += $forum_stats[$fid]["topics"]; - $stats[$id]["posts"] += $forum_stats[$fid]["posts"]; - } - } - - return $stats; - } - - function &display($forums, $length_title_index = 30, $count_subforum = 1) - { - global $xoopsModule, $xoopsConfig, $xoopsModuleConfig, $myts; - - $posts = array(); - $posts_obj = array(); - foreach (array_keys($forums) as $id) { - $posts[] = $forums[$id]["forum_last_post_id"]; - } - if (!empty($posts)) { - $post_handler =& xoops_getmodulehandler('post', 'newbb'); - $tags_post = array("uid", "topic_id", "post_time", "poster_name", "icon"); - if (!empty($length_title_index)) { - $tags_post[] = "subject"; - } - $posts = $post_handler->getAll(new Criteria("post_id", "(" . implode(", ", $posts) . ")", "IN"), $tags_post, false); - } - - - // Get topic/post stats per forum - $stats_forum = array(); - - if (!empty($count_subforum)) { - //$stats_forum = $this->getSubforumStats(array_keys($forums)); - } - - $users = array(); - $reads = array(); - $topics = array(); - - foreach (array_keys($forums) as $id) { - $forum =& $forums[$id]; - - if (!$forum["forum_last_post_id"]) continue; - if (!$post = @$posts[$forum["forum_last_post_id"]]) { - $forum["forum_last_post_id"] = 0; - continue; - } - - $users[] = $post["uid"]; - if ($moderators[$id] = $forum["forum_moderator"]) { - $users = array_merge($users, $moderators[$id]); - } - - // reads - if (!empty($xoopsModuleConfig["read_mode"])) { - $reads[$id] = ($xoopsModuleConfig["read_mode"] == 1) ? $post['post_time'] : $post['post_id']; - } - } - - require_once XOOPS_ROOT_PATH . "/modules/newbb/include/functions.user.php"; - require_once XOOPS_ROOT_PATH . "/modules/newbb/include/functions.time.php"; - require_once XOOPS_ROOT_PATH . "/modules/newbb/include/functions.render.php"; - require_once XOOPS_ROOT_PATH . "/modules/newbb/include/functions.read.php"; - $forum_isread = newbb_isRead("forum", $reads); - $users_linked = newbb_getUnameFromIds(array_unique($users), !empty($xoopsModuleConfig['show_realname']), true); - - $forums_array = array(); - $name_anonymous = $myts->htmlSpecialChars($GLOBALS["xoopsConfig"]["anonymous"]); - - foreach (array_keys($forums) as $id) { - - $forum =& $forums[$id]; - - $_forum_data = array(); - $_forum_data["forum_order"] = $forum['forum_order']; - $_forum_data["forum_id"] = $id; - $_forum_data["forum_cid"] = $forum['cat_id']; - $_forum_data["forum_name"] = $forum['forum_name']; - $_forum_data["forum_desc"] = $myts->displayTarea($forum['forum_desc']); - $_forum_data["forum_topics"]= $forum["forum_topics"] + @$stats_forum[$id]["topics"]; - $_forum_data["forum_posts"] = $forum["forum_posts"] + @$stats_forum[$id]["posts"]; - //$_forum_data["forum_type"]= $forum['forum_type']; - - $forum_moderators = array(); - if (!empty($moderators[$id])) { - foreach ( @$moderators[$id] as $moderator ) { - $forum_moderators[] = @$users_linked[$moderator]; - } - } - $_forum_data["forum_moderators"] = implode(", ", $forum_moderators); - - - if ($post_id = $forum["forum_last_post_id"]): - $post =& $posts[$post_id]; - $_forum_data['forum_lastpost_id'] = $post_id; - $_forum_data['forum_lastpost_time'] = newbb_formatTimestamp($post['post_time']); - if (!empty($users_linked[$post["uid"]])) { - $_forum_data["forum_lastpost_user"] = $users_linked[$post["uid"]]; - } elseif ($poster_name = $post["poster_name"]) { - $_forum_data["forum_lastpost_user"] = $poster_name; - } else { - $_forum_data["forum_lastpost_user"] = $name_anonymous; - } - if (!empty($length_title_index)) { - $subject = $post["subject"]; - if ($length_title_index < 255) { - $subject = xoops_substr($subject, 0, $length_title_index); - } - $_forum_data['forum_lastpost_subject'] = $subject; - } - $_forum_data['forum_lastpost_icon'] = 'lastposticon.png'; - endif; - - - $forum_folder = (empty($forum_isread[$id]) && $post_id > 0) ? 'forum_new' : 'forum'; - $_forum_data['forum_folder'] = newbb_displayImage($forum_folder); - - $forums_array[$forum['parent_forum']][] = $_forum_data; - } - - return $forums_array; - } - - - /** - * get a hierarchical tree of forums - * - * {@link newbbTree} - * - * @param int $cat_id category ID - * @param int $pid Top forum ID - * @param string $permission permission type - * @param string $prefix prefix for display - * @param string $tags variables to fetch - * @return array associative array of category IDs and sanitized titles - */ - function &getTree($cat_id = 0, $pid = 0, $permission = "access", $prefix = "--", $tags = null) - { - $pid = intval($pid); - $perm_string = $permission; - if (!is_array($tags) || count($tags)==0) { - $tags = array("forum_id", "parent_forum", "forum_name", "forum_order", "cat_id"); - } - $forums_obj = $this->getByPermission($cat_id, $perm_string, $tags); - - require_once dirname(__FILE__) . "/tree.php"; - $forums_structured = array(); - foreach (array_keys($forums_obj) as $key) { - $forums_structured[$forums_obj[$key]->getVar("cat_id")][$key] =& $forums_obj[$key]; - } - - foreach (array_keys($forums_structured) as $cid) { - $tree = new newbbObjectTree($forums_structured[$cid]); - $forum_array[$cid] = $tree->makeTree($prefix, $pid, $tags); - unset($tree); - } - - return $forum_array; - } - - /** - * get a hierarchical array tree of forums - * - * {@link newbbTree} - * - * @param int $cat_id category ID - * @param int $pid Top forum ID - * @param string $permission permission type - * @param string $tags variables to fetch - * @param integer $depth level of subcategories - * @return array associative array of category IDs and sanitized titles - */ - function &getArrayTree($cat_id =0, $pid = 0, $permission = "access", $tags = null, $depth = 0) - { - $pid = intval($pid); - $perm_string = $permission; - if (!is_array($tags) || count($tags)==0) $tags = array("forum_id", "parent_forum", "forum_name", "forum_order", "cat_id"); - $forums_obj =& $this->getByPermission($cat_id, $perm_string, $tags); - - require_once(dirname(__FILE__) . "/tree.php"); - $forums_structured = array(); - foreach (array_keys($forums_obj) as $key) { - $forum_obj =& $forums_obj[$key]; - $forums_structured[$forum_obj->getVar("cat_id")][$key] =& $forums_obj[$key]; - } - foreach (array_keys($forums_structured) as $cid) { - $tree = new newbbObjectTree($forums_structured[$cid]); - $forum_array[$cid] = $tree->makeArrayTree($pid, $tags, $depth); - unset($tree); - } - return $forum_array; - } - - function &getParents(&$object) - { - $ret = null; - if ( !$object->getVar("forum_id") ) return $ret; - - require_once XOOPS_ROOT_PATH . "/modules/newbb/include/functions.forum.php"; - if ( !$parents = newbb_getParentForum($object->getVar("forum_id")) ) return $ret; - $parents_list = $this->getList(new Criteria("forum_id", "(" . implode(", ", $parents) . ")", "IN")); - foreach ($parents as $key => $id) { - $ret[] = array("forum_id" => $id, "forum_name" => $parents_list[$id]); - } - unset($parents, $parents_list); - return $ret; - } -} +<?php +/** + * Newbb module + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @package newbb + * @since 4.0 + * @author Taiwen Jiang <ph...@us...> + * @version $Id: forum.php 2169 2008-09-23 13:37:10Z phppp $ + */ + +if (!defined("XOOPS_ROOT_PATH")) { + exit(); +} + +class Forum extends XoopsObject +{ + + function Forum() + { + $this->__construct(); + } + + + function __construct() + { + $this->XoopsObject(); + $this->initVar('forum_id', XOBJ_DTYPE_INT); + $this->initVar('forum_name', XOBJ_DTYPE_TXTBOX); + $this->initVar('forum_desc', XOBJ_DTYPE_TXTBOX); + $this->initVar('forum_moderator', XOBJ_DTYPE_ARRAY, serialize(array())); + $this->initVar('forum_topics', XOBJ_DTYPE_INT); + $this->initVar('forum_posts', XOBJ_DTYPE_INT); + $this->initVar('forum_last_post_id', XOBJ_DTYPE_INT); + $this->initVar('cat_id', XOBJ_DTYPE_INT); + $this->initVar('parent_forum', XOBJ_DTYPE_INT); + $this->initVar('hot_threshold', XOBJ_DTYPE_INT, 20); + $this->initVar('attach_maxkb', XOBJ_DTYPE_INT, 500); + $this->initVar('attach_ext', XOBJ_DTYPE_SOURCE, "zip|jpg|gif|png"); + $this->initVar('forum_order', XOBJ_DTYPE_INT, 99); + $this->initVar("dohtml", XOBJ_DTYPE_INT, 1); + } + + function disp_forumModerators() + { + global $xoopsModuleConfig; + + $ret = ""; + if (!$valid_moderators = $this->getVar("forum_moderator")) { + return $ret; + } + require_once XOOPS_ROOT_PATH . "/modules/newbb/include/functions.user.php"; + $moderators = newbb_getUnameFromIds($valid_moderators, !empty($xoopsModuleConfig['show_realname']), true); + $ret = implode(", ", $moderators); + return $ret; + } +} + +class NewbbForumHandler extends XoopsPersistableObjectHandler +{ + + function __construct(&$db) + { + parent::__construct($db, "bb_forums", 'Forum', 'forum_id', 'forum_name'); + } + + function NewbbForumHandler(&$db) + { + $this->__construct($db); + } + + + function insert($forum) + { + if (!parent::insert($forum, true)) { + return false; + } + + if ($forum->isNew()) { + $this->applyPermissionTemplate($forum); + } + + return $forum->getVar('forum_id'); + } + + function delete(&$forum) + { + global $xoopsModule; + // RMV-NOTIFY + xoops_notification_deletebyitem ($xoopsModule->getVar('mid'), 'forum', $forum->getVar('forum_id')); + // Get list of all topics in forum, to delete them too + $topic_handler =& xoops_getmodulehandler('topic', 'newbb'); + $topic_handler->deleteAll(new Criteria("forum_id", $forum->getVar('forum_id')), true, true); + $this->updateAll("parent_forum", $forum->getVar('parent_forum'), new Criteria("parent_forum", $forum->getVar('forum_id'))); + $this->deletePermission($forum); + return parent::delete($forum); + } + + function getIdsByPermission($perm = "access") + { + $perm_handler = xoops_getmodulehandler('permission', 'newbb'); + return $perm_handler->getForums($perm); + } + + function &getByPermission($cat = 0, $permission = "access", $tags = null, $asObject = true) + { + $_cachedForums = array(); + if ( !$valid_ids = $this->getIdsByPermission($permission) ) { + return $_cachedForums; + } + + $criteria = new CriteriaCompo( new Criteria("forum_id", "(" . implode(", ", $valid_ids) . ")", "IN") ); + if (is_numeric($cat) && $cat> 0) { + $criteria->add(new Criteria("cat_id", intval($cat))); + } elseif (is_array($cat) && count($cat) >0) { + $criteria->add(new Criteria("cat_id", "(" . implode(", ", $cat) . ")", "IN")); + } + $criteria->setSort("forum_order"); + $criteria->setOrder("ASC"); + $_cachedForums =& $this->getAll($criteria, $tags, $asObject); + return $_cachedForums; + } + + function &getForumsByCategory($categoryid = 0, $permission = "", $asObject = true, $tags = null) + { + $forums =& $this->getByPermission($categoryid, $permission, $tags); + if ($asObject) return $forums; + + $forums_array = array(); + $array_cat=array(); + $array_forum=array(); + if (!is_array($forums)) return array(); + foreach (array_keys($forums) as $forumid) { + $forum =& $forums[$forumid]; + $forums_array[$forum->getVar('parent_forum')][$forumid] = array( + 'cid' => $forum->getVar('cat_id'), + 'title' => $forum->getVar('forum_name') + ); + } + if (!isset($forums_array[0])) { + $ret = array(); + return $ret; + } + foreach ($forums_array[0] as $key => $forum) { + if (isset($forums_array[$key])) { + $forum['sub'] = $forums_array[$key]; + } + $array_forum[$forum['cid']][$key] = $forum; + } + ksort($array_forum); + unset($forums); + unset($forums_array); + return $array_forum; + } + + function getAllTopics(&$forum, $criteria = null) + { + global $xoopsModule, $xoopsConfig, $xoopsModuleConfig, $myts, $xoopsUser, $viewall_forums; + + require_once XOOPS_ROOT_PATH . "/modules/newbb/include/functions.render.php"; + require_once XOOPS_ROOT_PATH . "/modules/newbb/include/functions.session.php"; + require_once XOOPS_ROOT_PATH . "/modules/newbb/include/functions.time.php"; + require_once XOOPS_ROOT_PATH . "/modules/newbb/include/functions.read.php"; + require_once XOOPS_ROOT_PATH . "/modules/newbb/include/functions.topic.php"; + + $criteria_vars = array("startdate", "start", "sort", "order", "type", "status", "excerpt"); + foreach ($criteria_vars as $var) { + ${$var} = $criteria[$var]; + } + + $topic_lastread = newbb_getcookie('LT', true); + + if (is_object($forum)) { + $criteria_forum = ' AND t.forum_id = ' . $forum->getVar('forum_id'); + $hot_threshold = $forum->getVar('hot_threshold'); + } else { + $hot_threshold = 10; + if (is_array($forum) && count($forum) > 0) { + $criteria_forum = ' AND t.forum_id IN (' . implode(',', array_keys($forum)) . ')'; + } elseif (!empty($forum)) { + $criteria_forum = ' AND t.forum_id =' . intval($forum); + } else { + $criteria_forum = ''; + } + } + + $criteria_post = ($startdate) ? ' p.post_time > ' . $startdate : " 1 = 1 "; + $criteria_topic = empty($type) ? '' : " AND t.type_id={$type}"; + $criteria_extra = ''; + $criteria_approve = ' AND t.approved = 1'; + $post_on = ' p.post_id = t.topic_last_post_id'; + $leftjoin = ' LEFT JOIN ' . $this->db->prefix('bb_posts') . ' p ON p.post_id = t.topic_last_post_id'; + $sort_array = array(); + switch ($status) { + case 'digest': + $criteria_extra = ' AND t.topic_digest = 1'; + break; + + case 'unreplied': + $criteria_extra = ' AND t.topic_replies < 1'; + break; + + case 'unread': + if (empty($xoopsModuleConfig["read_mode"])) { + } elseif ($xoopsModuleConfig["read_mode"] ==2) { + $leftjoin .= ' LEFT JOIN ' . $this->db->prefix('bb_reads_topic') . ' r ON r.read_item = t.topic_id'; + $criteria_post .= ' AND (r.read_id IS NULL OR r.post_id < t.topic_last_post_id)'; + } elseif ($xoopsModuleConfig["read_mode"] == 1) { + $topics = array(); + $topic_lastread = newbb_getcookie('LT', true); + if (count($topic_lastread)>0) { + foreach ($topic_lastread as $id => $time) { + if ($time > $time_criterion) $topics[] = $id; + } + } + if (count($topics)>0) { + $criteria_extra = ' AND t.topic_id NOT IN (' . implode(",", $topics) . ')'; + } + if ($lastvisit = max($GLOBALS['last_visit'], $startdate)) { + $criteria_post = ' p.post_time > ' . max($GLOBALS['last_visit'], $startdate); + } + } + break; + + case 'pending': + $post_on = ' p.topic_id = t.topic_id'; + $criteria_post .= ' AND p.pid = 0'; + $criteria_approve = ' AND t.approved = 0'; + break; + + case 'deleted': + $criteria_approve = ' AND t.approved = -1'; + break; + + case 'all': // For viewall.php; do not display sticky topics at first + case 'active': // same as "all" + break; + + default: + if ($startdate > 0) { + $criteria_post = ' (p.post_time > ' . $startdate . ' OR t.topic_sticky=1)'; + } + $sort_array[] = 't.topic_sticky DESC'; + break; + } + + $select = 't.*, ' . + ' p.post_time as last_post_time, p.poster_name as last_poster_name, p.icon, p.post_id, p.uid'; + $from = $this->db->prefix("bb_topics") . ' t ' . $leftjoin; + $where = $criteria_post. $criteria_topic. $criteria_forum . $criteria_extra . $criteria_approve; + + if ($excerpt) { + $select .= ', p.post_karma, p.require_reply, pt.post_text'; + $from .= ' LEFT JOIN ' . $this->db->prefix('bb_posts_text') . ' pt ON pt.post_id = t.topic_last_post_id'; + } + if ($sort == "u.uname") { + $sort = "t.topic_poster"; + } + + $sort_array[] = trim($sort . ' ' . $order); + $sortby = implode(", ", array_filter($sort_array) ); + if (empty($sortby)) $sortby = 't.topic_last_post_id DESC'; + + + $sql = 'SELECT ' . $select . + ' FROM ' . $from . + ' WHERE ' . $where . + ' ORDER BY ' . $sortby; + + if (!$result = $this->db->query($sql, $xoopsModuleConfig['topics_per_page'], $start)) { + redirect_header('index.php', 2, _MD_ERROROCCURED); + exit(); + } + + $sticky = 0; + $topics = array(); + $posters = array(); + $reads = array(); + $types = array(); + + $type_handler =& xoops_getmodulehandler('type', 'newbb'); + $typen = $type_handler->getByForum($forum->getVar('forum_id')); + while ($myrow = $this->db->fetchArray($result)) { + + if ($myrow['topic_sticky']) { + $sticky++; + } + + // ------------------------------------------------------ + // topic_icon: priority: sticky -> digest -> regular + + if ($myrow['topic_haspoll']) { + if ($myrow['topic_sticky']) { + $topic_icon = newbb_displayImage('topic_sticky', _MD_TOPICSTICKY) . '<br />' . newbb_displayImage('poll', _MD_TOPICHASPOLL); + } else { + $topic_icon = newbb_displayImage('poll', _MD_TOPICHASPOLL); + } + } elseif ($myrow['topic_sticky']) { + $topic_icon = newbb_displayImage('topic_sticky', _MD_TOPICSTICKY); + } elseif (!empty($myrow['icon'])) { + $topic_icon = '<img src="' . XOOPS_URL . '/images/subject/' . htmlspecialchars($myrow['icon']) . '" alt="" />'; + } else { + $topic_icon = '<img src="' . XOOPS_URL . '/images/icons/no_posticon.gif" alt="" />'; + } + + // ------------------------------------------------------ + // rating_img + $rating = number_format($myrow['rating'] / 2, 0); + $rating_img = newbb_displayImage( ($rating < 1) ? 'blank' : 'rate' . $rating ); + + // ------------------------------------------------------ + // topic_page_jump + $topic_page_jump = ''; + $topic_page_jump_icon = ''; + $totalpages = ceil(($myrow['topic_replies'] + 1) / $xoopsModuleConfig['posts_per_page']); + if ($totalpages > 1) { + $topic_page_jump .= ' '; + $append = false; + for ($i = 1; $i <= $totalpages; $i++) { + if ($i > 3 && $i < $totalpages) { + if (!$append) { + $topic_page_jump .= "..."; + $append = true; + } + } else { + $topic_page_jump .= '[<a href="' . XOOPS_URL . '/modules/newbb/viewtopic.php?topic_id=' . $myrow['topic_id'] . '&start=' . (($i - 1) * $xoopsModuleConfig['posts_per_page']) . '">' . $i . '</a>]'; + $topic_page_jump_icon = "<a href='" . XOOPS_URL . "/modules/newbb/viewtopic.php?post_id=" . $myrow['post_id'] . "&start=" . (($i - 1) * $xoopsModuleConfig['posts_per_page']) . "'>" . newbb_displayImage('lastposticon',_MD_NEWBB_GOTOLASTPOST) . "</a>"; + } + } + } + else { + $topic_page_jump_icon = "<a href='" . XOOPS_URL . "/modules/newbb/viewtopic.php?post_id=" . $myrow['post_id'] . "'>" . newbb_displayImage('lastposticon',_MD_NEWBB_GOTOLASTPOST) . "</a>"; + } + + // ------------------------------------------------------ + // => topic array + if (!empty($viewall_forums[$myrow['forum_id']])) { + $forum_link = '<a href="' . XOOPS_URL . '/modules/newbb/viewforum.php?forum=' . $myrow['forum_id'] . '">' . $viewall_forums[$myrow['forum_id']]['forum_name'] . '</a>'; + } else { + $forum_link = ''; + } + + $topic_title = $myts->htmlSpecialChars( $myrow['topic_title'] ); + if ($myrow['type_id'] > 0) { + $topic_title = '<font color="'.$typen[$myrow["type_id"]]["type_color"].'">['.$typen[$myrow["type_id"]]["type_name"].']</font> '.$topic_title.''; + } + if ($myrow['topic_digest']) { + $topic_title = "<span class='digest'>" . $topic_title . "</span>"; + } + + if ( $excerpt == 0 ) { + $topic_excerpt = ""; + } elseif ( ($myrow['post_karma'] > 0 || $myrow['require_reply'] > 0) && !newbb_isAdmin($forum) ) { + $topic_excerpt = ""; + } else { + $topic_excerpt = xoops_substr(newbb_html2text($myts->displayTarea($myrow['post_text'])), 0, $excerpt); + $topic_excerpt = str_replace("[", "[", $myts->htmlSpecialChars($topic_excerpt)); + } + + /* users */ + $posters[$myrow['topic_poster']] = 1; + $posters[$myrow['uid']] = 1; + // reads + if (!empty($xoopsModuleConfig["read_mode"])) { + $reads[$myrow['topic_id']] = ($xoopsModuleConfig["read_mode"] == 1) ? $myrow['last_post_time'] : $myrow["topic_last_post_id"]; + } + + $topic_poster = newbb_getUnameFromId($myrow['topic_poster'], $xoopsModuleConfig['show_realname'], true); + $topic_last_poster = newbb_getUnameFromId($myrow['uid'], $xoopsModuleConfig['show_realname'], true); + $topic_isRead = newbb_isRead("topic", $reads); + + $topic_prefix = (!empty($typen[$myrow['type_id']])) ? getTopicTitle("", $typen[$myrow['type_id']]["type_name"], $typen[$myrow['type_id']]["type_color"]) : ""; + + // ------------------------------------------------------ + // topic_folder: priority: newhot -> hot/new -> regular + if ($myrow['topic_status'] == 1) { + $topic_folder = 'topic_locked'; + $topic_folder_text = _MD_TOPICLOCKED; + } else { + if ($myrow['topic_digest']) { + $topic_folder = 'topic_digest'; + $topic_folder_text = _MD_TOPICDIGEST; + } elseif ($myrow['topic_replies'] >= $hot_threshold) { + $topic_folder = empty($topic_isRead[$myrow['topic_id']]) ? 'topic_hot_new' : 'topic_hot'; + $topic_folder_text = empty($topic_isRead[$myrow['topic_id']]) ? _MD_MORETHAN : _MD_MORETHAN2; + } else { + $topic_folder = empty($topic_isRead[$myrow['topic_id']]) ? 'topic_new' : 'topic'; + $topic_folder_text = empty($topic_isRead[$myrow['topic_id']]) ? _MD_NEWPOSTS : _MD_NONEWPOSTS; + } + } + + + $topics[$myrow['topic_id']] = array( + 'topic_id' => $myrow['topic_id'], + 'topic_icon' => $topic_icon, + 'type_id' => $myrow['type_id'], + 'type_text' => $topic_prefix, + 'topic_title' ... [truncated message content] |
From: <ir...@us...> - 2012-08-15 07:36:43
|
Revision: 10073 http://xoops.svn.sourceforge.net/xoops/?rev=10073&view=rev Author: irmtfan Date: 2012-08-15 07:36:34 +0000 (Wed, 15 Aug 2012) Log Message: ----------- double slash in rpg url, language revise, tcpdf added, print hardcodes removed Modified Paths: -------------- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev9883.txt XoopsModules/newbb/branches/irmtfan/newbb/class/user.php XoopsModules/newbb/branches/irmtfan/newbb/docs/readme.txt XoopsModules/newbb/branches/irmtfan/newbb/language/english/admin.php XoopsModules/newbb/branches/irmtfan/newbb/language/english/main.php XoopsModules/newbb/branches/irmtfan/newbb/language/english/modinfo.php XoopsModules/newbb/branches/irmtfan/newbb/language/persian/admin.php XoopsModules/newbb/branches/irmtfan/newbb/language/persian/main.php XoopsModules/newbb/branches/irmtfan/newbb/language/persian/modinfo.php XoopsModules/newbb/branches/irmtfan/newbb/makepdf.php XoopsModules/newbb/branches/irmtfan/newbb/print.php Added Paths: ----------- XoopsModules/newbb/branches/irmtfan/newbb/docs/lang_diff.txt Modified: XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev9883.txt =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev9883.txt 2012-08-15 06:10:19 UTC (rev 10072) +++ XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev9883.txt 2012-08-15 07:36:34 UTC (rev 10073) @@ -1,58 +1,87 @@ -Changelog from rev.9883 -date: 2012-08-06 -================================================ -1- hardcode fix: using header php command instead of redirect_header XOOPS function (deka87/irmtfan) -in newbb/search.php -(Also hardcoded in latest core in xoops2.5.5/htdocs/search.php) - -2- hardcode fix: icon_path smarty variable was hardcoded in viewtopic and viewpost and is not defined in class/forum.php (irmtfan) -in newbb/viewtopic.php, newbb/viewpost.php, newbb/class/forum.php - -3- hardcode icons and some hardcodes has been solved in templates: -in newbb/templates/newbb_thread.html, newbb/templates/newbb_index.html, newbb/templates/newbb_viewforum_subforum.html - -4- add readme.txt -in docs/readme.txt - -date: 2012-08-04 -================================================ -1- bug fixed: error in newbb/polls.php when the strtotime is not defined in XoopsLocal class (irmtfan) -solution: replace XoopsLocal::strtotime($end_time) by method_exists('XoopsLocal', 'strtotime') ? XoopsLocal::strtotime($end_time) : strtotime($end_time) -in newbb/polls.php -2- more hardcodes in newbb/templates has been removed - -date: 2012-08-01 -================================================ -1- localization: input date localized (for other date systems like hegira) by replacing strtotime by XoopsLocal::strtotime -in newbb/polls.php - -2- customization&localization: newbb style.css is fully localized and customized and is not hard-coded anymore. -in newbb/header.php -file changes: --- deleted newbb/templates/style.css --- added newbb/templates/images/language/english/style.css --- added newbb/templates/images/language/persian/style.css -priorities: -if exist in themes/YOUR_THEME/modules/newbb/images/language/YOUR_LANG/style.css take it -else if exist in themes/default/modules/newbb/images/language/YOUR_LANG/style.css take it -else if exist in modules/newbb/templates/images/language/YOUR_LANG/style.css take it -else if exist in modules/newbb/templates/images/language/english/style.css take it -else if exist in modules/newbb/templates/style.css take it (for backward compatibility) - -3- many hardcodes in newbb/templates and style.css has been removed - -date: 2012-07-30 -================================================ -1- bug fix: edit not displayed when the reason is not filled (irmtfan) -2- bug fix: only the last edit is recorded. (irmtfan/alfred) -in newbb/class/post.php -3- bug fix: 'noapprove' permission incorrectly recorded in database. (irmtfan) -in newbb/class/permission.php -4- bug fix: load user ranks has been hardcoded. it works in old/upgraded websites but not works in new installed websites. a new getting rank introduced. (black_beard/irmtfan) -in newbb/class/user.php, newbb/templates/newbb_thread.html -5- minor bug fix: mysql 5.1 was incorrectly needed (irmtfan) -in newbb/xoops_version.php -6- hardcode: some style.css color hardcodes has been removed. (irmtfan) -in newbb/templates/style.css -7- feature added: text links instead of buttons. (deka87/irmtfan) +Changelog from rev.9883 + +date: 2012-08-15 +================================================ +1- minor fix: double slash fixed in rpg url +in newbb/class/user.php + +2- hardcode removed in rpg image alignment - align="left -> class="icon_left" +in newbb/class/user.php + +3- some english/persian language definitions has been revised. All extra spaces/newlines have been removed. +All changed to end method windows(CR+LF).See docs/lang_diff.txt for detail. +in newbb/language/english/*.php, newbb/language/persian/*.php + +4- add lang_diff.txt +in newbb/docs/lang_diff.txt + +5- expand readme.txt add guides to get a backup from old images before update, introduce Image customization and some FAQ +in newbb/docs/readme.txt + +6- makepdf.php from black_beard - add RTL - remove unneeded TCPDF config language requirements - add multi-lang EMLH by GIJ and Xlanguage by phppp DJ. +Add Forum Index - cat - forum - sub forum - topic names to the pdf header. +in newbb/makepdf.php + +7- add local stylesheet (xoops_header) in print.php +in newbb/print.php + +date: 2012-08-06 +================================================ +1- hardcode fix: using header php command instead of redirect_header XOOPS function (deka87/irmtfan) +in newbb/search.php +(Also hardcoded in latest core in xoops2.5.5/htdocs/search.php) + +2- hardcode fix: icon_path smarty variable was hardcoded in viewtopic and viewpost and is not defined in class/forum.php (irmtfan) +in newbb/viewtopic.php, newbb/viewpost.php, newbb/class/forum.php + +3- hardcode icons and some hardcodes has been solved in templates: +in newbb/templates/newbb_thread.html, newbb/templates/newbb_index.html, newbb/templates/newbb_viewforum_subforum.html + +4- add readme.txt for install and upgrade +in docs/readme.txt + +5- a poll class misses in english style.css +in newbb/templates/images/language/english/style.css + +date: 2012-08-04 +================================================ +1- bug fixed: error in newbb/polls.php when the strtotime is not defined in XoopsLocal class (irmtfan) +solution: replace XoopsLocal::strtotime($end_time) by method_exists('XoopsLocal', 'strtotime') ? XoopsLocal::strtotime($end_time) : strtotime($end_time) +in newbb/polls.php +2- more hardcodes in newbb/templates has been removed + +date: 2012-08-01 +================================================ +1- localization: input date localized (for other date systems like hegira) by replacing strtotime by XoopsLocal::strtotime +in newbb/polls.php + +2- customization&localization: newbb style.css is fully localized and customized and is not hard-coded anymore. +in newbb/header.php +file changes: +-- deleted newbb/templates/style.css +-- added newbb/templates/images/language/english/style.css +-- added newbb/templates/images/language/persian/style.css +priorities: +if exist in themes/YOUR_THEME/modules/newbb/images/language/YOUR_LANG/style.css take it +else if exist in themes/default/modules/newbb/images/language/YOUR_LANG/style.css take it +else if exist in modules/newbb/templates/images/language/YOUR_LANG/style.css take it +else if exist in modules/newbb/templates/images/language/english/style.css take it +else if exist in modules/newbb/templates/style.css take it (for backward compatibility) + +3- many hardcodes in newbb/templates and style.css has been removed + +date: 2012-07-30 +================================================ +1- bug fix: edit not displayed when the reason is not filled (irmtfan) +2- bug fix: only the last edit is recorded. (irmtfan/alfred) +in newbb/class/post.php +3- bug fix: 'noapprove' permission incorrectly recorded in database. (irmtfan) +in newbb/class/permission.php +4- bug fix: load user ranks has been hardcoded. it works in old/upgraded websites but not works in new installed websites. a new getting rank introduced. (black_beard/irmtfan) +in newbb/class/user.php, newbb/templates/newbb_thread.html +5- minor bug fix: mysql 5.1 was incorrectly needed (irmtfan) +in newbb/xoops_version.php +6- hardcode: some style.css color hardcodes has been removed. (irmtfan) +in newbb/templates/style.css +7- feature added: text links instead of buttons. (deka87/irmtfan) in newbb/class/icon.php , newbb/include/functions.render.php , newbb/include/plugin.php \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/class/user.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/class/user.php 2012-08-15 06:10:19 UTC (rev 10072) +++ XoopsModules/newbb/branches/irmtfan/newbb/class/user.php 2012-08-15 07:36:34 UTC (rev 10073) @@ -1,298 +1,300 @@ -<?php -/** - * CBB 4.0, or newbb, the forum module for XOOPS project - * - * @copyright The XOOPS Project http://xoops.sf.net - * @license http://www.fsf.org/copyleft/gpl.html GNU public license - * @author Taiwen Jiang (phppp or D.J.) <ph...@us...> - * @since 4.00 - * @version $Id $ - * @package module::newbb - */ - -if (!defined("XOOPS_ROOT_PATH")) { - exit(); -} - -defined("NEWBB_FUNCTIONS_INI") || include XOOPS_ROOT_PATH.'/modules/newbb/include/functions.ini.php'; - -function newbb_calculateLevel($RPG, $RPGDIFF) -{ - - //$RPG = $user->getVar('posts'); - //$RPGDIFF = $user->getVar('user_regdate'); - - $today = time(); - $diff = $today - $RPGDIFF; - $exp = round($diff / 86400,0); - if ($exp <= 0) { $exp = 1; } - $ppd= round($RPG / $exp, 0); - $level = pow (log10 ($RPG), 3); - $ep = floor (100 * ($level - floor ($level))); - $showlevel = floor ($level + 1); - $hpmulti =round ($ppd / 6, 1); - if ($hpmulti > 1.5) { $hpmulti = 1.5; } - if ($hpmulti < 1) { $hpmulti = 1; } - $maxhp = $level * 25 * $hpmulti; - $hp= $ppd / 5; - if ($hp >= 1) { - $hp= $maxhp; - } else { - $hp= floor ($hp * $maxhp); - } - $hp= floor ($hp); - $maxhp= floor ($maxhp); - if ($maxhp <= 0) { - $zhp = 1; - } else { - $zhp = $maxhp; - } - $hpf= floor (100 * ($hp / $zhp)) - 1; - $maxmp= ($exp * $level) / 5; - $mp= $RPG / 3; - if ($mp >= $maxmp) { $mp = $maxmp; } - $maxmp = floor ($maxmp); - $mp = floor ($mp); - if ($maxmp <= 0) { - $zmp = 1; - } else { - $zmp = $maxmp; - } - $mpf= floor (100 * ($mp / $zmp)) - 1; - if ( $hpf >= 98 ) { $hpf = $hpf - 2; } - if ( $ep >= 98 ) { $ep = $ep - 2; } - if ( $mpf >= 98 ) { $mpf = $mpf - 2; } - - $level = array(); - $level['level'] = $showlevel ; - $level['exp'] = $ep; - $level['exp_width'] = $ep.'%'; - $level['hp'] = $hp; - $level['hp_max'] = $maxhp; - $level['hp_width'] = $hpf.'%'; - $level['mp'] = $mp; - $level['mp_max'] = $maxmp; - $level['mp_width'] = $mpf.'%'; - - return $level; -} - -class newbbUser { - var $user = null; - - function User() - { - } - - function getUserbar() - { - global $xoopsModuleConfig, $xoopsUser, $isadmin; - - $userbar = array(); - if (empty($xoopsModuleConfig['userbar_enabled'])) return $userbar; - - $user = $this->user; - $userbar["profile"] = array("link" => XOOPS_URL . "/userinfo.php?uid=" . $user->getVar("uid"), "name" => _PROFILE); - - if (is_object($xoopsUser)) { - $userbar["pm"] = array("link" => "javascript:void openWithSelfMain('" . XOOPS_URL . "/pmlite.php?send2=1&to_userid=" . $user->getVar("uid") . "', 'pmlite', 450, 380);", "name" => _MD_PM); - } - if ($user->getVar('user_viewemail') || $isadmin) { - $userbar["email"] = array("link" => "javascript:void window.open('mailto:" . $user->getVar('email') . "', 'new');", "name" => _MD_EMAIL); - } - if ($url = $user->getVar('url')) { - $userbar["url"] = array("link" => "javascript:void window.open('" . $url . "', 'new');", "name" => _MD_WWW); - } - if ($icq = $user->getVar('user_icq')) { - $userbar["icq"] = array("link" => "javascript:void window.open('http://wwp.icq.com/scripts/search.dll?to=" . $icq."', 'new');", "name" => _MD_ICQ); - } - if ($aim = $user->getVar('user_aim')) { - $userbar["aim"]= array("link" => "javascript:void window.open('aim:goim?screenname=" . $aim . "&message=Hi+" . $aim . "+Are+you+there?" . "', 'new');", "name" => _MD_AIM); - } - if ($yim = $user->getVar('user_yim')) { - $userbar["yim"] = array("link" => "javascript:void window.open('http://edit.yahoo.com/config/send_webmesg?.target=" . $yim . "&.src=pg" . "', 'new');", "name" => _MD_YIM); - } - if ($msn = $user->getVar('user_msnm')) { - $userbar["msnm"] = array("link" => "javascript:void window.open('http://members.msn.com?mem=" . $msn . "', 'new');", "name" => _MD_MSNM); - } - - return $userbar; - } - - function getLevel() - { - global $xoopsModuleConfig, $forumUrl; - - $level = newbb_calculateLevel($this->user->getVar("posts"), $this->user->getVar("user_regdate")); - $info=''; - if ($xoopsModuleConfig['user_level'] == 2) { - static $rpg_images; - if (!isset($rpg_images)) { - $icon_handler = newbb_getIconHandler(); - $rpg_path = $icon_handler->getPath("rpg"); - foreach (array("img_left", "img_backing", "img_right", "blue", "green", "orange") as $img) { - $rpg_images[$img] = XOOPS_URL . '/' . $rpg_path . '/'.$img.'.gif'; - } - } - $table = "<table class='userlevel'><tr><td class='end'><img src='" . $rpg_images['img_left'] . "' alt='' /></td><td class='center' background='" . $rpg_images['img_backing'] . "'><img src='%s' width='%d' alt='' align='left' /></td><td><img src='" . $rpg_images['img_right'] . "' alt='' /></td></tr></table>"; - - $info = _MD_LEVEL . " " . $level['level'] . "<br />" . _MD_HP . " " . $level['hp'] . " / " . $level['hp_max'] . "<br />". - sprintf($table, $rpg_images["orange"], $level['hp_width']); - $info .= _MD_MP . " " . $level['mp'] . " / " . $level['mp_max'] . "<br />". - sprintf($table, $rpg_images["green"], $level['mp_width']); - $info .= _MD_EXP . " " . $level['exp'] . "<br />". - sprintf($table, $rpg_images["blue"], $level['exp_width']); - } else { - $info = _MD_LEVEL . " " . $level['level'] . "; ". _MD_EXP . " " . $level['exp'] . "<br />"; - $info .= _MD_HP . " " . $level['hp'] . " / " . $level['hp_max'] . "<br />"; - $info .= _MD_MP . " " . $level['mp'] . " / " . $level['mp_max']; - } - return $info; - } - - function getInfo(&$user) - { - global $xoopsModuleConfig, $myts; - static $name_anonymous; - - if ( !(is_object($user)) || !($user->isActive()) ) { - if (!isset($name_anonymous)) { - $name_anonymous = $myts->HtmlSpecialChars($GLOBALS["xoopsConfig"]['anonymous']); - } - return array("name" => $name_anonymous, "link" => $name_anonymous); - } - - $this->user = $user; - - $userinfo["uid"] = $user->getVar("uid"); - - $name = empty($xoopsModuleConfig['show_realname']) ? $user->getVar('uname') : $user->getVar('name'); - $userinfo["name"] = $name ? $name : $user->getVar('uname'); - - $userinfo["link"] = "<a href=\"".XOOPS_URL . "/userinfo.php?uid=" . $user->getVar("uid") ."\">".$userinfo["name"]."</a>"; - - $userinfo["avatar"] = $user->getVar('user_avatar'); -// START hacked by irmtfan - easier rank getting - $userrank = $user->rank(); - if (isset($userrank['image']) && $userrank['image']) { - $userinfo["rank_image"] = $userrank['image']; - $userinfo["rank_title"] = $userrank['title']; - } -// END hacked by irmtfan - easier rank getting - - $userinfo["from"] = $user->getVar('user_from'); - - mod_loadFunctions("time", "newbb"); - $userinfo["regdate"] = newbb_formatTimestamp($user->getVar('user_regdate'), 'reg'); - - $userinfo["posts"] = $user->getVar('posts'); - - if (!empty($xoopsModuleConfig['user_level'])) { - $userinfo["level"] = $this->getLevel(); - } - - if (!empty($xoopsModuleConfig['userbar_enabled'])) { - $userinfo["userbar"] = $this->getUserbar(); - } - - $userinfo["signature"] = $user->getVar('user_sig'); - return $userinfo; - } -} - -class NewbbUserHandler -{ - var $enableGroup; - var $enableOnline; - var $userlist = array(); - var $users = array(); - //var $online = array(); - - function NewbbUserHandler($enableGroup = true, $enableOnline = true) - { - $this->enableGroup = $enableGroup; - $this->enableOnline = $enableOnline; - } - - function loadUserInfo() - { - @include_once XOOPS_ROOT_PATH."/modules/".$GLOBALS["xoopsModule"]->getVar("dirname", "n")."/language/".$GLOBALS["xoopsConfig"]["language"]."/user.php"; - if (class_exists("User_language")) { - $handler = new User_language(); - } else { - $handler = new newbbUser(); - } - foreach (array_keys($this->users) as $uid) { - $this->userlist[$uid] = $handler->getInfo($this->users[$uid]); - } - } - - function loadUserOnline() - { - if (empty($this->users) || !$this->enableOnline) return; - mod_loadFunctions("render", "newbb"); - $image_online = newbb_displayImage('online', _MD_ONLINE); - $image_offline = newbb_displayImage('offline',_MD_OFFLINE); - - $online_handler =& xoops_getmodulehandler('online', 'newbb'); - $onlines = $online_handler->checkStatus(array_keys($this->users)); - - foreach (array_keys($this->users) as $uid) { - $this->userlist[$uid]["status"] = empty($onlines[$uid]) ? $image_offline : $image_online; - } - } - - function loadUserGroups() - { - GLOBAL $xoopsDB; - - if (empty($this->users) || !$this->enableGroup) return; - - $groups = array(); - $member_handler =& xoops_gethandler('member'); - $groups_obj = $member_handler->getGroups(); - $count = count($groups_obj); - for ($i = 0; $i < $count; $i++) { - $groups[$groups_obj[$i]->getVar('groupid')] = $groups_obj[$i]->getVar('name'); - } - unset($groups_obj); - - $sql = 'SELECT groupid, uid FROM ' . $xoopsDB->prefix('groups_users_link') . " WHERE uid IN( " . implode(", ", array_keys($this->users)) . ")"; - $result = $xoopsDB->query($sql); - while ($myrow = $xoopsDB->fetchArray($result)) { - $this->userlist[$myrow['uid']]["groups"][] = $groups[$myrow['groupid']]; - } - } - - function loadUserDigest() - { - GLOBAL $xoopsDB; - - if (empty($this->users)) return; - - $sql = 'SELECT user_digests, uid FROM ' . $xoopsDB->prefix('bb_user_stats') . " WHERE uid IN( " . implode(", ", array_keys($this->users)) . ")"; - $result = $xoopsDB->query($sql); - while ($myrow = $xoopsDB->fetchArray($result)) { - $this->userlist[$myrow['uid']]["digests"] = intval( $myrow['user_digests'] ); - } - } -// START irmtfan remove function -// function loadUserRank() -// { -// return true; -// } -// END irmtfan remove function - - function getUsers() - { - $this->loadUserInfo(); - $this->loadUserOnline(); - $this->loadUserGroups(); - // irmtfan removed $this->loadUserRank(); - $this->loadUserDigest(); - - return $this->userlist; - } -} - +<?php +/** + * CBB 4.0, or newbb, the forum module for XOOPS project + * + * @copyright The XOOPS Project http://xoops.sf.net + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @author Taiwen Jiang (phppp or D.J.) <ph...@us...> + * @since 4.00 + * @version $Id $ + * @package module::newbb + */ + +if (!defined("XOOPS_ROOT_PATH")) { + exit(); +} + +defined("NEWBB_FUNCTIONS_INI") || include XOOPS_ROOT_PATH.'/modules/newbb/include/functions.ini.php'; + +function newbb_calculateLevel($RPG, $RPGDIFF) +{ + + //$RPG = $user->getVar('posts'); + //$RPGDIFF = $user->getVar('user_regdate'); + + $today = time(); + $diff = $today - $RPGDIFF; + $exp = round($diff / 86400,0); + if ($exp <= 0) { $exp = 1; } + $ppd= round($RPG / $exp, 0); + $level = pow (log10 ($RPG), 3); + $ep = floor (100 * ($level - floor ($level))); + $showlevel = floor ($level + 1); + $hpmulti =round ($ppd / 6, 1); + if ($hpmulti > 1.5) { $hpmulti = 1.5; } + if ($hpmulti < 1) { $hpmulti = 1; } + $maxhp = $level * 25 * $hpmulti; + $hp= $ppd / 5; + if ($hp >= 1) { + $hp= $maxhp; + } else { + $hp= floor ($hp * $maxhp); + } + $hp= floor ($hp); + $maxhp= floor ($maxhp); + if ($maxhp <= 0) { + $zhp = 1; + } else { + $zhp = $maxhp; + } + $hpf= floor (100 * ($hp / $zhp)) - 1; + $maxmp= ($exp * $level) / 5; + $mp= $RPG / 3; + if ($mp >= $maxmp) { $mp = $maxmp; } + $maxmp = floor ($maxmp); + $mp = floor ($mp); + if ($maxmp <= 0) { + $zmp = 1; + } else { + $zmp = $maxmp; + } + $mpf= floor (100 * ($mp / $zmp)) - 1; + if ( $hpf >= 98 ) { $hpf = $hpf - 2; } + if ( $ep >= 98 ) { $ep = $ep - 2; } + if ( $mpf >= 98 ) { $mpf = $mpf - 2; } + + $level = array(); + $level['level'] = $showlevel ; + $level['exp'] = $ep; + $level['exp_width'] = $ep.'%'; + $level['hp'] = $hp; + $level['hp_max'] = $maxhp; + $level['hp_width'] = $hpf.'%'; + $level['mp'] = $mp; + $level['mp_max'] = $maxmp; + $level['mp_width'] = $mpf.'%'; + + return $level; +} + +class newbbUser { + var $user = null; + + function User() + { + } + + function getUserbar() + { + global $xoopsModuleConfig, $xoopsUser, $isadmin; + + $userbar = array(); + if (empty($xoopsModuleConfig['userbar_enabled'])) return $userbar; + + $user = $this->user; + $userbar["profile"] = array("link" => XOOPS_URL . "/userinfo.php?uid=" . $user->getVar("uid"), "name" => _PROFILE); + + if (is_object($xoopsUser)) { + $userbar["pm"] = array("link" => "javascript:void openWithSelfMain('" . XOOPS_URL . "/pmlite.php?send2=1&to_userid=" . $user->getVar("uid") . "', 'pmlite', 450, 380);", "name" => _MD_PM); + } + if ($user->getVar('user_viewemail') || $isadmin) { + $userbar["email"] = array("link" => "javascript:void window.open('mailto:" . $user->getVar('email') . "', 'new');", "name" => _MD_EMAIL); + } + if ($url = $user->getVar('url')) { + $userbar["url"] = array("link" => "javascript:void window.open('" . $url . "', 'new');", "name" => _MD_WWW); + } + if ($icq = $user->getVar('user_icq')) { + $userbar["icq"] = array("link" => "javascript:void window.open('http://wwp.icq.com/scripts/search.dll?to=" . $icq."', 'new');", "name" => _MD_ICQ); + } + if ($aim = $user->getVar('user_aim')) { + $userbar["aim"]= array("link" => "javascript:void window.open('aim:goim?screenname=" . $aim . "&message=Hi+" . $aim . "+Are+you+there?" . "', 'new');", "name" => _MD_AIM); + } + if ($yim = $user->getVar('user_yim')) { + $userbar["yim"] = array("link" => "javascript:void window.open('http://edit.yahoo.com/config/send_webmesg?.target=" . $yim . "&.src=pg" . "', 'new');", "name" => _MD_YIM); + } + if ($msn = $user->getVar('user_msnm')) { + $userbar["msnm"] = array("link" => "javascript:void window.open('http://members.msn.com?mem=" . $msn . "', 'new');", "name" => _MD_MSNM); + } + + return $userbar; + } + + function getLevel() + { + global $xoopsModuleConfig, $forumUrl; + + $level = newbb_calculateLevel($this->user->getVar("posts"), $this->user->getVar("user_regdate")); + $info=''; + if ($xoopsModuleConfig['user_level'] == 2) { + static $rpg_images; + if (!isset($rpg_images)) { + $icon_handler = newbb_getIconHandler(); + $rpg_path = $icon_handler->getPath("rpg"); + foreach (array("img_left", "img_backing", "img_right", "blue", "green", "orange") as $img) { +// irmtfan fix: double "/" removed + $rpg_images[$img] = XOOPS_URL . $rpg_path . '/'.$img.'.gif'; + } + } +// irmtfan hardcore removed align="left" + $table = "<table class='userlevel'><tr><td class='end'><img src='" . $rpg_images['img_left'] . "' alt='' /></td><td class='center' background='" . $rpg_images['img_backing'] . "'><img src='%s' width='%d' alt='' class='icon_left' /></td><td><img src='" . $rpg_images['img_right'] . "' alt='' /></td></tr></table>"; + + $info = _MD_LEVEL . " " . $level['level'] . "<br />" . _MD_HP . " " . $level['hp'] . " / " . $level['hp_max'] . "<br />". + sprintf($table, $rpg_images["orange"], $level['hp_width']); + $info .= _MD_MP . " " . $level['mp'] . " / " . $level['mp_max'] . "<br />". + sprintf($table, $rpg_images["green"], $level['mp_width']); + $info .= _MD_EXP . " " . $level['exp'] . "<br />". + sprintf($table, $rpg_images["blue"], $level['exp_width']); + } else { + $info = _MD_LEVEL . " " . $level['level'] . "; ". _MD_EXP . " " . $level['exp'] . "<br />"; + $info .= _MD_HP . " " . $level['hp'] . " / " . $level['hp_max'] . "<br />"; + $info .= _MD_MP . " " . $level['mp'] . " / " . $level['mp_max']; + } + return $info; + } + + function getInfo(&$user) + { + global $xoopsModuleConfig, $myts; + static $name_anonymous; + + if ( !(is_object($user)) || !($user->isActive()) ) { + if (!isset($name_anonymous)) { + $name_anonymous = $myts->HtmlSpecialChars($GLOBALS["xoopsConfig"]['anonymous']); + } + return array("name" => $name_anonymous, "link" => $name_anonymous); + } + + $this->user = $user; + + $userinfo["uid"] = $user->getVar("uid"); + + $name = empty($xoopsModuleConfig['show_realname']) ? $user->getVar('uname') : $user->getVar('name'); + $userinfo["name"] = $name ? $name : $user->getVar('uname'); + + $userinfo["link"] = "<a href=\"".XOOPS_URL . "/userinfo.php?uid=" . $user->getVar("uid") ."\">".$userinfo["name"]."</a>"; + + $userinfo["avatar"] = $user->getVar('user_avatar'); +// START hacked by irmtfan - easier rank getting + $userrank = $user->rank(); + if (isset($userrank['image']) && $userrank['image']) { + $userinfo["rank_image"] = $userrank['image']; + $userinfo["rank_title"] = $userrank['title']; + } +// END hacked by irmtfan - easier rank getting + + $userinfo["from"] = $user->getVar('user_from'); + + mod_loadFunctions("time", "newbb"); + $userinfo["regdate"] = newbb_formatTimestamp($user->getVar('user_regdate'), 'reg'); + + $userinfo["posts"] = $user->getVar('posts'); + + if (!empty($xoopsModuleConfig['user_level'])) { + $userinfo["level"] = $this->getLevel(); + } + + if (!empty($xoopsModuleConfig['userbar_enabled'])) { + $userinfo["userbar"] = $this->getUserbar(); + } + + $userinfo["signature"] = $user->getVar('user_sig'); + return $userinfo; + } +} + +class NewbbUserHandler +{ + var $enableGroup; + var $enableOnline; + var $userlist = array(); + var $users = array(); + //var $online = array(); + + function NewbbUserHandler($enableGroup = true, $enableOnline = true) + { + $this->enableGroup = $enableGroup; + $this->enableOnline = $enableOnline; + } + + function loadUserInfo() + { + @include_once XOOPS_ROOT_PATH."/modules/".$GLOBALS["xoopsModule"]->getVar("dirname", "n")."/language/".$GLOBALS["xoopsConfig"]["language"]."/user.php"; + if (class_exists("User_language")) { + $handler = new User_language(); + } else { + $handler = new newbbUser(); + } + foreach (array_keys($this->users) as $uid) { + $this->userlist[$uid] = $handler->getInfo($this->users[$uid]); + } + } + + function loadUserOnline() + { + if (empty($this->users) || !$this->enableOnline) return; + mod_loadFunctions("render", "newbb"); + $image_online = newbb_displayImage('online', _MD_ONLINE); + $image_offline = newbb_displayImage('offline',_MD_OFFLINE); + + $online_handler =& xoops_getmodulehandler('online', 'newbb'); + $onlines = $online_handler->checkStatus(array_keys($this->users)); + + foreach (array_keys($this->users) as $uid) { + $this->userlist[$uid]["status"] = empty($onlines[$uid]) ? $image_offline : $image_online; + } + } + + function loadUserGroups() + { + GLOBAL $xoopsDB; + + if (empty($this->users) || !$this->enableGroup) return; + + $groups = array(); + $member_handler =& xoops_gethandler('member'); + $groups_obj = $member_handler->getGroups(); + $count = count($groups_obj); + for ($i = 0; $i < $count; $i++) { + $groups[$groups_obj[$i]->getVar('groupid')] = $groups_obj[$i]->getVar('name'); + } + unset($groups_obj); + + $sql = 'SELECT groupid, uid FROM ' . $xoopsDB->prefix('groups_users_link') . " WHERE uid IN( " . implode(", ", array_keys($this->users)) . ")"; + $result = $xoopsDB->query($sql); + while ($myrow = $xoopsDB->fetchArray($result)) { + $this->userlist[$myrow['uid']]["groups"][] = $groups[$myrow['groupid']]; + } + } + + function loadUserDigest() + { + GLOBAL $xoopsDB; + + if (empty($this->users)) return; + + $sql = 'SELECT user_digests, uid FROM ' . $xoopsDB->prefix('bb_user_stats') . " WHERE uid IN( " . implode(", ", array_keys($this->users)) . ")"; + $result = $xoopsDB->query($sql); + while ($myrow = $xoopsDB->fetchArray($result)) { + $this->userlist[$myrow['uid']]["digests"] = intval( $myrow['user_digests'] ); + } + } +// START irmtfan remove function +// function loadUserRank() +// { +// return true; +// } +// END irmtfan remove function + + function getUsers() + { + $this->loadUserInfo(); + $this->loadUserOnline(); + $this->loadUserGroups(); + // irmtfan removed $this->loadUserRank(); + $this->loadUserDigest(); + + return $this->userlist; + } +} + ?> \ No newline at end of file Added: XoopsModules/newbb/branches/irmtfan/newbb/docs/lang_diff.txt =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/docs/lang_diff.txt (rev 0) +++ XoopsModules/newbb/branches/irmtfan/newbb/docs/lang_diff.txt 2012-08-15 07:36:34 UTC (rev 10073) @@ -0,0 +1,28 @@ +LANGUAGE DIFFERENCES +===================== + +Below are language differences from a version to next version. + +Version 4.3 rev.9992 +---------------- +admin.php +---------- +remove: +define("_AM_NEWBB_ALLOWSIGNATURES","Allow Signatures:"); + +revise: +define("_AM_NEWBB_CAN_SIGNATURE","Can use and disable/enable signature. Default is set in profile module."); +define("_AM_NEWBB_CAN_HTML","Can use and disable/enable HTML"); +define('_AM_NEWBB_AUTHOR_WORD_EXTRA',"Extra words by module Author"); + +modinfo.php +---------- +revise: +define("_MI_USERMODERATE_DESC","Forum moderator can suspend a specific user for a specific time period in the forum"); +define("_MI_SUBFORUM_DISPLAY_DESC","Choose one of the methods to display subforums"); +define("_MI_STATISTIK_ENABLE_DESC","The stats will be shown in your forum at the bottom of each forum/topic"); + +main.php +--------- +revise: +define("_MD_EDITEDMSG","Reason:"); Modified: XoopsModules/newbb/branches/irmtfan/newbb/docs/readme.txt =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/docs/readme.txt 2012-08-15 06:10:19 UTC (rev 10072) +++ XoopsModules/newbb/branches/irmtfan/newbb/docs/readme.txt 2012-08-15 07:36:34 UTC (rev 10073) @@ -1,10 +1,13 @@ -newbb 4.3 install and upgrade guide -requirements: XOOPS 2.5.x php 5.2 mysql 5.0 +Newbb 4.3 guide +Requirements: +========================= +XOOPS 2.5.x php 5.2 mysql 5.0 + To Install ========================= 1- close your website. (recommended) be sure you be logged in. -2- upload the newbb to /modules/newbb ( upload the compressed file and decompressed via Cpanel is the best way to insure all files are correctly uploaded) +2- upload the newbb to /modules/newbb (upload the compressed file and decompressed via Cpanel is the best way to insure all files are correctly uploaded) 3- go to your admin -> system -> modules -> install 4- change the default settings to your desired in the module preferences and newbb/include/plugin.php 5- dont forget to open your website again. @@ -13,11 +16,58 @@ ========================== 1- close your website. (highly recommended) be sure you be logged in. 2- get a backup from your old newbb database.(all XOOPSPREFIX_bb_* tables) -3- IF EXIST get a backup from your old newbb/include/plugin.php -4- delete your old newbb folder located in modules (or rename it to newbb_old) -5- IF EXIST delete old newbb folder (templates) in htdocs/themes/default/modules/newbb AND htdocs/themes/YOUR_THEME/modules/newbb (or rename it to newbb_old) -6- upload the newbb to htdocs/modules/newbb ( upload the compressed file and decompressed via Cpanel is the best way to insure all files are correctly upload) -7- go to your admin -> system -> modules -> newbb -> upgrade (wait until you see the report page) -8- go to system -> maintenance -> clear all caches -9- change the default settings to your desired in the module preferences and newbb/include/plugin.php and IF EXIST based on your old back-upped plugin.php -10 - dont forget to open your website again. \ No newline at end of file +3- get a backup from your old newbb/images directory to save your custom old images. Also get a backup from any changes you done in files. +4- IF EXIST get a backup from your old newbb/include/plugin.php +5- delete your old newbb folder located in modules (or rename it to newbb_old) +6- IF EXIST delete old newbb folder (templates) in htdocs/themes/default/modules/newbb AND htdocs/themes/YOUR_THEME/modules/newbb (or rename it to newbb_old) +7- upload the newbb to htdocs/modules/newbb (upload the compressed file and decompressed via Cpanel is the best way to insure all files are correctly uploaded) +8- go to your admin -> system -> modules -> newbb -> upgrade (important: wait until you see the report page) +9- go to system -> maintenance -> clear all caches +10- change the default settings to your desired in the module preferences and newbb/include/plugin.php and IF EXIST based on your old back-upped plugin.php. Set the permissions in newbb -> admin -> permission for all groups one by one. pay attention that webmasters group has all accesses regardless of permissions. using a non webmaster test account is recommended to test the permissions for each group. +11 - dont forget to open your website again. + +Image set Full customization +========================== +In newbb 4.3 you can customize all images (like reply, edit, ... buttons and icons) for all themes or each theme one by one without touching the modules/newbb files. +The priority for reading images are as below: + * IF EXISTS XOOPS_ROOT/themes/YOUR_THEME/modules/newbb/images/, TAKE IT; + * ELSEIF EXISTS XOOPS_ROOT/themes/default/modules/newbb/images/, TAKE IT; + * ELSE TAKE XOOPS_ROOT/modules/newbb/templates/images/ +The above means, if you want to customize images for all of your themes you should not touch the modules/newbb/templates/images/ folder. +Just upload the image set in XOOPS_ROOT/themes/default/modules/newbb/images and all of your themes will read it from default theme. +Then if you want to customize it for another specific theme you can upload the new image set in XOOPS_ROOT/themes/YOUR_THEME/modules/newbb/images +And you can follow the above for the other themes. + +FAQ: +========================== +1- How do I set options like HTML and signature behind reply editor box? + +for signature: +- In newbb the webmaster can set the permission so that different groups had the ability to use and disable/enable their signatures in different forums behind their posts. In other words, if the user set the attachsig option to No in its profile, the signature is disabled (unchecked) by default and can be enabled in specific posts, otherwise it is enabled (checked) and can be disabled. +- the default is defined in Profile module by webmaster for new registered users. in profile -> admin -> fields -> attachsig -> default -> Yes/No(default) +- registered users can change the above default in their profiles (if they have permission): in edit profile -> Always attach my signature -> Yes/No + + +for html: +- you can set the permission to allow different groups to use html in different forums. +- the default for allowed groups in allowed forums is hardcoded to enable (check box has always a tick) and user can disable it in each post. + +for smilies, xoopscode and br: +- the default is hardcoded to enable (check box has always a tick) and user can disable it in each post. + +2- attachments are only showed to registered users. where can i change it to show for guests? +in newbb -> admin -> preferences -> Display attachments only for registered users -> yes(default)/no + +3- where can I change the image buttons to text links? +Open newbb/include/plugin.php +change this line: +$customConfig["display_text_links"] = false; +to this: +$customConfig["display_text_links"] = true; + +4- where can I change the reply and quick reply default editors to tinymce? +In newbb/include/plugin.php + +5- Why i have not a JQuery redirect in some submits in newbb module like reply and new topic? +Please find and remove any newline/space before <?php or after ?> in your whole xoops php files. +Also find and remove any BOM in language utf-8 files in your whole xoops. \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/language/english/admin.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/language/english/admin.php 2012-08-15 06:10:19 UTC (rev 10072) +++ XoopsModules/newbb/branches/irmtfan/newbb/language/english/admin.php 2012-08-15 07:36:34 UTC (rev 10073) @@ -97,7 +97,7 @@ define("_AM_NEWBB_ALLOWHTML","Allow HTML:"); define("_AM_NEWBB_YES","Yes"); define("_AM_NEWBB_NO","No"); -define("_AM_NEWBB_ALLOWSIGNATURES","Allow Signatures:"); +// irmtfan remove define("_AM_NEWBB_ALLOWSIGNATURES","Allow Signatures:"); define("_AM_NEWBB_HOTTOPICTHRESHOLD","Hot Topic Threshold:"); //define("_AM_NEWBB_POSTPERPAGE","Posts per Page:<span style='font-size: xx-small; font-weight: normal; display: block;'>(This is the number of posts<br /> per topic that will be<br /> displayed per page.)</span>"); //define("_AM_NEWBB_TOPICPERFORUM","Topics per Forum:<span style='font-size: xx-small; font-weight: normal; display: block;'>(This is the number of topics<br /> per forum that will be<br /> displayed per page.)</span>"); @@ -173,8 +173,8 @@ define("_AM_NEWBB_CAN_ATTACH","Can use attachment"); define("_AM_NEWBB_CAN_NOAPPROVE","Can post directly"); define("_AM_NEWBB_CAN_TYPE","Can use topic type"); -define("_AM_NEWBB_CAN_HTML","Can use HTML syntax"); -define("_AM_NEWBB_CAN_SIGNATURE","Can use signature"); +define("_AM_NEWBB_CAN_HTML","Can use and disable/enable HTML in posts");//irmtfan revised +define("_AM_NEWBB_CAN_SIGNATURE","Can disable/enable signature in posts.Default is set in profile module.");//irmtfan revised define("_AM_NEWBB_ACTION","Action"); define("_AM_NEWBB_PERM_TEMPLATE","Set default permission template"); define("_AM_NEWBB_PERM_TEMPLATE_DESC","Edit the following permission template so that it can be applied to a forum or a couple of forums"); @@ -187,30 +187,30 @@ define("_AM_NEWBB_PERM_SETBYGROUP","Set permissions directly by group"); // admin_forum_prune.php -define("_AM_NEWBB_PRUNE_RESULTS_TITLE","Prune Results"); -define("_AM_NEWBB_PRUNE_RESULTS_TOPICS","Pruned Topics"); -define("_AM_NEWBB_PRUNE_RESULTS_POSTS","Pruned Posts"); -define("_AM_NEWBB_PRUNE_RESULTS_FORUMS","Pruned Forums"); -define("_AM_NEWBB_PRUNE_STORE","Store posts in this forum instead of deleting them"); -define("_AM_NEWBB_PRUNE_ARCHIVE","Save a copy of posts to Archive"); -define("_AM_NEWBB_PRUNE_FORUMSELERROR","You forgot to select forum(s) to prune"); -define("_AM_NEWBB_PRUNE_DAYS","Remove topics without replies in:"); -define("_AM_NEWBB_PRUNE_FORUMS","Forums to be pruned"); -define("_AM_NEWBB_PRUNE_STICKY","Keep Sticky topics"); -define("_AM_NEWBB_PRUNE_DIGEST","Keep Digest topics"); -define("_AM_NEWBB_PRUNE_LOCK","Keep Locked topics"); -define("_AM_NEWBB_PRUNE_HOT","Keep topics with more than this number of replies"); -define("_AM_NEWBB_PRUNE_SUBMIT","Ok"); -define("_AM_NEWBB_PRUNE_RESET","Reset"); -define("_AM_NEWBB_PRUNE_YES","Yes"); -define("_AM_NEWBB_PRUNE_NO","No"); -define("_AM_NEWBB_PRUNE_WEEK","A Week"); -define("_AM_NEWBB_PRUNE_2WEEKS","Two Weeks"); -define("_AM_NEWBB_PRUNE_MONTH","A Month"); -define("_AM_NEWBB_PRUNE_2MONTH","Two Months"); -define("_AM_NEWBB_PRUNE_4MONTH","Four Months"); -define("_AM_NEWBB_PRUNE_YEAR","A Year"); -define("_AM_NEWBB_PRUNE_2YEARS","2 Years"); +define ("_AM_NEWBB_PRUNE_RESULTS_TITLE","Prune Results"); +define ("_AM_NEWBB_PRUNE_RESULTS_TOPICS","Pruned Topics"); +define ("_AM_NEWBB_PRUNE_RESULTS_POSTS","Pruned Posts"); +define ("_AM_NEWBB_PRUNE_RESULTS_FORUMS","Pruned Forums"); +define ("_AM_NEWBB_PRUNE_STORE","Store posts in this forum instead of deleting them"); +define ("_AM_NEWBB_PRUNE_ARCHIVE","Save a copy of posts to Archive"); +define ("_AM_NEWBB_PRUNE_FORUMSELERROR","You forgot to select forum(s) to prune"); +define ("_AM_NEWBB_PRUNE_DAYS","Remove topics without replies in:"); +define ("_AM_NEWBB_PRUNE_FORUMS","Forums to be pruned"); +define ("_AM_NEWBB_PRUNE_STICKY","Keep Sticky topics"); +define ("_AM_NEWBB_PRUNE_DIGEST","Keep Digest topics"); +define ("_AM_NEWBB_PRUNE_LOCK","Keep Locked topics"); +define ("_AM_NEWBB_PRUNE_HOT","Keep topics with more than this number of replies"); +define ("_AM_NEWBB_PRUNE_SUBMIT","Ok"); +define ("_AM_NEWBB_PRUNE_RESET","Reset"); +define ("_AM_NEWBB_PRUNE_YES","Yes"); +define ("_AM_NEWBB_PRUNE_NO","No"); +define ("_AM_NEWBB_PRUNE_WEEK","A Week"); +define ("_AM_NEWBB_PRUNE_2WEEKS","Two Weeks"); +define ("_AM_NEWBB_PRUNE_MONTH","A Month"); +define ("_AM_NEWBB_PRUNE_2MONTH","Two Months"); +define ("_AM_NEWBB_PRUNE_4MONTH","Four Months"); +define ("_AM_NEWBB_PRUNE_YEAR","A Year"); +define ("_AM_NEWBB_PRUNE_2YEARS","2 Years"); // About.php constants define('_AM_NEWBB_AUTHOR_INFO',"Author Information"); @@ -227,8 +227,7 @@ define('_AM_NEWBB_MODULE_DISCLAIMER',"Disclaimer"); define('_AM_NEWBB_AUTHOR_WORD',"The Author's Word"); define('_AM_NEWBB_BY','By'); -define('_AM_NEWBB_AUTHOR_WORD_EXTRA'," -"); +define('_AM_NEWBB_AUTHOR_WORD_EXTRA',"Extra words by module Author"); // admin_report.php define("_AM_NEWBB_REPORTADMIN","Reported posts manager"); Modified: XoopsModules/newbb/branches/irmtfan/newbb/language/english/main.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/language/english/main.php 2012-08-15 06:10:19 UTC (rev 10072) +++ XoopsModules/newbb/branches/irmtfan/newbb/language/english/main.php 2012-08-15 07:36:34 UTC (rev 10073) @@ -34,7 +34,7 @@ define('_MD_NEWPOSTS','New posts'); define('_MD_NONEWPOSTS','No new posts'); define('_MD_PRIVATEFORUM','Inactive Forum'); -define('_MD_BY','by'); // Posted by +define('_MD_BY','by');// Posted by define('_MD_TOSTART','To start viewing messages, select the forum that you want to visit from the list below.'); define('_MD_TOTALTOPICSC','Total Topics: '); define('_MD_TOTALPOSTSC','Total Posts: '); @@ -236,8 +236,8 @@ define('_MD_TIMEISUPDEL','You\'ve reached the time limit for deleting your post.'); //reply.php -define('_MD_ON','on'); //Posted on -define('_MD_USERWROTE','%s wrote:'); // %s is username +define('_MD_ON','on');//Posted on +define('_MD_USERWROTE','%s wrote:');// %s is username define('_MD_RE','Re'); //post.php @@ -247,7 +247,7 @@ define('_MD_THANKSSUBMIT','Thanks for your submission!'); define('_MD_REPLYPOSTED','A reply to your topic has been posted.'); define('_MD_HELLO','Hello %s,'); -define('_MD_URRECEIVING','You are receiving this email because a message you posted on %s forums has been replied to.'); // %s is your site name +define('_MD_URRECEIVING','You are receiving this email because a message you posted on %s forums has been replied to.');// %s is your site name define('_MD_CLICKBELOW','Click on the link below to view the thread:'); define('_MD_WAITFORAPPROVAL','Thank you. Your post will be approved before publication.'); define('_MD_POSTING_LIMITED','Why not take a break and come back in %d sec'); @@ -344,7 +344,7 @@ define("_MD_CANTVOTEOWN","You cannot vote on the topic you submitted.<br />All votes are logged and reviewed."); define("_MD_VOTEONCE","Please do not vote for the same topic more than once."); define("_MD_VOTEAPPRE","Your vote is appreciated."); -define("_MD_THANKYOU","Thank you for taking the time to vote here at %s"); // %s is your site name +define("_MD_THANKYOU","Thank you for taking the time to vote here at %s");// %s is your site name define("_MD_VOTES","Votes"); define("_MD_NOVOTERATE","You did not rate this Topic"); @@ -431,7 +431,7 @@ define("_MD_NEWBB_SEENOTGUEST","<font color=\"red\"><b>Link only for registered users</b></font>"); define("_MD_NEWBB_REPORTSUBJECT","A contribution has been reported"); define("_MD_NEWBB_GOTOLASTPOST","Go to last post"); -define("_MD_EDITEDMSG","Reason (optional):"); +define("_MD_EDITEDMSG","Reason:"); define("_MD_DELEDEDMSG","Reason for deleting<br /><small>(If a reason is provided, the user will receive a message)</small>:"); define("_MD_DELEDEDMSG_SUBJECT","Deletion of your article"); define("_MD_DELEDEDMSG_BODY","Hello %s, Modified: XoopsModules/newbb/branches/irmtfan/newbb/language/english/modinfo.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/language/english/modinfo.php 2012-08-15 06:10:19 UTC (rev 10072) +++ XoopsModules/newbb/branches/irmtfan/newbb/language/english/modinfo.php 2012-08-15 07:36:34 UTC (rev 10073) @@ -50,7 +50,7 @@ define("_MI_PATH_MAGICK","Path for ImageMagick"); define("_MI_PATH_MAGICK_DESC","Usually it is '/usr/bin/X11'. Leave it BLANK if you do not have ImageMagicK installed or for autodetecting."); define("_MI_SUBFORUM_DISPLAY","Display Mode of subforums on index page"); -define("_MI_SUBFORUM_DISPLAY_DESC",""); +define("_MI_SUBFORUM_DISPLAY_DESC","Choose one of the methods to display subforums"); define("_MI_SUBFORUM_EXPAND","Expand"); define("_MI_SUBFORUM_COLLAPSE","Collapse"); define("_MI_SUBFORUM_HIDDEN","Hidden"); @@ -103,7 +103,7 @@ define("_MI_VIEWMODE_DESC","To override the General Settings of viewmode within threads, set to NONE in order to switch feature off"); define("_MI_COMPACT","Compact"); define("_MI_MENUMODE","Default Menu Mode"); -define("_MI_MENUMODE_DESC","'SELECT' - select options, 'HOVER' - may slow down IE, 'CLICK' - requires JAVASCRIPT"); +define("_MI_MENUMODE_DESC","'SELECT' - select options,'HOVER' - may slow down IE,'CLICK' - requires JAVASCRIPT"); define("_MI_REPORTMOD_ENABLE","Report a Post"); define("_MI_REPORTMOD_ENABLE_DESC","User can report posts to Moderator(s), for any reason, which enables Moderator(s) to take action"); define("_MI_SHOW_JUMPBOX","Show Jumpbox"); @@ -171,45 +171,45 @@ define("_MI_PERMCHECK_ONDISPLAY","Check permission"); define("_MI_PERMCHECK_ONDISPLAY_DESC","Check permission for edit on display page"); define("_MI_USERMODERATE","Enable user moderation"); -define("_MI_USERMODERATE_DESC",""); +define("_MI_USERMODERATE_DESC","Forum moderator can suspend a specific user for a specific time period in the forum"); // RMV-NOTIFY // Notification event descriptions and mail templates -define('_MI_NEWBB_THREAD_NOTIFY','Thread'); -define('_MI_NEWBB_THREAD_NOTIFYDSC','Notification options that apply to the current thread.'); -define('_MI_NEWBB_FORUM_NOTIFY','Forum'); -define('_MI_NEWBB_FORUM_NOTIFYDSC','Notification options that apply to the current forum.'); -define('_MI_NEWBB_GLOBAL_NOTIFY','Global'); -define('_MI_NEWBB_GLOBAL_NOTIFYDSC','Global forum notification options.'); -define('_MI_NEWBB_THREAD_NEWPOST_NOTIFY','New Post'); -define('_MI_NEWBB_THREAD_NEWPOST_NOTIFYCAP','Notify me of new posts in the current thread.'); -define('_MI_NEWBB_THREAD_NEWPOST_NOTIFYDSC','Receive notification when a new message is posted in the current thread.'); -define('_MI_NEWBB_THREAD_NEWPOST_NOTIFYSBJ','[{X_SITENAME}] {X_MODULE} auto-notify : New post in thread'); -define('_MI_NEWBB_FORUM_NEWTHREAD_NOTIFY','New Thread'); -define('_MI_NEWBB_FORUM_NEWTHREAD_NOTIFYCAP','Notify me of new topics in the current forum.'); -define('_MI_NEWBB_FORUM_NEWTHREAD_NOTIFYDSC','Receive notification when a new thread is started in the current forum.'); -define('_MI_NEWBB_FORUM_NEWTHREAD_NOTIFYSBJ','[{X_SITENAME}] {X_MODULE} auto-notify : New thread in forum'); -define('_MI_NEWBB_GLOBAL_NEWFORUM_NOTIFY','New Forum'); -define('_MI_NEWBB_GLOBAL_NEWFORUM_NOTIFYCAP','Notify me when a new forum is created.'); -define('_MI_NEWBB_GLOBAL_NEWFORUM_NOTIFYDSC','Receive notification when a new forum is created.'); -define('_MI_NEWBB_GLOBAL_NEWFORUM_NOTIFYSBJ','[{X_SITENAME}] {X_MODULE} auto-notify : New forum'); -define('_MI_NEWBB_GLOBAL_NEWPOST_NOTIFY','New Post'); -define('_MI_NEWBB_GLOBAL_NEWPOST_NOTIFYCAP','Notify me of any new posts.'); -define('_MI_NEWBB_GLOBAL_NEWPOST_NOTIFYDSC','Receive notification when any new message is posted.'); -define('_MI_NEWBB_GLOBAL_NEWPOST_NOTIFYSBJ','[{X_SITENAME}] {X_MODULE} auto-notify : New post'); -define('_MI_NEWBB_FORUM_NEWPOST_NOTIFY','New Post'); -define('_MI_NEWBB_FORUM_NEWPOST_NOTIFYCAP','Notify me of any new posts in the current forum.'); -define('_MI_NEWBB_FORUM_NEWPOST_NOTIFYDSC','Receive notification when any new message is posted in the current forum.'); -define('_MI_NEWBB_FORUM_NEWPOST_NOTIFYSBJ','[{X_SITENAME}] {X_MODULE} auto-notify : New post in forum'); -define('_MI_NEWBB_GLOBAL_NEWFULLPOST_NOTIFY','New Post (Full Text)'); -define('_MI_NEWBB_GLOBAL_NEWFULLPOST_NOTIFYCAP','Notify me of any new posts (include full text in message).'); -define('_MI_NEWBB_GLOBAL_NEWFULLPOST_NOTIFYDSC','Receive full text notification when any new message is posted.'); -define('_MI_NEWBB_GLOBAL_NEWFULLPOST_NOTIFYSBJ','[{X_SITENAME}] {X_MODULE} auto-notify : New post (full text)'); -define('_MI_NEWBB_GLOBAL_DIGEST_NOTIFY','Digest'); -define('_MI_NEWBB_GLOBAL_DIGEST_NOTIFYCAP','Notify me of post digest.'); -define('_MI_NEWBB_GLOBAL_DIGEST_NOTIFYDSC','Receive digest notification.'); -define('_MI_NEWBB_GLOBAL_DIGEST_NOTIFYSBJ','[{X_SITENAME}] {X_MODULE} auto-notify : post digest'); +define ('_MI_NEWBB_THREAD_NOTIFY','Thread'); +define ('_MI_NEWBB_THREAD_NOTIFYDSC','Notification options that apply to the current thread.'); +define ('_MI_NEWBB_FORUM_NOTIFY','Forum'); +define ('_MI_NEWBB_FORUM_NOTIFYDSC','Notification options that apply to the current forum.'); +define ('_MI_NEWBB_GLOBAL_NOTIFY','Global'); +define ('_MI_NEWBB_GLOBAL_NOTIFYDSC','Global forum notification options.'); +define ('_MI_NEWBB_THREAD_NEWPOST_NOTIFY','New Post'); +define ('_MI_NEWBB_THREAD_NEWPOST_NOTIFYCAP','Notify me of new posts in the current thread.'); +define ('_MI_NEWBB_THREAD_NEWPOST_NOTIFYDSC','Receive notification when a new message is posted in the current thread.'); +define ('_MI_NEWBB_THREAD_NEWPOST_NOTIFYSBJ','[{X_SITENAME}] {X_MODULE} auto-notify : New post in thread'); +define ('_MI_NEWBB_FORUM_NEWTHREAD_NOTIFY','New Thread'); +define ('_MI_NEWBB_FORUM_NEWTHREAD_NOTIFYCAP','Notify me of new topics in the current forum.'); +define ('_MI_NEWBB_FORUM_NEWTHREAD_NOTIFYDSC','Receive notification when a new thread is started in the current forum.'); +define ('_MI_NEWBB_FORUM_NEWTHREAD_NOTIFYSBJ','[{X_SITENAME}] {X_MODULE} auto-notify : New thread in forum'); +define ('_MI_NEWBB_GLOBAL_NEWFORUM_NOTIFY','New Forum'); +define ('_MI_NEWBB_GLOBAL_NEWFORUM_NOTIFYCAP','Notify me when a new forum is created.'); +define ('_MI_NEWBB_GLOBAL_NEWFORUM_NOTIFYDSC','Receive notification when a new forum is created.'); +define ('_MI_NEWBB_GLOBAL_NEWFORUM_NOTIFYSBJ','[{X_SITENAME}] {X_MODULE} auto-notify : New forum'); +define ('_MI_NEWBB_GLOBAL_NEWPOST_NOTIFY','New Post'); +define ('_MI_NEWBB_GLOBAL_NEWPOST_NOTIFYCAP','Notify me of any new posts.'); +define ('_MI_NEWBB_GLOBAL_NEWPOST_NOTIFYDSC','Receive notification when any new message is posted.'); +define ('_MI_NEWBB_GLOBAL_NEWPOST_NOTIFYSBJ','[{X_SITENAME}] {X_MODULE} auto-notify : New post'); +define ('_MI_NEWBB_FORUM_NEWPOST_NOTIFY','New Post'); +define ('_MI_NEWBB_FORUM_NEWPOST_NOTIFYCAP','Notify me of any new posts in the current forum.'); +define ('_MI_NEWBB_FORUM_NEWPOST_NOTIFYDSC','Receive notification when any new message is posted in the current forum.'); +define ('_MI_NEWBB_FORUM_NEWPOST_NOTIFYSBJ','[{X_SITENAME}] {X_MODULE} auto-notify : New post in forum'); +define ('_MI_NEWBB_GLOBAL_NEWFULLPOST_NOTIFY','New Post (Full Text)'); +define ('_MI_NEWBB_GLOBAL_NEWFULLPOST_NOTIFYCAP','Notify me of any new posts (include full text in message).'); +define ('_MI_NEWBB_GLOBAL_NEWFULLPOST_NOTIFYDSC','Receive full text notification when any new message is posted.'); +define ('_MI_NEWBB_GLOBAL_NEWFULLPOST_NOTIFYSBJ','[{X_SITENAME}] {X_MODULE} auto-notify : New post (full text)'); +define ('_MI_NEWBB_GLOBAL_DIGEST_NOTIFY','Digest'); +define ('_MI_NEWBB_GLOBAL_DIGEST_NOTIFYCAP','Notify me of post digest.'); +define ('_MI_NEWBB_GLOBAL_DIGEST_NOTIFYDSC','Receive digest notification.'); +define ('_MI_NEWBB_GLOBAL_DIGEST_NOTIFYSBJ','[{X_SITENAME}] {X_MODULE} auto-notify : post digest'); // FOR installation define("_MI_NEWBB_INSTALL_CAT_TITLE","Category Test"); @@ -226,16 +226,16 @@ define("_MI_NEWBB_ADMENU_GROUPMOD","Group moderate"); define("_MI_SUBJECT_PREFIX","Add a prefix to the topic subject"); define("_MI_SUBJECT_PREFIX_DESC","Sets a prefix, such as [SOLVED] at the beginning of the subject. For more options please use one ',' as the separator. NONE is no prefix."); -define("_MI_SUBJECT_PREFIX_DEFAULT", '<font color="#00CC00"> [solved] </ font> <font color="#00CC00"> [done] </ font> <font color="#FF0000"> [request] </ font> , <font color="#FF0000"> [bug report] </ font> <font color="#FF0000"> [unsolved] </ font>'); +define("_MI_SUBJECT_PREFIX_DEFAULT",'<font color="#00CC00"> [solved] </ font> <font color="#00CC00"> [done] </ font> <font color="#FF0000"> [request] </ font> , <font color="#FF0000"> [bug report] </ font> <font color="#FF0000"> [unsolved] </ font>'); define("_MI_SUBJECT_PREFIX_LEVEL","Permissions for use of prefixes"); define("_MI_SUBJECT_PREFIX_LEVEL_DESC","The group (s) select the prefixes to use it."); -define("_MI_SPL_DISABLE", 'disabled'); -define("_MI_SPL_ANYONE", 'each'); -define("_MI_SPL_MEMBER", 'Members'); -define("_MI_SPL_MODERATOR", 'Moderators'); -define("_MI_SPL_ADMIN", 'Administrators'); +define("_MI_SPL_DISABLE",'disabled'); +define("_MI_SPL_ANYONE",'each'); +define("_MI_SPL_MEMBER",'Members'); +define("_MI_SPL_MODERATOR",'Moderators'); +define("_MI_SPL_ADMIN",'Administrators'); define("_MI_STATISTIK_ENABLE","enable Stats"); -define("_MI_STATISTIK_ENABLE_DESC",""); +define("_MI_STATISTIK_ENABLE_DESC","The stats will be shown in your forum at the bottom of each forum/topic"); //4.05 define('_MI_SHOW_INFOBOX','Show Infobox'); Modified: XoopsModules/newbb/branches/irmtfan/newbb/language/persian/admin.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/language/persian/admin.php 2012-08-15 06:10:19 UTC (rev 10072) +++ XoopsModules/newbb/branches/irmtfan/newbb/language/persian/admin.php 2012-08-15 07:36:34 UTC (rev 10073) @@ -1,297 +1,296 @@ -<?php -// $Id: admin.php,v 1.3 2005/10/19 17:20:33 phppp Exp $ - -if(defined('NEWBB_ADMIN_DEFINED')) return; -else define('NEWBB_ADMIN_DEFINED',true); - -//%%%%%% File Name index.php %%%%% -define("_AM_NEWBB_FORUMCONF","تنظیمات انجمن"); -define("_AM_NEWBB_ADDAFORUM","اضافه کردن یکانجمن"); -define("_AM_NEWBB_SYNCFORUM","همگام سازی انجمن"); -define("_AM_NEWBB_REORDERFORUM","مرتب سازی دوباره"); -define("_AM_NEWBB_FORUM_MANAGER","انجمنها"); -define("_AM_NEWBB_PRUNE_TITLE","هرس کردن"); -define("_AM_NEWBB_CATADMIN","شاخهها"); -define("_AM_NEWBB_GENERALSET","تنظیمات ماژول"); -define("_AM_NEWBB_MODULEADMIN","مدیریت ماژول:"); -define("_AM_NEWBB_HELP","کمک"); -define("_AM_NEWBB_ABOUT","درباره"); -define("_AM_NEWBB_BOARDSUMMARY","آمار Board"); -define("_AM_NEWBB_PENDING_POSTS_FOR_AUTH","تایید پستهای معلق"); -define("_AM_NEWBB_POSTID","ID پست"); -define("_AM_NEWBB_POSTDATE","تاریخ پست"); -define("_AM_NEWBB_POSTER","فرستنده"); -define("_AM_NEWBB_TOPICS","تاپیکها"); -define("_AM_NEWBB_SHORTSUMMARY","خلاصهی Board"); -define("_AM_NEWBB_TOTALPOSTS","مجموع پستها"); -define("_AM_NEWBB_TOTALTOPICS","مجموع تاپیکها"); -define("_AM_NEWBB_TOTALVIEWS","مجموع دیده شدهها"); -define("_AM_NEWBB_BLOCKS","بلاکها"); -define("_AM_NEWBB_SUBJECT","عنوان"); -define("_AM_NEWBB_APPROVE","تایید پست"); -define("_AM_NEWBB_APPROVETEXT","محتوای این پست"); -define("_AM_NEWBB_POSTAPPROVED","این پست تایید شد"); -define("_AM_NEWBB_POSTNOTAPPROVED","پست تایید نشد"); -define("_AM_NEWBB_POSTSAVED","پست ذخیره شد"); -define("_AM_NEWBB_POSTNOTSAVED","پست ذخیره نشد"); -define("_AM_NEWBB_TOPICAPPROVED","تاپیک تایید شد"); -define("_AM_NEWBB_TOPICNOTAPPROVED","تاپیکتایید نشد"); -define("_AM_NEWBB_TOPICID","ID تاپیک"); -define("_AM_NEWBB_ORPHAN_TOPICS_FOR_AUTH","تایید نکردن تاپیکهای ارسال شده"); -define('_AM_NEWBB_DEL_ONE','فقط این پیام را پاککن'); -define('_AM_NEWBB_POSTSDELETED','پیام انتخاب شده حذف شد'); -define('_AM_NEWBB_NOAPPROVEPOST','در حال حاضر هیچ پست منتظر برای تایید موجود نیست.'); -define('_AM_NEWBB_SUBJECTC','عنوان:'); -define('_AM_NEWBB_MESSAGEICON','شکلکپیام:'); -define('_AM_NEWBB_MESSAGEC','پیام:'); -define('_AM_NEWBB_CANCELPOST','لغو کردن ارسال'); -define('_AM_NEWBB_GOTOMOD','برو به ماژول'); -define('_AM_NEWBB_PREFERENCES','تنظیمات ماژول'); -define('_AM_NEWBB_POLLMODULE','ماژول Xoops poll'); -define('_AM_NEWBB_POLL_OK','آماده برای استفاده'); -define('_AM_NEWBB_GDLIB1','GD1 library:'); -define('_AM_NEWBB_GDLIB2','GD2 library:'); -define('_AM_NEWBB_AUTODETECTED','شناسایی خودکار: '); -define('_AM_NEWBB_AVAILABLE','آمادهاست'); -define('_AM_NEWBB_NOTAVAILABLE','<font color="red">آماده نیست</font>'); -define('_AM_NEWBB_NOTWRITABLE','<font color="red">قابل دسترسی نیست</font>'); -define('_AM_NEWBB_IMAGEMAGICK','ImageMagicK'); -define('_AM_NEWBB_IMAGEMAGICK_NOTSET','تنظیمنشده'); -define('_AM_NEWBB_ATTACHPATH','مسیر برای قرار دادن ضمائم'); -define('_AM_NEWBB_THUMBPATH','مسیر برای قرار دادن تصاویر تمبری'); -//define('_AM_NEWBB_RSSPATH','مسیر برای RSS feed'); -define('_AM_NEWBB_REPORT','پیامهای گزارش داده شده'); -define('_AM_NEWBB_REPORT_PENDING','گزارشهای معلق'); -define('_AM_NEWBB_REPORT_PROCESSED','گزارشهای پردازش شده'); -define('_AM_NEWBB_CREATETHEDIR','بساز'); -define('_AM_NEWBB_SETMPERM','گذاشتن دسترسی ها'); -define('_AM_NEWBB_DIRCREATED','شاخه ساخته شد'); -define('_AM_NEWBB_DIRNOTCREATED','شاخه شاخته نشد'); -define('_AM_NEWBB_PERMSET','دسترسی تنظیم شد'); -define('_AM_NEWBB_PERMNOTSET','دسترسی تنظیم نشد'); -define('_AM_NEWBB_DIGEST','آگهای رسانی خلاصه ها'); -define('_AM_NEWBB_DIGEST_PAST','<font color="red"> %d دقیقه پیش گذاشته شده است</font>'); -define('_AM_NEWBB_DIGEST_NEXT',' %d دقیقه دیگر فرستاده می شود'); -define('_AM_NEWBB_DIGEST_ARCHIVE','خلاصه در آرشیو قرار گرفت'); -define('_AM_NEWBB_DIGEST_SENT','خلاصه در حال فرستاده شدن'); -define('_AM_NEWBB_DIGEST_FAILED','خلاصه فرستاده نشد'); - -// admin_forum_manager.php -define("_AM_NEWBB_NAME","نام"); -define("_AM_NEWBB_CREATEFORUM","ایجاد انجمن"); -define("_AM_NEWBB_EDIT","ویرایش"); -define("_AM_NEWBB_CLEAR","پاک کردن گزینه ها"); -define("_AM_NEWBB_DELETE","حذف"); -define("_AM_NEWBB_ADD","اضافهکردن"); -define("_AM_NEWBB_MOVE","انتقال"); -define("_AM_NEWBB_ORDER","ردیفکردن"); -define("_AM_NEWBB_TWDAFAP","این قسمت انجمن و تمام پیامهای زده شده در آن را حذف خواهد کرد.<br><br>هشدار: آیا مطمئنید که این انجمن را میخواهید پاککنید؟"); -define("_AM_NEWBB_FORUMREMOVED","انجمن پاکشد."); -define("_AM_NEWBB_CREATENEWFORUM","ایجاد یکانجمن جدید"); -define("_AM_NEWBB_EDITTHISFORUM","ویرایش انجمن:"); -define("_AM_NEWBB_SET_FORUMORDER","تنظیم محل... [truncated message content] |
From: <ir...@us...> - 2012-08-25 12:17:36
|
Revision: 10102 http://xoops.svn.sourceforge.net/xoops/?rev=10102&view=rev Author: irmtfan Date: 2012-08-25 12:17:27 +0000 (Sat, 25 Aug 2012) Log Message: ----------- Modified Paths: -------------- XoopsModules/newbb/branches/irmtfan/newbb/admin/about.php XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_blocks.php XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_cat_manager.php XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_digest.php XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_forum_manager.php XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_forum_prune.php XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_forum_reorder.php XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_groupmod.php XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_header.php XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_permissions.php XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_report.php XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_synchronization.php XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_type_manager.php XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_votedata.php XoopsModules/newbb/branches/irmtfan/newbb/admin/index.php XoopsModules/newbb/branches/irmtfan/newbb/admin/menu.php XoopsModules/newbb/branches/irmtfan/newbb/blocks/newbb_block.php XoopsModules/newbb/branches/irmtfan/newbb/blocks/newbb_block_tag.php XoopsModules/newbb/branches/irmtfan/newbb/class/forum.php XoopsModules/newbb/branches/irmtfan/newbb/class/newbbtree.php XoopsModules/newbb/branches/irmtfan/newbb/class/permission.forum.php XoopsModules/newbb/branches/irmtfan/newbb/class/permission.php XoopsModules/newbb/branches/irmtfan/newbb/class/post.php XoopsModules/newbb/branches/irmtfan/newbb/class/rate.php XoopsModules/newbb/branches/irmtfan/newbb/class/read.php XoopsModules/newbb/branches/irmtfan/newbb/class/readforum.php XoopsModules/newbb/branches/irmtfan/newbb/class/readtopic.php XoopsModules/newbb/branches/irmtfan/newbb/class/tree.php XoopsModules/newbb/branches/irmtfan/newbb/class/user.php XoopsModules/newbb/branches/irmtfan/newbb/class/xoopsformloader.php XoopsModules/newbb/branches/irmtfan/newbb/docs/changelog.txt XoopsModules/newbb/branches/irmtfan/newbb/docs/lang_diff.txt XoopsModules/newbb/branches/irmtfan/newbb/include/form.forum.php XoopsModules/newbb/branches/irmtfan/newbb/include/form.post.php XoopsModules/newbb/branches/irmtfan/newbb/include/functions.image.php XoopsModules/newbb/branches/irmtfan/newbb/include/functions.ini.php XoopsModules/newbb/branches/irmtfan/newbb/include/functions.user.php XoopsModules/newbb/branches/irmtfan/newbb/include/module.php XoopsModules/newbb/branches/irmtfan/newbb/include/module.v100.php XoopsModules/newbb/branches/irmtfan/newbb/include/module.v220.php XoopsModules/newbb/branches/irmtfan/newbb/include/notification.inc.php XoopsModules/newbb/branches/irmtfan/newbb/include/plugin.php XoopsModules/newbb/branches/irmtfan/newbb/include/search.inc.php XoopsModules/newbb/branches/irmtfan/newbb/include/sitemap.plugin.php XoopsModules/newbb/branches/irmtfan/newbb/index.php XoopsModules/newbb/branches/irmtfan/newbb/language/english/admin.php XoopsModules/newbb/branches/irmtfan/newbb/language/english/main.php XoopsModules/newbb/branches/irmtfan/newbb/language/german/admin.php XoopsModules/newbb/branches/irmtfan/newbb/language/german/blocks.php XoopsModules/newbb/branches/irmtfan/newbb/language/german/main.php XoopsModules/newbb/branches/irmtfan/newbb/language/german/modinfo.php XoopsModules/newbb/branches/irmtfan/newbb/language/persian/admin.php XoopsModules/newbb/branches/irmtfan/newbb/language/persian/main.php XoopsModules/newbb/branches/irmtfan/newbb/notification_update.php XoopsModules/newbb/branches/irmtfan/newbb/post.php XoopsModules/newbb/branches/irmtfan/newbb/ratethread.php XoopsModules/newbb/branches/irmtfan/newbb/reply.php XoopsModules/newbb/branches/irmtfan/newbb/report.php XoopsModules/newbb/branches/irmtfan/newbb/rss.php XoopsModules/newbb/branches/irmtfan/newbb/search.php XoopsModules/newbb/branches/irmtfan/newbb/seo.php XoopsModules/newbb/branches/irmtfan/newbb/sql/mysql.400.sql XoopsModules/newbb/branches/irmtfan/newbb/templates/blocks/index.html XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/english/index.html XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/index.html XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_online.html XoopsModules/newbb/branches/irmtfan/newbb/topicmanager.php XoopsModules/newbb/branches/irmtfan/newbb/viewforum.php XoopsModules/newbb/branches/irmtfan/newbb/viewpost.php XoopsModules/newbb/branches/irmtfan/newbb/viewtopic.php XoopsModules/newbb/branches/irmtfan/newbb/votepolls.php XoopsModules/newbb/branches/irmtfan/newbb/xoops_version.php Added Paths: ----------- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10095.txt XoopsModules/newbb/branches/irmtfan/newbb/templates/images/mime/index.html XoopsModules/newbb/branches/irmtfan/newbb/templates/images/rpg/index.html Modified: XoopsModules/newbb/branches/irmtfan/newbb/admin/about.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/admin/about.php 2012-08-25 11:05:56 UTC (rev 10101) +++ XoopsModules/newbb/branches/irmtfan/newbb/admin/about.php 2012-08-25 12:17:27 UTC (rev 10102) @@ -1,5 +1,5 @@ <?php -// $Id: about.php,v 1.3 2005/10/19 17:20:32 phppp Exp $ +// $Id: about.php 62 2012-08-17 10:15:26Z alfred $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // Modified: XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_blocks.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_blocks.php 2012-08-25 11:05:56 UTC (rev 10101) +++ XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_blocks.php 2012-08-25 12:17:27 UTC (rev 10102) @@ -1,5 +1,5 @@ <?php -// $Id: admin_blocks.php,v 1.1.1.1 2005/10/19 15:58:11 phppp Exp $ +// $Id: admin_blocks.php 62 2012-08-17 10:15:26Z alfred $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // Modified: XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_cat_manager.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_cat_manager.php 2012-08-25 11:05:56 UTC (rev 10101) +++ XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_cat_manager.php 2012-08-25 12:17:27 UTC (rev 10102) @@ -1,5 +1,5 @@ <?php -// $Id: admin_cat_manager.php,v 1.3 2005/10/19 17:20:32 phppp Exp $ +// $Id: admin_cat_manager.php 62 2012-08-17 10:15:26Z alfred $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // Modified: XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_digest.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_digest.php 2012-08-25 11:05:56 UTC (rev 10101) +++ XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_digest.php 2012-08-25 12:17:27 UTC (rev 10102) @@ -1,5 +1,5 @@ <?php -// $Id: admin_digest.php,v 1.1.1.1 2005/10/19 15:58:11 phppp Exp $ +// $Id: admin_digest.php 62 2012-08-17 10:15:26Z alfred $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // Modified: XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_forum_manager.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_forum_manager.php 2012-08-25 11:05:56 UTC (rev 10101) +++ XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_forum_manager.php 2012-08-25 12:17:27 UTC (rev 10102) @@ -1,5 +1,5 @@ <?php -// $Id: admin_forum_manager.php,v 1.3 2005/10/19 17:20:32 phppp Exp $ +// $Id: admin_forum_manager.php 62 2012-08-17 10:15:26Z alfred $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // Modified: XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_forum_prune.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_forum_prune.php 2012-08-25 11:05:56 UTC (rev 10101) +++ XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_forum_prune.php 2012-08-25 12:17:27 UTC (rev 10102) @@ -1,5 +1,5 @@ <?php -// $Id: admin_forum_prune.php,v 1.3 2005/10/19 17:20:32 phppp Exp $ +// $Id: admin_forum_prune.php 62 2012-08-17 10:15:26Z alfred $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // Modified: XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_forum_reorder.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_forum_reorder.php 2012-08-25 11:05:56 UTC (rev 10101) +++ XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_forum_reorder.php 2012-08-25 12:17:27 UTC (rev 10102) @@ -1,5 +1,5 @@ <?php -// $Id: admin_forum_reorder.php,v 1.3 2005/10/19 17:20:32 phppp Exp $ +// $Id: admin_forum_reorder.php 62 2012-08-17 10:15:26Z alfred $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // Modified: XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_groupmod.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_groupmod.php 2012-08-25 11:05:56 UTC (rev 10101) +++ XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_groupmod.php 2012-08-25 12:17:27 UTC (rev 10102) @@ -96,4 +96,4 @@ echo "</form></fieldset>"; echo "</fieldset>"; xoops_cp_footer(); -?> +?> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_header.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_header.php 2012-08-25 11:05:56 UTC (rev 10101) +++ XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_header.php 2012-08-25 12:17:27 UTC (rev 10102) @@ -1,5 +1,5 @@ <?php -// $Id: admin_header.php,v 1.3 2005/10/19 17:20:32 phppp Exp $ +// $Id: admin_header.php 62 2012-08-17 10:15:26Z alfred $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // Modified: XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_permissions.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_permissions.php 2012-08-25 11:05:56 UTC (rev 10101) +++ XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_permissions.php 2012-08-25 12:17:27 UTC (rev 10102) @@ -1,5 +1,5 @@ <?php -// $Id: admin_permissions.php,v 1.1.1.1 2005/10/19 15:58:12 phppp Exp $ +// $Id: admin_permissions.php 69 2012-08-21 19:33:07Z alfred $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // @@ -139,13 +139,6 @@ } } -xoops_cp_header(); -echo "<fieldset>"; -if ($newXoopsModuleGui) echo $indexAdmin->addNavigation('admin_permissions.php'); -//if (!$newXoopsModuleGui) loadModuleAdminMenu(3); -// else echo $indexAdmin->addNavigation('admin_permissions.php'); -echo "<fieldset>"; -if (!$newXoopsModuleGui) echo "<legend style='font-weight: bold; color: #900;'>" . _AM_NEWBB_PERM_ACTION . "</legend>"; $action = isset($_REQUEST['action']) ? strtolower($_REQUEST['action']) : ""; $module_id = $xoopsModule->getVar('mid'); $newbbperm_handler =& xoops_getmodulehandler('permission', 'newbb'); @@ -153,6 +146,9 @@ switch($action) { case "template": + xoops_cp_header(); + echo $indexAdmin->addNavigation('admin_permissions.php'); + echo "<legend style='font-weight: bold; color: #900;'>" . _AM_NEWBB_PERM_ACTION . "</legend>"; $opform = new XoopsSimpleForm(_AM_NEWBB_PERM_ACTION, 'actionform', 'admin_permissions.php', "get"); $op_select = new XoopsFormSelect("", 'action'); $op_select->setExtra('onchange="document.forms.actionform.submit()"'); @@ -204,6 +200,7 @@ $ret .= '</td></tr>'; $ret .= '</table></form>'; echo $ret; + xoops_cp_footer(); break; case "template_save": @@ -219,8 +216,11 @@ $perm_template = $newbbperm_handler->getTemplate(); if ($perm_template === null) { redirect_header("admin_permissions.php?action=template", 2, _AM_NEWBB_PERM_TEMPLATE); + exit(); } - + xoops_cp_header(); + echo $indexAdmin->addNavigation('admin_permissions.php'); + echo "<legend style='font-weight: bold; color: #900;'>" . _AM_NEWBB_PERM_ACTION . "</legend>"; $opform = new XoopsSimpleForm(_AM_NEWBB_PERM_ACTION, 'actionform', 'admin_permissions.php', "get"); $op_select = new XoopsFormSelect("", 'action'); $op_select->setExtra('onchange="document.forms.actionform.submit()"'); @@ -254,6 +254,7 @@ $tray->addElement(new XoopsFormButton('', 'reset', _CANCEL, 'reset')); $fmform->addElement($tray); $fmform->display(); + xoops_cp_footer(); break; case "apply_save": @@ -262,11 +263,14 @@ if ($forum < 1) continue; $newbbperm_handler->applyTemplate($forum, $module_id); } + mod_clearCacheFile("permission","newbb"); redirect_header("admin_permissions.php", 2, _AM_NEWBB_PERM_TEMPLATE_APPLIED); break; default: - + xoops_cp_header(); + echo $indexAdmin->addNavigation('admin_permissions.php'); + echo "<legend style='font-weight: bold; color: #900;'>" . _AM_NEWBB_PERM_ACTION . "</legend>"; $opform = new XoopsSimpleForm(_AM_NEWBB_PERM_ACTION, 'actionform', 'admin_permissions.php', "get"); $op_select = new XoopsFormSelect("", 'action'); $op_select->setExtra('onchange="document.forms.actionform.submit()"'); @@ -333,11 +337,9 @@ // Since we can not control the permission update, a trick is used here $permission_handler =& xoops_getmodulehandler("permission", "newbb"); $permission_handler->createPermData(); - + mod_clearCacheFile("permission","newbb"); + xoops_cp_footer(); break; } -mod_clearCacheFile("forum","newbb"); -mod_clearCacheFile("permission","newbb"); -echo "</fieldset></fieldset>"; -xoops_cp_footer(); + ?> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_report.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_report.php 2012-08-25 11:05:56 UTC (rev 10101) +++ XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_report.php 2012-08-25 12:17:27 UTC (rev 10102) @@ -1,5 +1,5 @@ <?php -// $Id: admin_report.php,v 1.3 2005/10/19 17:20:32 phppp Exp $ +// $Id: admin_report.php 62 2012-08-17 10:15:26Z alfred $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // Modified: XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_synchronization.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_synchronization.php 2012-08-25 11:05:56 UTC (rev 10101) +++ XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_synchronization.php 2012-08-25 12:17:27 UTC (rev 10102) @@ -6,7 +6,7 @@ * @license http://www.fsf.org/copyleft/gpl.html GNU public license * @author Taiwen Jiang (phppp or D.J.) <ph...@ho...> * @since 4.00 - * @version $Id$ + * @version $Id: admin_synchronization.php 62 2012-08-17 10:15:26Z alfred $ * @package module::newbb */ Modified: XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_type_manager.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_type_manager.php 2012-08-25 11:05:56 UTC (rev 10101) +++ XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_type_manager.php 2012-08-25 12:17:27 UTC (rev 10102) @@ -7,7 +7,7 @@ * @license http://www.fsf.org/copyleft/gpl.html GNU public license * @author Taiwen Jiang (phppp or D.J.) <ph...@ho...> * @since 4.00 - * @version $Id$ + * @version $Id: admin_type_manager.php 62 2012-08-17 10:15:26Z alfred $ * @package module::newbb */ Modified: XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_votedata.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_votedata.php 2012-08-25 11:05:56 UTC (rev 10101) +++ XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_votedata.php 2012-08-25 12:17:27 UTC (rev 10102) @@ -1,5 +1,5 @@ <?php -// $Id: admin_votedata.php,v 1.1.1.1 2005/10/19 15:58:12 phppp Exp $ +// $Id: admin_votedata.php 62 2012-08-17 10:15:26Z alfred $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // Modified: XoopsModules/newbb/branches/irmtfan/newbb/admin/index.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/admin/index.php 2012-08-25 11:05:56 UTC (rev 10101) +++ XoopsModules/newbb/branches/irmtfan/newbb/admin/index.php 2012-08-25 12:17:27 UTC (rev 10102) @@ -1,5 +1,5 @@ <?php -// $Id: index.php,v 1.3 2005/10/19 17:20:32 phppp Exp $ +// $Id: index.php 62 2012-08-17 10:15:26Z alfred $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // @@ -151,6 +151,17 @@ $xoopspoll = &$module_handler->getByDirname('umfrage'); if (is_object($xoopspoll)) $isOK = $xoopspoll->getVar('isactive'); } + + $memlimit_iniphp = return_bytes( @ini_get('memory_limit') ); + $postmaxsize_iniphp = return_bytes( @ini_get('post_max_size') ); + if ( $postmaxsize_iniphp < $memlimit_iniphp ) { + $uploadlimit = sprintf(_AM_NEWBB_MEMLIMITOK,return_bytes( $postmaxsize_iniphp, true ) ); + $uploadfarbe = 'Green'; + } else { + $uploadlimit = _AM_NEWBB_MEMLIMITTOLARGE; + $uploadfarbe = 'Red'; + } + if ($newXoopsModuleGui) { $indexAdmin->addInfoBox(_AM_NEWBB_PREFERENCES) ; @@ -159,6 +170,7 @@ $indexAdmin->addInfoBoxLine(_AM_NEWBB_PREFERENCES, "<infotext>" .'NetPBM'.': %s'."</infotext>", array_key_exists('netpbm',$imageLibs) ? _AM_NEWBB_AUTODETECTED.$imageLibs['netpbm'] :_AM_NEWBB_NOTAVAILABLE, 'Green') ; $indexAdmin->addInfoBoxLine(_AM_NEWBB_PREFERENCES, "<infotext>" ._AM_NEWBB_GDLIB1.' %s'. "</infotext>", array_key_exists('gd1',$imageLibs) ? _AM_NEWBB_AUTODETECTED.$imageLibs['gd1'] :_AM_NEWBB_NOTAVAILABLE, 'Red') ; $indexAdmin->addInfoBoxLine(_AM_NEWBB_PREFERENCES, "<infotext>" ._AM_NEWBB_GDLIB2.' %s'. "</infotext>", array_key_exists('gd2',$imageLibs) ? _AM_NEWBB_AUTODETECTED.$imageLibs['gd2'] :_AM_NEWBB_NOTAVAILABLE, 'Green' ) ; + $indexAdmin->addInfoBoxLine(_AM_NEWBB_PREFERENCES, "<infotext>" ._AM_NEWBB_UPLOAD.' %s'. "</infotext>", $uploadlimit ,$uploadfarbe ) ; $indexAdmin->addInfoBox(_AM_NEWBB_BOARDSUMMARY) ; $indexAdmin->addInfoBoxLine(_AM_NEWBB_BOARDSUMMARY, "<infolabel>" ._AM_NEWBB_TOTALTOPICS.': %s' . "</infolabel>", get_total_topics(), 'Green') ; @@ -358,4 +370,21 @@ } mod_clearCacheFile("config","newbb"); mod_clearCacheFile("permission","newbb"); + +function return_bytes ($size_str, $b=false) +{ + if ($b == false) { + switch (substr ($size_str, -1)) + { + case 'M': case 'm': return (int)$size_str * 1048576; + case 'K': case 'k': return (int)$size_str * 1024; + case 'G': case 'g': return (int)$size_str * 1073741824; + default: return $size_str; + } + } else { + $base = log($size_str) / log(1024); + $suffix = array("", "KB", "MB", "GB", "TB"); + return pow(1024, $base - floor($base)) . ' ' . $suffix[floor($base)]; + } +} ?> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/admin/menu.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/admin/menu.php 2012-08-25 11:05:56 UTC (rev 10101) +++ XoopsModules/newbb/branches/irmtfan/newbb/admin/menu.php 2012-08-25 12:17:27 UTC (rev 10102) @@ -1,5 +1,5 @@ <?php -// $Id: menu.php,v 1.3 2005/10/19 17:20:32 phppp Exp $ +// $Id: menu.php 62 2012-08-17 10:15:26Z alfred $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // Modified: XoopsModules/newbb/branches/irmtfan/newbb/blocks/newbb_block.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/blocks/newbb_block.php 2012-08-25 11:05:56 UTC (rev 10101) +++ XoopsModules/newbb/branches/irmtfan/newbb/blocks/newbb_block.php 2012-08-25 12:17:27 UTC (rev 10102) @@ -1,5 +1,5 @@ <?php -// $Id: newbb_block.php,v 1.1.1.2 2005/10/19 16:23:31 phppp Exp $ +// $Id: newbb_block.php 62 2012-08-17 10:15:26Z alfred $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // @@ -54,7 +54,7 @@ global $xoopsConfig; global $access_forums; global $xoopsLogger; - + mod_loadFunctions("time", "newbb"); $myts =& MyTextSanitizer::getInstance(); @@ -95,7 +95,7 @@ if (!empty($newbbConfig['do_rewrite'])) { include_once XOOPS_ROOT_PATH."/modules/newbb/seo_url.php"; } else { - if (!defined('REAL_MODULE_NAME')) define('REAL_MODULE_NAME', 'modules/newbb'); + if (!defined('SEO_MODULE_NAME')) define('SEO_MODULE_NAME', 'modules/newbb'); } $query = 'SELECT'. @@ -166,8 +166,8 @@ } $topic['topic_poster'] = $topic_poster; $topic['topic_page_jump'] = $topic_page_jump; - $seo_url = '<a href="'.XOOPS_URL.'/'.REAL_MODULE_NAME.'/viewtopic.php?post_id='.$topic['post_id'].'">'.$topic['title'].'</a>'; - $seo_forum_url = '<a href="'.XOOPS_URL.'/'.REAL_MODULE_NAME.'/viewforum.php?forum='.$topic['forum_id'].'">'.$topic['forum_name'].'</a>'; + $seo_url = '<a href="'.XOOPS_URL.'/'.SEO_MODULE_NAME.'/viewtopic.php?post_id='.$topic['post_id'].'">'.$topic['title'].'</a>'; + $seo_forum_url = '<a href="'.XOOPS_URL.'/'.SEO_MODULE_NAME.'/viewforum.php?forum='.$topic['forum_id'].'">'.$topic['forum_name'].'</a>'; if (!empty($newbbConfig['do_rewrite'])) { $topic['seo_url'] = seo_urls($seo_url); $topic['seo_forum_url'] = seo_urls($seo_forum_url); @@ -179,11 +179,11 @@ $block['topics'][] = $topic; unset($topic); } - $seo_top_allforums = '<a href="'.XOOPS_URL.'/'.REAL_MODULE_NAME.'/">'._MB_NEWBB_VSTFRMS.'</a>'; + $seo_top_allforums = '<a href="'.XOOPS_URL.'/'.SEO_MODULE_NAME.'/">'._MB_NEWBB_VSTFRMS.'</a>'; $block['seo_top_allforums'] = (!empty($newbbConfig['do_rewrite'])) ? seo_urls($seo_top_allforums) : $seo_top_allforums; - $seo_top_allforums = '<a href="'.XOOPS_URL.'/'.REAL_MODULE_NAME.'/list.topic.php">'._MB_NEWBB_ALLTOPICS.'</a>'; + $seo_top_allforums = '<a href="'.XOOPS_URL.'/'.SEO_MODULE_NAME.'/list.topic.php">'._MB_NEWBB_ALLTOPICS.'</a>'; $block['seo_top_alltopics'] = (!empty($newbbConfig['do_rewrite'])) ? seo_urls($seo_top_allforums) : $seo_top_allforums; - $seo_top_allforums = '<a href="'.XOOPS_URL.'/'.REAL_MODULE_NAME.'/viewpost.php">'._MB_NEWBB_ALLPOSTS.'</a>'; + $seo_top_allforums = '<a href="'.XOOPS_URL.'/'.SEO_MODULE_NAME.'/viewpost.php">'._MB_NEWBB_ALLPOSTS.'</a>'; $block['seo_top_allposts'] = (!empty($newbbConfig['do_rewrite'])) ? seo_urls($seo_top_allforums) : $seo_top_allforums; $block['indexNav'] = intval($options[4]); @@ -203,7 +203,6 @@ { global $xoopsConfig; global $access_forums; - mod_loadFunctions("time", "newbb"); $myts = MyTextSanitizer::getInstance(); $block = array(); @@ -243,7 +242,7 @@ if (!empty($newbbConfig['do_rewrite'])) { include_once XOOPS_ROOT_PATH."/modules/newbb/seo_url.php"; } else { - if (!defined('REAL_MODULE_NAME')) define('REAL_MODULE_NAME', 'modules/newbb'); + if (!defined('SEO_MODULE_NAME')) define('SEO_MODULE_NAME', 'modules/newbb'); } if (!isset($access_forums)) { @@ -322,8 +321,8 @@ } $topic['topic_poster'] = $topic_poster; $topic['topic_page_jump'] = $topic_page_jump; - $seo_url = '<a href="'.XOOPS_URL.'/'.REAL_MODULE_NAME.'/viewtopic.php?topic_id='.$topic['id'].'">'.$topic['title'].'</a>'; - $seo_forum_url = '<a href="'.XOOPS_URL.'/'.REAL_MODULE_NAME.'/viewforum.php?forum='.$topic['forum_id'].'">'.$topic['forum_name'].'</a>'; + $seo_url = '<a href="'.XOOPS_URL.'/'.SEO_MODULE_NAME.'/viewtopic.php?topic_id='.$topic['id'].'">'.$topic['title'].'</a>'; + $seo_forum_url = '<a href="'.XOOPS_URL.'/'.SEO_MODULE_NAME.'/viewforum.php?forum='.$topic['forum_id'].'">'.$topic['forum_name'].'</a>'; if (!empty($newbbConfig['do_rewrite'])) { $topic['seo_url'] = seo_urls($seo_url); @@ -336,9 +335,9 @@ $block['topics'][] = $topic; unset($topic); } - $seo_top_allforums = '<a href="'.XOOPS_URL.'/'.REAL_MODULE_NAME.'/">'._MB_NEWBB_VSTFRMS.'</a>'; + $seo_top_allforums = '<a href="'.XOOPS_URL.'/'.SEO_MODULE_NAME.'/">'._MB_NEWBB_VSTFRMS.'</a>'; $block['seo_top_allforums'] = (!empty($newbbConfig['do_rewrite'])) ? seo_urls($seo_top_allforums) : $seo_top_allforums; - $seo_top_allforums = '<a href="'.XOOPS_URL.'/'.REAL_MODULE_NAME.'/viewpost.php">'._MB_NEWBB_ALLPOSTS.'</a>'; + $seo_top_allforums = '<a href="'.XOOPS_URL.'/'.SEO_MODULE_NAME.'/viewpost.php">'._MB_NEWBB_ALLPOSTS.'</a>'; $block['seo_top_allposts'] = (!empty($newbbConfig['do_rewrite'])) ? seo_urls($seo_top_allforums) : $seo_top_allforums; $block['indexNav'] = intval($options[4]); @@ -394,7 +393,7 @@ if (!empty($newbbConfig['do_rewrite'])) { include_once XOOPS_ROOT_PATH."/modules/newbb/seo_url.php"; } else { - if (!defined('REAL_MODULE_NAME')) define('REAL_MODULE_NAME', 'modules/newbb'); + if (!defined('SEO_MODULE_NAME')) define('SEO_MODULE_NAME', 'modules/newbb'); } if (!empty($options[6])) { @@ -475,8 +474,8 @@ $topic['post_text'] = $post_text; } - $seo_url = '<a href="'.XOOPS_URL.'/'.REAL_MODULE_NAME.'/viewtopic.php?post_id='.$topic['post_id'].'">'.$topic['title'].'</a>'; - $seo_forum_url = '<a href="'.XOOPS_URL.'/'.REAL_MODULE_NAME.'/viewforum.php?forum='.$topic['forum_id'].'">'.$topic['forum_name'].'</a>'; + $seo_url = '<a href="'.XOOPS_URL.'/'.SEO_MODULE_NAME.'/viewtopic.php?post_id='.$topic['post_id'].'">'.$topic['title'].'</a>'; + $seo_forum_url = '<a href="'.XOOPS_URL.'/'.SEO_MODULE_NAME.'/viewforum.php?forum='.$topic['forum_id'].'">'.$topic['forum_name'].'</a>'; if (!empty($newbbConfig['do_rewrite'])) { $topic['seo_url'] = seo_urls($seo_url); @@ -490,9 +489,9 @@ $block['topics'][] = $topic; unset($topic); } - $seo_top_allforums = '<a href="'.XOOPS_URL.'/'.REAL_MODULE_NAME.'/">'._MB_NEWBB_VSTFRMS.'</a>'; + $seo_top_allforums = '<a href="'.XOOPS_URL.'/'.SEO_MODULE_NAME.'/">'._MB_NEWBB_VSTFRMS.'</a>'; $block['seo_top_allforums'] = (!empty($newbbConfig['do_rewrite'])) ? seo_urls($seo_top_allforums) : $seo_top_allforums; - $seo_top_allforums = '<a href="'.XOOPS_URL.'/'.REAL_MODULE_NAME.'/viewpost.php">'._MB_NEWBB_ALLPOSTS.'</a>'; + $seo_top_allforums = '<a href="'.XOOPS_URL.'/'.SEO_MODULE_NAME.'/viewpost.php">'._MB_NEWBB_ALLPOSTS.'</a>'; $block['seo_top_allposts'] = (!empty($newbbConfig['do_rewrite'])) ? seo_urls($seo_top_allforums) : $seo_top_allforums; $block['indexNav'] = intval($options[4]); Modified: XoopsModules/newbb/branches/irmtfan/newbb/blocks/newbb_block_tag.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/blocks/newbb_block_tag.php 2012-08-25 11:05:56 UTC (rev 10101) +++ XoopsModules/newbb/branches/irmtfan/newbb/blocks/newbb_block_tag.php 2012-08-25 12:17:27 UTC (rev 10102) @@ -6,7 +6,7 @@ * @license http://www.fsf.org/copyleft/gpl.html GNU public license * @author Taiwen Jiang (phppp or D.J.) <ph...@ho...> * @since 4.00 - * @version $Id$ + * @version $Id: newbb_block_tag.php 62 2012-08-17 10:15:26Z alfred $ * @package module::newbb/tag */ Added: XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10095.txt =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10095.txt (rev 0) +++ XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10095.txt 2012-08-25 12:17:27 UTC (rev 10102) @@ -0,0 +1,40 @@ +date: 2012-08-25 +================================================ +1- Extra new lines removed from php files. +newbb/votepolls.php, newbb/include/notification.inc.php, newbb/class/permission.forum.php, newbb/admin/admin_groupmod.php + +2- Apply Alfred Id in the head of php files: +newbb/class/xoopsformloader.php, newbb/votepolls.php, newbb/class/tree.php, newbb/topicmanager.php, newbb/class/readtopic.php +newbb/class/readforum.php, newbb/class/read.php, newbb/ratethread.php, newbb/class/rate.php, newbb/class/newbbtree.php +newbb/blocks/newbb_block_tag.php, newbb/index.php, newbb/admin/*.php, +newbb/include/sitemap.plugin.php, newbb/include/search.inc.php, newbb/include/notification.inc.php, newbb/include/functions.user.php, +newbb/include/module.v100.php, newbb/include/module.v220.php, newbb/include/module.php, newbb/include/functions.ini.php +newbb/include/form.forum.php, +newbb/notification_update.php, newbb/report.php, newbb/reply.php + +3- Change the status of module to RC4. +newbb/xoops_version.php + +4- Solve SEO (replace files from Alfred) +newbb/viewpost.php, newbb/viewtopic.php, newbb/blocks/newbb_block.php + +5- Add do_latestedit config to display the latest edit (do_latestedit=0) or all edit (do_latestedit=1) by Alfred +newbb/class/post.php, newbb/include/plugin.php + +6- Replace files from Alfred (better code, bug fixes, merge and develop): +newbb/class/permission.php, newbb/class/forum.php, newbb/sql/mysql.400.sql, newbb/rss.php, newbb/admin/admin_permissions.php +newbb/include/functions.image.php, newbb/include/form.post.php, newbb/viewforum.php +newbb/seo.php, newbb/post.php, newbb/search.php, newbb/docs/changelog.txt, newbb/language/german/*.php + +7- Add new language definitions. +newbb/language/english/admin.php, newbb/language/english/main.php, newbb/language/persian/admin.php, newbb/language/persian/main.php, +newbb/docs/lang_diff.txt + +8- Fix Undefined variable: pseudo_height (Cesag/irmtfan) +in newbb/include/functions.image.php line 86 + +9- Change the default syncOnUpdate value to false. It is dangerous because it will delete all pending and deleted posts/topics/forums from database on update. +newbb/include/plugin.php + +10- easier group getting - reduce queries - use Xoops API instead of directly access to db (irmtfan) +newbb/class/user.php Modified: XoopsModules/newbb/branches/irmtfan/newbb/class/forum.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/class/forum.php 2012-08-25 11:05:56 UTC (rev 10101) +++ XoopsModules/newbb/branches/irmtfan/newbb/class/forum.php 2012-08-25 12:17:27 UTC (rev 10102) @@ -1,909 +1,907 @@ -<?php -/** - * Newbb module - * - * You may not change or alter any portion of this comment or credits - * of supporting developers from this source code or any supporting source code - * which is considered copyrighted (c) material of the original comment or credit authors. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ - * @license http://www.fsf.org/copyleft/gpl.html GNU public license - * @package newbb - * @since 4.0 - * @author Taiwen Jiang <ph...@us...> - * @version $Id: forum.php 2169 2008-09-23 13:37:10Z phppp $ - */ - -if (!defined("XOOPS_ROOT_PATH")) { - exit(); -} - -class Forum extends XoopsObject -{ - - function Forum() - { - $this->__construct(); - } - - - function __construct() - { - $this->XoopsObject(); - $this->initVar('forum_id', XOBJ_DTYPE_INT); - $this->initVar('forum_name', XOBJ_DTYPE_TXTBOX); - $this->initVar('forum_desc', XOBJ_DTYPE_TXTBOX); - $this->initVar('forum_moderator', XOBJ_DTYPE_ARRAY, serialize(array())); - $this->initVar('forum_topics', XOBJ_DTYPE_INT); - $this->initVar('forum_posts', XOBJ_DTYPE_INT); - $this->initVar('forum_last_post_id', XOBJ_DTYPE_INT); - $this->initVar('cat_id', XOBJ_DTYPE_INT); - $this->initVar('parent_forum', XOBJ_DTYPE_INT); - $this->initVar('hot_threshold', XOBJ_DTYPE_INT, 20); - $this->initVar('attach_maxkb', XOBJ_DTYPE_INT, 500); - $this->initVar('attach_ext', XOBJ_DTYPE_SOURCE, "zip|jpg|gif|png"); - $this->initVar('forum_order', XOBJ_DTYPE_INT, 99); - $this->initVar("dohtml", XOBJ_DTYPE_INT, 1); - } - - function disp_forumModerators() - { - global $xoopsModuleConfig; - - $ret = ""; - if (!$valid_moderators = $this->getVar("forum_moderator")) { - return $ret; - } - require_once XOOPS_ROOT_PATH . "/modules/newbb/include/functions.user.php"; - $moderators = newbb_getUnameFromIds($valid_moderators, !empty($xoopsModuleConfig['show_realname']), true); - $ret = implode(", ", $moderators); - return $ret; - } -} - -class NewbbForumHandler extends XoopsPersistableObjectHandler -{ - - function __construct(&$db) - { - parent::__construct($db, "bb_forums", 'Forum', 'forum_id', 'forum_name'); - } - - function NewbbForumHandler(&$db) - { - $this->__construct($db); - } - - - function insert($forum) - { - if (!parent::insert($forum, true)) { - return false; - } - - if ($forum->isNew()) { - $this->applyPermissionTemplate($forum); - } - - return $forum->getVar('forum_id'); - } - - function delete(&$forum) - { - global $xoopsModule; - // RMV-NOTIFY - xoops_notification_deletebyitem ($xoopsModule->getVar('mid'), 'forum', $forum->getVar('forum_id')); - // Get list of all topics in forum, to delete them too - $topic_handler =& xoops_getmodulehandler('topic', 'newbb'); - $topic_handler->deleteAll(new Criteria("forum_id", $forum->getVar('forum_id')), true, true); - $this->updateAll("parent_forum", $forum->getVar('parent_forum'), new Criteria("parent_forum", $forum->getVar('forum_id'))); - $this->deletePermission($forum); - return parent::delete($forum); - } - - function getIdsByPermission($perm = "access") - { - $perm_handler = xoops_getmodulehandler('permission', 'newbb'); - return $perm_handler->getForums($perm); - } - - function &getByPermission($cat = 0, $permission = "access", $tags = null, $asObject = true) - { - $_cachedForums = array(); - if ( !$valid_ids = $this->getIdsByPermission($permission) ) { - return $_cachedForums; - } - - $criteria = new CriteriaCompo( new Criteria("forum_id", "(" . implode(", ", $valid_ids) . ")", "IN") ); - if (is_numeric($cat) && $cat> 0) { - $criteria->add(new Criteria("cat_id", intval($cat))); - } elseif (is_array($cat) && count($cat) >0) { - $criteria->add(new Criteria("cat_id", "(" . implode(", ", $cat) . ")", "IN")); - } - $criteria->setSort("forum_order"); - $criteria->setOrder("ASC"); - $_cachedForums =& $this->getAll($criteria, $tags, $asObject); - return $_cachedForums; - } - - function &getForumsByCategory($categoryid = 0, $permission = "", $asObject = true, $tags = null) - { - $forums =& $this->getByPermission($categoryid, $permission, $tags); - if ($asObject) return $forums; - - $forums_array = array(); - $array_cat=array(); - $array_forum=array(); - if (!is_array($forums)) return array(); - foreach (array_keys($forums) as $forumid) { - $forum =& $forums[$forumid]; - $forums_array[$forum->getVar('parent_forum')][$forumid] = array( - 'cid' => $forum->getVar('cat_id'), - 'title' => $forum->getVar('forum_name') - ); - } - if (!isset($forums_array[0])) { - $ret = array(); - return $ret; - } - foreach ($forums_array[0] as $key => $forum) { - if (isset($forums_array[$key])) { - $forum['sub'] = $forums_array[$key]; - } - $array_forum[$forum['cid']][$key] = $forum; - } - ksort($array_forum); - unset($forums); - unset($forums_array); - return $array_forum; - } - - function getAllTopics(&$forum, $criteria = null) - { - global $xoopsModule, $xoopsConfig, $xoopsModuleConfig, $myts, $xoopsUser, $viewall_forums; - - require_once XOOPS_ROOT_PATH . "/modules/newbb/include/functions.render.php"; - require_once XOOPS_ROOT_PATH . "/modules/newbb/include/functions.session.php"; - require_once XOOPS_ROOT_PATH . "/modules/newbb/include/functions.time.php"; - require_once XOOPS_ROOT_PATH . "/modules/newbb/include/functions.read.php"; - require_once XOOPS_ROOT_PATH . "/modules/newbb/include/functions.topic.php"; - - $criteria_vars = array("startdate", "start", "sort", "order", "type", "status", "excerpt"); - foreach ($criteria_vars as $var) { - ${$var} = $criteria[$var]; - } - - $topic_lastread = newbb_getcookie('LT', true); - - if (is_object($forum)) { - $criteria_forum = ' AND t.forum_id = ' . $forum->getVar('forum_id'); - $hot_threshold = $forum->getVar('hot_threshold'); - } else { - $hot_threshold = 10; - if (is_array($forum) && count($forum) > 0) { - $criteria_forum = ' AND t.forum_id IN (' . implode(',', array_keys($forum)) . ')'; - } elseif (!empty($forum)) { - $criteria_forum = ' AND t.forum_id =' . intval($forum); - } else { - $criteria_forum = ''; - } - } - - $criteria_post = ($startdate) ? ' p.post_time > ' . $startdate : " 1 = 1 "; - $criteria_topic = empty($type) ? '' : " AND t.type_id={$type}"; - $criteria_extra = ''; - $criteria_approve = ' AND t.approved = 1'; - $post_on = ' p.post_id = t.topic_last_post_id'; - $leftjoin = ' LEFT JOIN ' . $this->db->prefix('bb_posts') . ' p ON p.post_id = t.topic_last_post_id'; - $sort_array = array(); - switch ($status) { - case 'digest': - $criteria_extra = ' AND t.topic_digest = 1'; - break; - - case 'unreplied': - $criteria_extra = ' AND t.topic_replies < 1'; - break; - - case 'unread': - if (empty($xoopsModuleConfig["read_mode"])) { - } elseif ($xoopsModuleConfig["read_mode"] ==2) { - $leftjoin .= ' LEFT JOIN ' . $this->db->prefix('bb_reads_topic') . ' r ON r.read_item = t.topic_id'; - $criteria_post .= ' AND (r.read_id IS NULL OR r.post_id < t.topic_last_post_id)'; - } elseif ($xoopsModuleConfig["read_mode"] == 1) { - $topics = array(); - $topic_lastread = newbb_getcookie('LT', true); - if (count($topic_lastread)>0) { - foreach ($topic_lastread as $id => $time) { - if ($time > $time_criterion) $topics[] = $id; - } - } - if (count($topics)>0) { - $criteria_extra = ' AND t.topic_id NOT IN (' . implode(",", $topics) . ')'; - } - if ($lastvisit = max($GLOBALS['last_visit'], $startdate)) { - $criteria_post = ' p.post_time > ' . max($GLOBALS['last_visit'], $startdate); - } - } - break; - - case 'pending': - $post_on = ' p.topic_id = t.topic_id'; - $criteria_post .= ' AND p.pid = 0'; - $criteria_approve = ' AND t.approved = 0'; - break; - - case 'deleted': - $criteria_approve = ' AND t.approved = -1'; - break; - - case 'all': // For viewall.php; do not display sticky topics at first - case 'active': // same as "all" - break; - - default: - if ($startdate > 0) { - $criteria_post = ' (p.post_time > ' . $startdate . ' OR t.topic_sticky=1)'; - } - $sort_array[] = 't.topic_sticky DESC'; - break; - } - - $select = 't.*, ' . - ' p.post_time as last_post_time, p.poster_name as last_poster_name, p.icon, p.post_id, p.uid'; - $from = $this->db->prefix("bb_topics") . ' t ' . $leftjoin; - $where = $criteria_post. $criteria_topic. $criteria_forum . $criteria_extra . $criteria_approve; - - if ($excerpt) { - $select .= ', p.post_karma, p.require_reply, pt.post_text'; - $from .= ' LEFT JOIN ' . $this->db->prefix('bb_posts_text') . ' pt ON pt.post_id = t.topic_last_post_id'; - } - if ($sort == "u.uname") { - $sort = "t.topic_poster"; - } - - $sort_array[] = trim($sort . ' ' . $order); - $sortby = implode(", ", array_filter($sort_array) ); - if (empty($sortby)) $sortby = 't.topic_last_post_id DESC'; - - - $sql = 'SELECT ' . $select . - ' FROM ' . $from . - ' WHERE ' . $where . - ' ORDER BY ' . $sortby; - - if (!$result = $this->db->query($sql, $xoopsModuleConfig['topics_per_page'], $start)) { - redirect_header('index.php', 2, _MD_ERROROCCURED); - exit(); - } - - $sticky = 0; - $topics = array(); - $posters = array(); - $reads = array(); - $types = array(); - - $type_handler =& xoops_getmodulehandler('type', 'newbb'); - $typen = $type_handler->getByForum($forum->getVar('forum_id')); - while ($myrow = $this->db->fetchArray($result)) { - - if ($myrow['topic_sticky']) { - $sticky++; - } - - // ------------------------------------------------------ - // topic_icon: priority: sticky -> digest -> regular - - if ($myrow['topic_haspoll']) { - if ($myrow['topic_sticky']) { - $topic_icon = newbb_displayImage('topic_sticky', _MD_TOPICSTICKY) . '<br />' . newbb_displayImage('poll', _MD_TOPICHASPOLL); - } else { - $topic_icon = newbb_displayImage('poll', _MD_TOPICHASPOLL); - } - } elseif ($myrow['topic_sticky']) { - $topic_icon = newbb_displayImage('topic_sticky', _MD_TOPICSTICKY); - } elseif (!empty($myrow['icon'])) { - $topic_icon = '<img src="' . XOOPS_URL . '/images/subject/' . htmlspecialchars($myrow['icon']) . '" alt="" />'; - } else { - $topic_icon = '<img src="' . XOOPS_URL . '/images/icons/no_posticon.gif" alt="" />'; - } - - // ------------------------------------------------------ - // rating_img - $rating = number_format($myrow['rating'] / 2, 0); - $rating_img = newbb_displayImage( ($rating < 1) ? 'blank' : 'rate' . $rating ); - - // ------------------------------------------------------ - // topic_page_jump - $topic_page_jump = ''; - $topic_page_jump_icon = ''; - $totalpages = ceil(($myrow['topic_replies'] + 1) / $xoopsModuleConfig['posts_per_page']); - if ($totalpages > 1) { - $topic_page_jump .= ' '; - $append = false; - for ($i = 1; $i <= $totalpages; $i++) { - if ($i > 3 && $i < $totalpages) { - if (!$append) { - $topic_page_jump .= "..."; - $append = true; - } - } else { - $topic_page_jump .= '[<a href="' . XOOPS_URL . '/modules/newbb/viewtopic.php?topic_id=' . $myrow['topic_id'] . '&start=' . (($i - 1) * $xoopsModuleConfig['posts_per_page']) . '">' . $i . '</a>]'; - $topic_page_jump_icon = "<a href='" . XOOPS_URL . "/modules/newbb/viewtopic.php?post_id=" . $myrow['post_id'] . "&start=" . (($i - 1) * $xoopsModuleConfig['posts_per_page']) . "'>" . newbb_displayImage('lastposticon',_MD_NEWBB_GOTOLASTPOST) . "</a>"; - } - } - } - else { - $topic_page_jump_icon = "<a href='" . XOOPS_URL . "/modules/newbb/viewtopic.php?post_id=" . $myrow['post_id'] . "'>" . newbb_displayImage('lastposticon',_MD_NEWBB_GOTOLASTPOST) . "</a>"; - } - - // ------------------------------------------------------ - // => topic array - if (!empty($viewall_forums[$myrow['forum_id']])) { - $forum_link = '<a href="' . XOOPS_URL . '/modules/newbb/viewforum.php?forum=' . $myrow['forum_id'] . '">' . $viewall_forums[$myrow['forum_id']]['forum_name'] . '</a>'; - } else { - $forum_link = ''; - } - - $topic_title = $myts->htmlSpecialChars( $myrow['topic_title'] ); - if ($myrow['type_id'] > 0) { - $topic_title = '<font color="'.$typen[$myrow["type_id"]]["type_color"].'">['.$typen[$myrow["type_id"]]["type_name"].']</font> '.$topic_title.''; - } - if ($myrow['topic_digest']) { - $topic_title = "<span class='digest'>" . $topic_title . "</span>"; - } - - if ( $excerpt == 0 ) { - $topic_excerpt = ""; - } elseif ( ($myrow['post_karma'] > 0 || $myrow['require_reply'] > 0) && !newbb_isAdmin($forum) ) { - $topic_excerpt = ""; - } else { - $topic_excerpt = xoops_substr(newbb_html2text($myts->displayTarea($myrow['post_text'])), 0, $excerpt); - $topic_excerpt = str_replace("[", "[", $myts->htmlSpecialChars($topic_excerpt)); - } - - /* users */ - $posters[$myrow['topic_poster']] = 1; - $posters[$myrow['uid']] = 1; - // reads - if (!empty($xoopsModuleConfig["read_mode"])) { - $reads[$myrow['topic_id']] = ($xoopsModuleConfig["read_mode"] == 1) ? $myrow['last_post_time'] : $myrow["topic_last_post_id"]; - } - - $topic_poster = newbb_getUnameFromId($myrow['topic_poster'], $xoopsModuleConfig['show_realname'], true); - $topic_last_poster = newbb_getUnameFromId($myrow['uid'], $xoopsModuleConfig['show_realname'], true); - $topic_isRead = newbb_isRead("topic", $reads); - - $topic_prefix = (!empty($typen[$myrow['type_id']])) ? getTopicTitle("", $typen[$myrow['type_id']]["type_name"], $typen[$myrow['type_id']]["type_color"]) : ""; - - // ------------------------------------------------------ - // topic_folder: priority: newhot -> hot/new -> regular - if ($myrow['topic_status'] == 1) { - $topic_folder = 'topic_locked'; - $topic_folder_text = _MD_TOPICLOCKED; - } else { - if ($myrow['topic_digest']) { - $topic_folder = 'topic_digest'; - $topic_folder_text = _MD_TOPICDIGEST; - } elseif ($myrow['topic_replies'] >= $hot_threshold) { - $topic_folder = empty($topic_isRead[$myrow['topic_id']]) ? 'topic_hot_new' : 'topic_hot'; - $topic_folder_text = empty($topic_isRead[$myrow['topic_id']]) ? _MD_MORETHAN : _MD_MORETHAN2; - } else { - $topic_folder = empty($topic_isRead[$myrow['topic_id']]) ? 'topic_new' : 'topic'; - $topic_folder_text = empty($topic_isRead[$myrow['topic_id']]) ? _MD_NEWPOSTS : _MD_NONEWPOSTS; - } - } - - - $topics[$myrow['topic_id']] = array( - 'topic_id' => $myrow['topic_id'], - 'topic_icon' => $topic_icon, - 'type_id' => $myrow['type_id'], - 'type_text' => $topic_prefix, - 'topic_title' => $topic_title, - //'topic_link' => XOOPS_URL . '/modules/newbb/viewtopic.php?topic_id=' . $myrow['topic_id'], - 'topic_link' => 'viewtopic.php?topic_id=' . $myrow['topic_id'], - 'rating_img' => $rating_img, - 'topic_page_jump' => $topic_page_jump, - 'topic_page_jump_icon' => $topic_page_jump_icon, - 'topic_replies' => $myrow['topic_replies'], - 'topic_poster_uid' => $myrow['topic_poster'], - 'topic_poster_name' => $myts->htmlSpecialChars( ($myrow['poster_name']) ? $myrow['poster_name'] : $xoopsConfig['anonymous'] ), - 'topic_views' => $myrow['topic_views'], - 'topic_time' => newbb_formatTimestamp($myrow['topic_time']), - 'topic_last_posttime' => newbb_formatTimestamp($myrow['last_post_time']), - 'topic_last_poster_uid' => $myrow['uid'], - 'topic_last_poster_name' => $myts->htmlSpecialChars( ($myrow['last_poster_name']) ? $myrow['last_poster_name'] : $xoopsConfig['anonymous'] ), - 'topic_forum_link' => $forum_link, - 'topic_excerpt' => $topic_excerpt, - 'stick' => empty($myrow['topic_sticky']), - //"stats" => array($myrow['topic_status'], $myrow['topic_digest'], $myrow['topic_replies']), - "topic_poster" => $topic_poster, - "topic_last_poster" => $topic_last_poster, - "topic_folder" => newbb_displayImage($topic_folder,$topic_folder_text), - ); - - - } - - if ( count($topics) > 0) { - $sql = " SELECT DISTINCT topic_id FROM " . $this->db->prefix("bb_posts"). - " WHERE attachment != ''" . - " AND topic_id IN (" . implode(',', array_keys($topics)) . ")"; - if ($result = $this->db->query($sql)) { - while (list($topic_id) = $this->db->fetchRow($result)) { - $topics[$topic_id]['attachment'] = ' ' . newbb_displayImage('attachment', _MD_TOPICSHASATT); - } - } - } - return array($topics, $sticky); - } - - function getTopicCount(&$forum, $startdate, $type) - { - global $xoopsModuleConfig; - require_once XOOPS_ROOT_PATH . "/modules/newbb/include/functions.session.php"; - - $criteria_extra = ''; - $criteria_approve = ' AND t.approved = 1'; // any others? - $leftjoin = ' LEFT JOIN ' . $this->db->prefix('bb_posts') . ' p ON p.post_id = t.topic_last_post_id'; - $criteria_post = ' p.post_time > ' . $startdate; - switch ($type) { - case 'digest': - $criteria_extra = ' AND topic_digest = 1'; - break; - case 'unreplied': - $criteria_extra = ' AND topic_replies < 1'; - break; - case 'unread': - if (empty($xoopsModuleConfig["read_mode"])) { - } elseif ($xoopsModuleConfig["read_mode"] ==2) { - $leftjoin .= ' LEFT JOIN ' . $this->db->prefix('bb_reads_topic') . ' r ON r.read_item = t.topic_id'; - $criteria_post .= ' AND (r.read_id IS NULL OR r.post_id < t.topic_last_post_id)'; - } elseif ($xoopsModuleConfig["read_mode"] == 1) { - $criteria_post = ' p.post_time > ' . max($GLOBALS['last_visit'], $startdate); - $topics = array(); - $topic_lastread = newbb_getcookie('LT', true); - if (count($topic_lastread)>0) foreach ($topic_lastread as $id=>$time) { - if ($time > $time_criterion) $topics[] = $id; - } - if (count($topics)>0) { - $criteria_extra = ' AND t.topic_id NOT IN (' . implode(",", $topics) . ')'; - } - } - break; - case 'pending': - $criteria_approve = ' AND t.approved = 0'; - break; - case 'deleted': - $criteria_approve = ' AND t.approved = -1'; - break; - case 'all': - break; - default: - $criteria_post = ' (p.post_time > ' . $startdate . ' OR t.topic_sticky=1)'; - break; - } - if (is_object($forum)) { - $criteria_forum = ' AND t.forum_id = ' . $forum->getVar('forum_id'); - } else { - if (is_array($forum) && count($forum) > 0) { - $criteria_forum = ' AND t.forum_id IN (' . implode(',', array_keys($forum)) . ')'; - } elseif (!empty($forum)) { - $criteria_forum = ' AND t.forum_id =' . intval($forum); - } else { - $criteria_forum = ''; - } - } - - $sql = 'SELECT COUNT(*) as count FROM ' . $this->db->prefix("bb_topics") . ' t ' . $leftjoin; - $sql .= ' WHERE ' . $criteria_post . $criteria_forum . $criteria_extra . $criteria_approve; - if (!$result = $this->db->query($sql)) { - //xoops_error($this->db->error().'<br />'.$sql); - return null; - } - $myrow = $this->db->fetchArray($result); - $count = $myrow['count']; - return $count; - } - - // get permission - function getPermission($forum, $type = "access", $checkCategory = true) - { - global $xoopsUser, $xoopsModule; - static $_cachedPerms; - - if ($type == "all") return true; - if ($GLOBALS["xoopsUserIsAdmin"] && $xoopsModule->getVar("dirname") == "newbb") { - return true; - } - - if (!is_object($forum)) $forum =& $this->get($forum); - - if (!empty($checkCategory)) { - $category_handler =& xoops_getmodulehandler('category', 'newbb'); - $categoryPerm = $category_handler->getPermission($forum->getVar('cat_id')); - if (!$categoryPerm) return false; - } - - $type = strtolower($type); - if ("moderate" == $type) { - require_once XOOPS_ROOT_PATH . "/modules/newbb/include/functions.user.php"; - $permission = newbb_isModerator($forum); - } else { - $forum_id = $forum->getVar('forum_id'); - $perm_handler =& xoops_getmodulehandler('permission', 'newbb'); - $permission = $perm_handler->getPermission("forum", $type, $forum_id); - } - return $permission; - } - - function deletePermission(&$forum) - { - $perm_handler =& xoops_getmodulehandler('permission', 'newbb'); - return $perm_handler->deleteByForum($forum->getVar("forum_id")); - } - - function applyPermissionTemplate(&$forum) - { - $perm_handler =& xoops_getmodulehandler('permission', 'newbb'); - return $perm_handler->applyTemplate($forum->getVar("forum_id")); - } - - /* - function isForum($forum) - { - $count = false; - $sql = 'SELECT COUNT(*) as count FROM ' . $this->db->prefix("bb_forums"); - $sql .= ' WHERE forum_id=' . $forum ; - if ($result = $this->db->query($sql)) { - $myrow = $this->db->fetchArray($result); - $count = $myrow['count']; - } - return $count; - } - */ - - /** - * clean orphan items from database - * - * @return bool true on success - */ - function cleanOrphan() - { - parent::cleanOrphan($this->db->prefix("bb_categories"), "cat_id"); - - if (version_compare( mysql_get_server_info(), "4.1.0", "ge" )): - /* - $sql = "DELETE FROM ".$this->table. - " WHERE (parent_forum >0 AND parent_forum NOT IN ( SELECT DISTINCT forum_id FROM ".$this->table.") )"; - */ - $sql = " DELETE {$this->table} FROM {$this->table}" . - " LEFT JOIN {$this->table} AS aa ON {$this->table}.parent_forum = aa.forum_id ". - " WHERE {$this->table}.parent_forum>0 AND (aa.forum_id IS NULL)"; - if (!$result = $this->db->queryF($sql)): - //xoops_error("cleanOrphan error:". $sql); - endif; - else: - $this->identifierName = "parent_forum"; - $forum_list = $this->getList(new Criteria("parent_forum", 0, ">")); - $this->identifierName = "forum_name"; - if ($parent_forums = @array_values($forum_list)) { - $parent_list = $this->getIds(new Criteria("forum_id", "(" . implode(", ", $parent_forums) . ")", "IN")); - foreach ($forum_list as $forum_id => $parent_forum) { - if (in_array($parent_forum, $parent_list)) continue; - $forum_obj =& $this->get($forum_id); - $this->delete($forum_obj); - unset($forum_obj); - } - } - endif; - ... [truncated message content] |
From: <ir...@us...> - 2012-08-26 08:22:15
|
Revision: 10118 http://xoops.svn.sourceforge.net/xoops/?rev=10118&view=rev Author: irmtfan Date: 2012-08-26 08:22:06 +0000 (Sun, 26 Aug 2012) Log Message: ----------- merge with alfred rev.10109, bug fix in polls.php, better style.css localization Modified Paths: -------------- XoopsModules/newbb/branches/irmtfan/newbb/docs/changelog.txt XoopsModules/newbb/branches/irmtfan/newbb/header.php XoopsModules/newbb/branches/irmtfan/newbb/polls.php XoopsModules/newbb/branches/irmtfan/newbb/print.php XoopsModules/newbb/branches/irmtfan/newbb/seo.php XoopsModules/newbb/branches/irmtfan/newbb/votepolls.php Added Paths: ----------- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt Added: XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt (rev 0) +++ XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt 2012-08-26 08:22:06 UTC (rev 10118) @@ -0,0 +1,10 @@ +date: 2012-08-26 +================================================ +1- merge with alfred. +newbb/votepolls.php, newbb/polls.php, newbb/print.php, newbb/seo.php + +2- bug in getting $op and typo: addmor -> addmore +newbb/polls.php + +3- better method for getting the customize/localize newbb style.css +newbb/header.php \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/docs/changelog.txt =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/docs/changelog.txt 2012-08-25 20:35:24 UTC (rev 10117) +++ XoopsModules/newbb/branches/irmtfan/newbb/docs/changelog.txt 2012-08-26 08:22:06 UTC (rev 10118) @@ -1,6 +1,6 @@ newBB Changelog 4.3 -08/17/2012 +08/25/2012 =========================================== 1 Fix Cache Config for SEO 2 Fix Typos in templates @@ -26,6 +26,10 @@ 22 Fix vulnerabilities in seo.php 23 Add enable/disable all editmessage in posts 24 Fix hardcoded Path for icon (irmtfan) +25 Fix print hardcodes removed (irmtfan) +26 NEW local stylesheet (xoops_header) in print.php +27 Fix error in newbb/polls.php when the strtotime is not defined in XoopsLocal class (irmtfan) +28 Fix using header php command instead of redirect_header XOOPS function (deka87/irmtfan) in newbb/search.php newBB Changelog 4.2 Modified: XoopsModules/newbb/branches/irmtfan/newbb/header.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/header.php 2012-08-25 20:35:24 UTC (rev 10117) +++ XoopsModules/newbb/branches/irmtfan/newbb/header.php 2012-08-26 08:22:06 UTC (rev 10118) @@ -1,140 +1,128 @@ -<?php -/** - * CBB 4.0, or newbb, the forum module for XOOPS project - * - * @copyright The XOOPS Project http://xoops.sf.net - * @license http://www.fsf.org/copyleft/gpl.html GNU public license - * @author Taiwen Jiang (phppp or D.J.) <ph...@us...> - * @since 4.00 - * @version $Id$ - * @package module::newbb - */ -include_once '../../mainfile.php'; -defined('XOOPS_ROOT_PATH') or die('Restricted access'); -$xoopsLogger->startTime('newBB_Header'); - -if (!empty($xoopsModuleConfig['do_rewrite'])) { - include_once "seo_url.php"; - /* for seo */ - $toseo_url = array("index.php","viewforum.php","viewtopic.php","rss.php"); - - if(((strpos(getenv('REQUEST_URI'), '.html') === false) && !empty($xoopsModuleConfig['do_rewrite']) && (!isset($_POST) || count($_POST) <= 0))) - { - $redir = false; - if ( strpos(getenv("REQUEST_URI"),"mark_read=") == true || strpos(getenv("REQUEST_URI"),"mark=") == true) { - // Mark Forums - } else { - if ( in_array(basename(getenv('SCRIPT_NAME')),$toseo_url) ) { - //rewrite only for files - - if ( trim(getenv("SCRIPT_NAME")) != '' ) { - if ( strpos(getenv("REQUEST_URI") , "/".SEO_MODULE_NAME."/") === false ) { - $redir = true; - } else if ( getenv("QUERY_STRING") ) { - $redir = true; - } - } - } - } - - if ($redir == true) { - $s = "http://" . getenv('HTTP_HOST') . getenv("REQUEST_URI"); - $s = str_replace("/".REAL_MODULE_NAME."/","/".SEO_MODULE_NAME."/",$s); - $newurl = seo_urls('<a href="'.$s.'"></a>'); - $newurl = str_replace('<a href="','',$newurl); - $newurl = str_replace('"></a>','',$newurl); - if ( !headers_sent() ) { - header("HTTP/1.1 301 Moved Permanently"); - header("Location: $newurl"); - exit(); - } - } - } -} - -include_once XOOPS_ROOT_PATH."/modules/".$xoopsModule->getVar("dirname")."/include/vars.php"; - -mod_loadFunctions("user", "newbb"); -mod_loadFunctions("topic", "newbb"); - -require_once XOOPS_ROOT_PATH."/class/xoopsformloader.php"; -require_once XOOPS_ROOT_PATH."/class/module.textsanitizer.php"; -$myts = MyTextSanitizer::getInstance(); - -$menumode = 0; -$menumode_other = array(); -$menu_url = htmlSpecialChars(preg_replace("/&menumode=[^&]/", "", $_SERVER[ 'REQUEST_URI' ])); -$menu_url .= ( false === strpos($menu_url, "?") ) ? "?menumode=" : "&menumode="; -foreach ($xoopsModuleConfig["valid_menumodes"] as $key => $val) { - if ($key != $menumode) $menumode_other[] = array("title"=>$val, "link"=>$menu_url.$key); -} - - -$newbb_module_header = ''; -$newbb_module_header .= '<link rel="alternate" type="application/rss+xml" title="'.$xoopsModule->getVar("name").'" href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', "n").'/rss.php" />'; -if (!empty($xoopsModuleConfig['pngforie_enabled'])) { - $newbb_module_header .= '<style type="text/css">img {behavior:url("include/pngbehavior.htc");}</style>'; -} -// START hacked by irmtfan to add localization/customization for newbb style.css -$dirname=$xoopsModule->getVar('dirname'); -$theme_path = "{$xoopsConfig['theme_set']}/modules/{$dirname}"; -$theme_default_path= "default/modules/{$dirname}"; -$default_path = "modules/{$dirname}/templates"; -$lang_path = "images/language/{$xoopsConfig['language']}"; - - // get from setted theme -if (is_file(XOOPS_THEME_PATH . '/'.$theme_path . '/' . $lang_path . '/style.css')) { - $rel_path=$theme_path . '/' . $lang_path; - // get from default theme -} else if (is_file(XOOPS_THEME_PATH . '/'.$theme_default_path . '/' . $lang_path . '/style.css')) { - $rel_path=$theme_default_path . '/' . $lang_path; - // get from module default path -} else if (is_file(XOOPS_ROOT_PATH. '/'.$default_path . '/' . $lang_path . '/style.css')) { - $rel_path=$default_path . '/' . $lang_path; - // if no one is found get the english from default path -} else if (is_file(XOOPS_ROOT_PATH. '/'.$default_path . '/images/language/english/style.css')) { - $rel_path=$default_path . '/images/language/english'; - // for backward compatibility - as before -} else { - $rel_path=$default_path; -} - -$newbb_module_header .= ' - <link rel="stylesheet" type="text/css" href="'.XOOPS_URL . '/' . $rel_path . '/style.css" /> - <script type="text/javascript">var toggle_cookie="'.$forumCookie['prefix'].'G'.'";</script> - <script src="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar("dirname").'/include/js/newbb_toggle.js" type="text/javascript"></script> - '; -// END hacked by irmtfan to add localization/customization for newbb style.css -if ($menumode == 2) { - $newbb_module_header .= ' - <link rel="stylesheet" type="text/css" href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar("dirname").'templates/newbb_menu_hover.css" /> - <style type="text/css">body {behavior:url("include/newbb.htc");}</style> - '; -} - -if ($menumode == 1) { - $newbb_module_header .= ' - <link rel="stylesheet" type="text/css" href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar("dirname").'templates/newbb_menu_click.css" /> - <script src="include/js/newbb_menu_click.js" type="text/javascript"></script> - '; -} - -$xoops_module_header = $newbb_module_header; // for cache hack - -if (!empty($xoopsModuleConfig["welcome_forum"]) && is_object($xoopsUser) && !$xoopsUser->getVar('posts')) { - mod_loadFunctions("welcome", "newbb"); -} - -$pollmodules = NULL; -//$module_handler = &xoops_gethandler('module'); -$xoopspoll = &$module_handler->getByDirname('xoopspoll'); -if (is_object($xoopspoll) && $xoopspoll->getVar('isactive')) { - $pollmodules = 'xoopspoll'; -} else { - //Umfrage - $xoopspoll = &$module_handler->getByDirname('umfrage'); - if (is_object($xoopspoll) && $xoopspoll->getVar('isactive')) - $pollmodules = 'umfrage'; -} -$xoopsLogger->stopTime('newBB_Header'); +<?php +/** + * CBB 4.0, or newbb, the forum module for XOOPS project + * + * @copyright The XOOPS Project http://xoops.sf.net + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @author Taiwen Jiang (phppp or D.J.) <ph...@us...> + * @since 4.00 + * @version $Id$ + * @package module::newbb + */ +include_once '../../mainfile.php'; +defined('XOOPS_ROOT_PATH') or die('Restricted access'); +$xoopsLogger->startTime('newBB_Header'); +// irmtfan assign newbb dirname then replace all. include xoops header.php +$dirname = $xoopsModule->getVar("dirname"); +include_once XOOPS_ROOT_PATH . "/header.php"; + +if (!empty($xoopsModuleConfig['do_rewrite'])) { + include_once "seo_url.php"; + /* for seo */ + $toseo_url = array("index.php","viewforum.php","viewtopic.php","rss.php"); + + if(((strpos(getenv('REQUEST_URI'), '.html') === false) && !empty($xoopsModuleConfig['do_rewrite']) && (!isset($_POST) || count($_POST) <= 0))) + { + $redir = false; + if ( strpos(getenv("REQUEST_URI"),"mark_read=") == true || strpos(getenv("REQUEST_URI"),"mark=") == true) { + // Mark Forums + } else { + if ( in_array(basename(getenv('SCRIPT_NAME')),$toseo_url) ) { + //rewrite only for files + + if ( trim(getenv("SCRIPT_NAME")) != '' ) { + if ( strpos(getenv("REQUEST_URI") , "/".SEO_MODULE_NAME."/") === false ) { + $redir = true; + } else if ( getenv("QUERY_STRING") ) { + $redir = true; + } + } + } + } + + if ($redir == true) { + $s = "http://" . getenv('HTTP_HOST') . getenv("REQUEST_URI"); + $s = str_replace("/".REAL_MODULE_NAME."/","/".SEO_MODULE_NAME."/",$s); + $newurl = seo_urls('<a href="'.$s.'"></a>'); + $newurl = str_replace('<a href="','',$newurl); + $newurl = str_replace('"></a>','',$newurl); + if ( !headers_sent() ) { + header("HTTP/1.1 301 Moved Permanently"); + header("Location: $newurl"); + exit(); + } + } + } +} + +include_once XOOPS_ROOT_PATH."/modules/".$dirname."/include/vars.php"; + +mod_loadFunctions("user", $dirname); +mod_loadFunctions("topic", $dirname); + +require_once XOOPS_ROOT_PATH."/class/xoopsformloader.php"; +require_once XOOPS_ROOT_PATH."/class/module.textsanitizer.php"; +$myts = MyTextSanitizer::getInstance(); + +$menumode = 0; +$menumode_other = array(); +$menu_url = htmlSpecialChars(preg_replace("/&menumode=[^&]/", "", $_SERVER[ 'REQUEST_URI' ])); +$menu_url .= ( false === strpos($menu_url, "?") ) ? "?menumode=" : "&menumode="; +foreach ($xoopsModuleConfig["valid_menumodes"] as $key => $val) { + if ($key != $menumode) $menumode_other[] = array("title"=>$val, "link"=>$menu_url.$key); +} + + +$newbb_module_header = ''; +$newbb_module_header .= '<link rel="alternate" type="application/rss+xml" title="'.$xoopsModule->getVar("name").'" href="'.XOOPS_URL.'/modules/'.$dirname.'/rss.php" />'; +if (!empty($xoopsModuleConfig['pngforie_enabled'])) { + $newbb_module_header .= '<style type="text/css">img {behavior:url("include/pngbehavior.htc");}</style>'; +} +// START hacked by irmtfan to add localization/customization for newbb style.css +mod_loadFunctions("render", $dirname); +$icon_handler = newbb_getIconHandler(); +// get from setted language +$rel_path=$icon_handler->getPath("language/" . $xoopsConfig['language'], $dirname ,"language/english"); +if (!file_exists(XOOPS_ROOT_PATH . $rel_path . '/style.css')) { + // for backward compatibility - as before + $rel_path="/modules/" . $dirname . "/templates"; +} +$newbb_module_header .= ' + <link rel="stylesheet" type="text/css" href="'.XOOPS_URL . $rel_path . '/style.css" /> + <script type="text/javascript">var toggle_cookie="'.$forumCookie['prefix'].'G'.'";</script> + <script src="'.XOOPS_URL.'/modules/'.$dirname.'/include/js/newbb_toggle.js" type="text/javascript"></script> + '; +// END hacked by irmtfan to add localization/customization for newbb style.css +if ($menumode == 2) { + $newbb_module_header .= ' + <link rel="stylesheet" type="text/css" href="'.XOOPS_URL.'/modules/'.$dirname.'templates/newbb_menu_hover.css" /> + <style type="text/css">body {behavior:url("include/newbb.htc");}</style> + '; +} + +if ($menumode == 1) { + $newbb_module_header .= ' + <link rel="stylesheet" type="text/css" href="'.XOOPS_URL.'/modules/'.$dirname.'templates/newbb_menu_click.css" /> + <script src="include/js/newbb_menu_click.js" type="text/javascript"></script> + '; +} + +$xoops_module_header = $newbb_module_header; // for cache hack + +if (!empty($xoopsModuleConfig["welcome_forum"]) && is_object($xoopsUser) && !$xoopsUser->getVar('posts')) { + mod_loadFunctions("welcome", $dirname); +} + +$pollmodules = NULL; +//$module_handler = &xoops_gethandler('module'); +$xoopspoll = &$module_handler->getByDirname('xoopspoll'); +if (is_object($xoopspoll) && $xoopspoll->getVar('isactive')) { + $pollmodules = 'xoopspoll'; +} else { + //Umfrage + $xoopspoll = &$module_handler->getByDirname('umfrage'); + if (is_object($xoopspoll) && $xoopspoll->getVar('isactive')) + $pollmodules = 'umfrage'; +} +$xoopsLogger->stopTime('newBB_Header'); ?> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/polls.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/polls.php 2012-08-25 20:35:24 UTC (rev 10117) +++ XoopsModules/newbb/branches/irmtfan/newbb/polls.php 2012-08-26 08:22:06 UTC (rev 10118) @@ -1,583 +1,588 @@ -<?php -/** - * Newbb module - * - * You may not change or alter any portion of this comment or credits - * of supporting developers from this source code or any supporting source code - * which is considered copyrighted (c) material of the original comment or credit authors. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ - * @license http://www.fsf.org/copyleft/gpl.html GNU public license - * @package newbb - * @since 4.0 - * @author Taiwen Jiang <ph...@us...> - * @version $Id: polls.php 2175 2008-09-23 14:07:03Z phppp $ - */ - - -include_once dirname(__FILE__) . "/header.php"; - -include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php"; -include_once XOOPS_ROOT_PATH . "/class/xoopslists.php"; -include_once XOOPS_ROOT_PATH . "/class/xoopsblock.php"; - -if ( $pollmodules == 'xoopspoll') -{ - include XOOPS_ROOT_PATH . "/modules/xoopspoll/include/constants.php"; - include_once XOOPS_ROOT_PATH . "/modules/xoopspoll/class/xoopspoll.php"; - include_once XOOPS_ROOT_PATH . "/modules/xoopspoll/class/xoopspolloption.php"; - include_once XOOPS_ROOT_PATH . "/modules/xoopspoll/class/xoopspolllog.php"; - include_once XOOPS_ROOT_PATH . "/modules/xoopspoll/class/xoopspollrenderer.php"; -} -elseif ($pollmodules == 'umfrage') -{ - include XOOPS_ROOT_PATH."/modules/umfrage/include/constants.php"; - include_once XOOPS_ROOT_PATH."/modules/umfrage/class/umfrage.php"; - include_once XOOPS_ROOT_PATH."/modules/umfrage/class/umfrageoption.php"; - include_once XOOPS_ROOT_PATH."/modules/umfrage/class/umfragelog.php"; - include_once XOOPS_ROOT_PATH."/modules/umfrage/class/umfragerenderer.php"; -} -else -{ - redirect_header("javascript:history.go(-1);", 2, _MD_POLLMODULE_ERROR); - exit(); -} - -$op = "add"; -if (isset($_GET['op'])) $op = $_GET['op']; -if (isset($_POST['op'])) $op = $_POST['op']; -if (isset($_GET['poll_id'])) $poll_id = intval($_GET['poll_id']); -if (isset($_POST['poll_id'])) $poll_id = intval($_POST['poll_id']); -if (isset($_GET['topic_id'])) $topic_id = intval($_GET['topic_id']); -if (isset($_POST['topic_id'])) $topic_id = intval($_POST['topic_id']); - -if (!isset($module_handler)) $module_handler =& xoops_gethandler('module'); -$xoopspoll =& $module_handler->getByDirname($pollmodules); -if (!is_object($xoopspoll) || !$xoopspoll->getVar('isactive')) { - redirect_header("javascript:history.go(-1);", 2, _MD_POLLMODULE_ERROR); - exit(); -} - -include XOOPS_ROOT_PATH . "/header.php"; - -$topic_handler =& xoops_getmodulehandler('topic', 'newbb'); -$topic_obj =& $topic_handler->get($topic_id); -$forum = $topic_obj->getVar('forum_id'); -$forum_handler =& xoops_getmodulehandler('forum', 'newbb'); -$forum_obj =& $forum_handler->get($forum); -if (!$forum_handler->getPermission($forum_obj)) { - redirect_header("index.php", 2, _MD_NORIGHTTOACCESS); - exit(); -} -if (!$topic_handler->getPermission($forum_obj, $topic_obj->getVar('topic_status'), "view")) { - redirect_header("viewforum.php?forum=" . $forum_obj->getVar('forum_id'), 2, _MD_NORIGHTTOVIEW); - exit(); -} - -$isadmin = newbb_isAdmin($forum_obj); -$perm = false; -if ($isadmin) { - $perm = true; -} elseif ($topic_handler->getPermission($forum_obj, $topic_obj->getVar('topic_status'), "addpoll") - //&& $forum_obj->getVar('allow_polls') == 1 -) { - if ( ($op=="add" || $op=="save") && !$topic_obj->getVar("topic_haspoll") && is_object($xoopsUser) && $xoopsUser->getVar("uid") == $topic_obj->getVar("topic_poster") ) { - $perm = true; - } elseif (!empty($poll_id)) { - $poll = new XoopsPoll($poll_id); - if (is_object($xoopsUser) && $xoopsUser->getVar("uid") == $poll->getVar("user_id")) { - $perm = true; - } - } -} -if (!$perm) { - redirect_header("viewtopic.php?topic_id=" . $topic_id, 2, _NOPERM); -} - -if ( $op == "add" ) { - $poll_form = new XoopsThemeForm(_MD_POLL_CREATNEWPOLL, "poll_form", "polls.php"); - - $question_text = new XoopsFormText(_MD_POLL_POLLQUESTION, "question", 50, 255); - $poll_form->addElement($question_text, true); - - $desc_tarea = new XoopsFormTextarea(_MD_POLL_POLLDESC, "description"); - $poll_form->addElement($desc_tarea); - - $currenttime = formatTimestamp(time(), "Y-m-d H:i:s"); - $endtime = formatTimestamp(time() + 604800, "Y-m-d H:i:s"); - $expire_text = new XoopsFormText(_MD_POLL_EXPIRATION . "<br /><small>" . _MD_POLL_FORMAT . "<br />" . sprintf(_MD_POLL_CURRENTTIME, $currenttime) . "</small>", "end_time", 30, 19, $endtime); - $poll_form->addElement($expire_text); - - $weight_text = new XoopsFormText(_MD_POLL_DISPLAYORDER, "weight", 6, 5, 0); - $poll_form->addElement($weight_text); - - $multi_yn = new XoopsFormRadioYN(_MD_POLL_ALLOWMULTI, "multiple", 0); - $poll_form->addElement($multi_yn); - - $notify_yn = new XoopsFormRadioYN(_MD_POLL_NOTIFY, "notify", 1); - $poll_form->addElement($notify_yn); - - $option_tray = new XoopsFormElementTray(_MD_POLL_POLLOPTIONS, ""); - $barcolor_array = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . "/modules/".$pollmodules."/images/colorbars/"); - for($i = 0; $i < 10; $i++) { - $current_bar = (current($barcolor_array) != "blank.gif") ? current($barcolor_array) : next($barcolor_array); - $option_text = new XoopsFormText("", "option_text[]", 50, 255); - $option_tray->addElement($option_text); - $color_select = new XoopsFormSelect("", "option_color[{$i}]", $current_bar); - $color_select->addOptionArray($barcolor_array); - $color_select->setExtra("onchange='showImgSelected(\"option_color_image[{$i}]\", \"option_color[{$i}]\", \"modules/".$pollmodules."/images/colorbars\", \"\", \"" . XOOPS_URL . "\")'"); - $color_label = new XoopsFormLabel("", "<img src='" . XOOPS_URL . "/modules/".$pollmodules."/images/colorbars/" . $current_bar . "' name='option_color_image[{$i}]' id='option_color_image[{$i}]' width='30' align='bottom' height='15' alt='' /><br />"); - $option_tray->addElement($color_select); - $option_tray->addElement($color_label); - if ( !next($barcolor_array) ) { - reset($barcolor_array); - } - unset($color_select, $color_label); - } - $poll_form->addElement($option_tray); - - $submit_button = new XoopsFormButton("", "poll_submit", _SUBMIT, "submit"); - $poll_form->addElement($submit_button); - $op_hidden = new XoopsFormHidden("op", "save"); - $poll_form->addElement($op_hidden); - $poll_topic_id_hidden = new XoopsFormHidden("topic_id", $topic_id); - $poll_form->addElement($poll_topic_id_hidden); - //include XOOPS_ROOT_PATH . "/header.php"; - echo "<h4>" . _MD_POLL_POLLCONF . "</h4>"; - $poll_form->display(); - //include XOOPS_ROOT_PATH . "/footer.php"; - //exit(); -} - -if ( $op == "save" ) { - /* - * The option check should be done before submitting - */ - $option_empty = true; - if (empty($_POST['option_text'])) { - redirect_header("javascript:history.go(-1);", 2, _MD_ERROROCCURED . ': ' . _MD_POLL_POLLOPTIONS . ' !'); - } - $option_text = $_POST['option_text']; - foreach ( $option_text as $optxt ) { - if ( trim($optxt) != "" ) { - $option_empty = false; - break; - } - } - if ($option_empty) { - redirect_header("javascript:history.go(-1);", 2, _MD_ERROROCCURED . ': ' . _MD_POLL_POLLOPTIONS . ' !'); - } - if ( $pollmodules == 'xoopspoll') - $poll = new XoopsPoll(); - else if ( $pollmodules == 'umfrage') - $poll = new Umfrage(); - else die("POLL-ERROR: polls.php Line 190"); - $poll->setVar("question", @$_POST['question']); - $poll->setVar("description", @$_POST['description']); - if ( !empty($_POST['end_time']) ) { - $timezone = is_object($xoopsUser) ? $xoopsUser->getVar("timezone") : null; -// Start user input time in hegira date - hacked by irmtfan (www.jadoogaran.org) -// $_POST['end_time']=inputTimeToGregorian($_POST['end_time']); -// if method is not exist use the original strtotime function - $poll->setVar("end_time", userTimeToServerTime(method_exists('XoopsLocal', 'strtotime') ? XoopsLocal::strtotime($_POST['end_time']) : strtotime($_POST['end_time']), $timezone)); -// End user input time in hegira date - hacked by irmtfan (www.jadoogaran.org) - } else { - // if expiration date is not set, set it to 10 days from now - $poll->setVar("end_time", time() + (86400 * 10)); - } - $poll->setVar("display", 0); - $poll->setVar("weight", intval(@$_POST['weight'])); - $poll->setVar("multiple", intval(@$_POST['multiple'])); - if ( !empty($_POST["notify"]) ) { - // if notify, set mail status to "not mailed" - $poll->setVar("mail_status", POLL_NOTMAILED); - } else { - // if not notify, set mail status to already "mailed" - $poll->setVar("mail_status", POLL_MAILED); - } - $uid = is_object($xoopsUser) ? $xoopsUser->getVar("uid") : 0; - $poll->setVar("user_id", $uid); - $new_poll_id = $poll->store(); - $option_color = empty($_POST['option_color']) ? NULL : $_POST['option_color']; - if ( !empty($new_poll_id) ) { - $i = 0; - foreach ( $option_text as $optxt ) { - $optxt = trim($optxt); - if ( $optxt != "" ) { - if ( $pollmodules == 'xoopspoll') - $option = new XoopsPollOption(); - else if ( $pollmodules == 'umfrage') - $option = new UmfrageOption(); - else die("POLL-ERROR: polls.php Line 223"); - $option->setVar("option_text", $optxt); - $option->setVar("option_color", $option_color[$i]); - $option->setVar("poll_id", $new_poll_id); - $option->store(); - } - $i++; - } - $sql = "UPDATE " . $xoopsDB->prefix("bb_topics") . " SET topic_haspoll = 1, poll_id = {$new_poll_id} WHERE topic_id = {$topic_id}"; - if ( !$result = $xoopsDB->query($sql) ) { - xoops_error($xoopsDB->error()); - } - include_once XOOPS_ROOT_PATH . '/class/template.php'; - xoops_template_clear_module_cache($xoopsModule->getVar('mid')); - } else { - xoops_error($poll->getHtmlErrors()); - exit(); - } - redirect_header("viewtopic.php?topic_id={$topic_id}",1,_MD_POLL_DBUPDATED); - //exit(); -} - -if ( $op == "edit" ) { - $pollid = intval($_GET['poll_id']); - if ( $pollmodules == 'xoopspoll') - $poll = new XoopsPoll($pollid); - else if ( $pollmodules == 'umfrage') - $poll = new Umfrage($pollid); - $poll_form = new XoopsThemeForm(_MD_POLL_EDITPOLL, "poll_form", "polls.php"); - $author_label = new XoopsFormLabel(_MD_POLL_AUTHOR, "<a href='" . XOOPS_URL . "/userinfo.php?uid=" . $poll->getVar("user_id") . "'>" . newbb_getUnameFromId($poll->getVar("user_id"), $xoopsModuleConfig['show_realname']) . "</a>"); - $poll_form->addElement($author_label); - $question_text = new XoopsFormText(_MD_POLL_POLLQUESTION, "question", 50, 255, $poll->getVar("question", "E")); - $poll_form->addElement($question_text); - $desc_tarea = new XoopsFormTextarea(_MD_POLL_POLLDESC, "description", $poll->getVar("description", "E")); - $poll_form->addElement($desc_tarea); - $date = formatTimestamp($poll->getVar("end_time"), "Y-m-d H:i:s"); - if ( !$poll->hasExpired() ) { - $expire_text = new XoopsFormText(_MD_POLL_EXPIRATION . "<br /><small>" . _MD_POLL_FORMAT . "<br />" . sprintf(_MD_POLL_CURRENTTIME, formatTimestamp(time(), "Y-m-d H:i:s")) . "</small>", "end_time", 20, 19, $date); - $poll_form->addElement($expire_text); - } else { - $restart_label = new XoopsFormLabel(_MD_POLL_EXPIRATION, sprintf(_MD_POLL_EXPIREDAT, $date) . "<br /><a href='polls.php?op=restart&poll_id=" . $poll->getVar("poll_id") . "'>" . _MD_POLL_RESTART . "</a>"); - $poll_form->addElement($restart_label); - } - $weight_text = new XoopsFormText(_MD_POLL_DISPLAYORDER, "weight", 6, 5, $poll->getVar("weight")); - $poll_form->addElement($weight_text); - $multi_yn = new XoopsFormRadioYN(_MD_POLL_ALLOWMULTI, "multiple", $poll->getVar("multiple")); - $poll_form->addElement($multi_yn); - if ( $pollmodules == 'xoopspoll') - $options_arr = XoopsPollOption::getAllByPollId($poll->getVar("poll_id")); - else - $options_arr =& UmfrageOption::getAllByPollId($poll->getVar("poll_id")); - $notify_value = 1; - if ( $poll->getVar("mail_status") != 0 ) { - $notify_value = 0; - } - $notify_yn = new XoopsFormRadioYN(_MD_POLL_NOTIFY, "notify", $notify_value); - $poll_form->addElement($notify_yn); - $option_tray = new XoopsFormElementTray(_MD_POLL_POLLOPTIONS, ""); - $barcolor_array = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . "/modules/".$pollmodules."/images/colorbars/"); - $i = 0; - foreach ($options_arr as $option) { - $option_text = new XoopsFormText("", "option_text[]", 50, 255, $option->getVar("option_text")); - $option_tray->addElement($option_text); - $option_id_hidden = new XoopsFormHidden("option_id[]", $option->getVar("option_id")); - $option_tray->addElement($option_id_hidden); - $color_select = new XoopsFormSelect("", "option_color[{$i}]", $option->getVar("option_color")); - $color_select->addOptionArray($barcolor_array); - $color_select->setExtra("onchange='showImgSelected(\"option_color_image[{$i}]\", \"option_color[".$i."]\", \"modules/".$pollmodules."/images/colorbars\", \"\", \"" . XOOPS_URL . "\")'"); - $color_label = new XoopsFormLabel("", "<img src='" . XOOPS_URL . "/modules/".$pollmodules."/images/colorbars/" . $option->getVar("option_color", "E") . "' name='option_color_image[{$i}]' id='option_color_image[{$i}]' width='30' align='bottom' height='15' alt='' /><br />"); - $option_tray->addElement($color_select); - $option_tray->addElement($color_label); - unset($color_select, $color_label, $option_id_hidden, $option_text); - $i++; - } - $more_label = new XoopsFormLabel("", "<br /><a href='polls.php?op=addmore&poll_id=" . $poll->getVar("poll_id") . "&topic_id=" . $topic_id . "'>" . _MD_POLL_ADDMORE . "</a>"); - $option_tray->addElement($more_label); - $poll_form->addElement($option_tray); - $op_hidden = new XoopsFormHidden("op", "update"); - $poll_form->addElement($op_hidden); - $poll_topic_id_hidden = new XoopsFormHidden("topic_id", $topic_id); - $poll_form->addElement($poll_topic_id_hidden); - $poll_id_hidden = new XoopsFormHidden("poll_id", $poll->getVar("poll_id")); - $poll_form->addElement($poll_id_hidden); - $submit_button = new XoopsFormButton("", "poll_submit", _SUBMIT, "submit"); - $poll_form->addElement($submit_button); - //include XOOPS_ROOT_PATH . "/header.php"; - echo "<h4>" . _MD_POLL_POLLCONF . "</h4>"; - $poll_form->display(); - //include XOOPS_ROOT_PATH . "/footer.php"; - //exit(); -} - -if ( $op == "update" ) { - $option_empty = true; - if (empty($_POST['option_text'])) { - redirect_header("javascript:history.go(-1);", 2, _MD_ERROROCCURED . ': ' . _MD_POLL_POLLOPTIONS . ' !'); - } - $option_text = $_POST['option_text']; - foreach ( $option_text as $optxt ) { - if ( trim($optxt) != "" ) { - $option_empty = false; - break; - } - } - if ($option_empty) redirect_header("javascript:history.go(-1);", 2, _MD_ERROROCCURED . ': ' . _MD_POLL_POLLOPTIONS . ' !'); - - if ( $pollmodules == 'xoopspoll') - $poll = new XoopsPoll($poll_id); - else - $poll = new Umfrage($poll_id); - $poll->setVar("question", @$_POST['question']); - $poll->setVar("description", @$_POST['description']); - $end_time = (empty($_POST['end_time'])) ? "" : $_POST['end_time']; - if ( !empty($end_time) ) { - $timezone = is_object($xoopsUser) ? $xoopsUser->getVar("timezone") : null; -// Start user input time in hegira date - hacked by irmtfan (www.jadoogaran.org) -// $end_time=inputTimeToGregorian($end_time); -// if method is not exist use the original strtotime function - $poll->setVar("end_time", userTimeToServerTime(method_exists('XoopsLocal', 'strtotime') ? XoopsLocal::strtotime($end_time) : strtotime($end_time), $timezone)); -// End user input time in hegira date - hacked by irmtfan (www.jadoogaran.org) - - } - $poll->setVar("display", 0); - $poll->setVar("weight", intval(@$_POST['weight'])); - $poll->setVar("multiple", intval(@$_POST['multiple'])); - if ( !empty($_POST["notify"]) && $end_time > time() ) { - // if notify, set mail status to "not mailed" - $poll->setVar("mail_status", POLL_NOTMAILED); - } else { - // if not notify, set mail status to already "mailed" - $poll->setVar("mail_status", POLL_MAILED); - } - if ( !$poll->store() ) { - exit(); - } - $i = 0; - $option_id = (empty($_POST['option_id'])) ? NULL : $_POST['option_id']; - $option_color = (empty($_POST['option_color'])) ? NULL : $_POST['option_color']; - foreach ( $option_id as $opid ) { - if ( $pollmodules == 'xoopspoll') { - $option = new XoopsPollOption($opid); - $option_text[$i] = trim ($option_text[$i]); - if ( $option_text[$i] != "" ) { - $option->setVar("option_text", $option_text[$i]); - $option->setVar("option_color", $option_color[$i]); - $option->store(); - } else { - if ( $option->delete() != false ) { - XoopsPollLog::deleteByOptionId($option->getVar("option_id")); - } - } - } else { - $option = new UmfrageOption($opid); - $option_text[$i] = trim ($option_text[$i]); - if ( $option_text[$i] != "" ) { - $option->setVar("option_text", $option_text[$i]); - $option->setVar("option_color", $option_color[$i]); - $option->store(); - } else { - if ( $option->delete() != false ) { - UmfrageLog::deleteByOptionId($option->getVar("option_id")); - } - } - } - $i++; - } - $poll->updateCount(); - include_once XOOPS_ROOT_PATH . '/class/template.php'; - xoops_template_clear_module_cache($xoopsModule->getVar('mid')); - redirect_header("viewtopic.php?topic_id={$topic_id}", 1, _MD_POLL_DBUPDATED); - //exit(); -} - -if ( $op == "addmore" ) { - $pollid = intval($_GET['poll_id']); - if ( $pollmodules == 'xoopspoll') - $poll = new XoopsPoll($pollid); - else if ( $pollmodules == 'umfrage') - $poll = new Umfrage($pollid); - $poll_form = new XoopsThemeForm(_MD_POLL_ADDMORE, "poll_form", "polls.php"); - $question_label = new XoopsFormLabel(_MD_POLL_POLLQUESTION, $poll->getVar("question")); - $poll_form->addElement($question_label); - $option_tray = new XoopsFormElementTray(_MD_POLL_POLLOPTIONS, ""); - $barcolor_array = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . "/modules/".$pollmodules."/images/colorbars/"); - for($i = 0; $i < 10; $i++) { - $current_bar = (current($barcolor_array) != "blank.gif") ? current($barcolor_array) : next($barcolor_array); - $option_text = new XoopsFormText("", "option_text[]", 50, 255); - $option_tray->addElement($option_text); - $color_select = new XoopsFormSelect("", "option_color[{$i}]", $current_bar); - $color_select->addOptionArray($barcolor_array); - $color_select->setExtra("onchange='showImgSelected(\"option_color_image[{$i}]\", \"option_color[{$i}]\", \"modules/".$pollmodules."/images/colorbars\", \"\", \"" . XOOPS_URL . "\")'"); - $color_label = new XoopsFormLabel("", "<img src='" . XOOPS_URL . "/modules/".$pollmodules."/images/colorbars/{$current_bar}' name='option_color_image[{$i}]' id='option_color_image[{$i}]' width='30' align='bottom' height='15' alt='' /><br />"); - $option_tray->addElement($color_select); - $option_tray->addElement($color_label); - unset($color_select, $color_label, $option_text); - if ( !next($barcolor_array) ) { - reset($barcolor_array); - } - } - $poll_form->addElement($option_tray); - $submit_button = new XoopsFormButton("", "poll_submit", _SUBMIT, "submit"); - $poll_form->addElement($submit_button); - $op_hidden = new XoopsFormHidden("op", "savemore"); - $poll_form->addElement($op_hidden); - $poll_topic_id_hidden = new XoopsFormHidden("topic_id", $topic_id); - $poll_form->addElement($poll_topic_id_hidden); - $poll_id_hidden = new XoopsFormHidden("poll_id", $poll->getVar("poll_id")); - $poll_form->addElement($poll_id_hidden); - //include XOOPS_ROOT_PATH . "/header.php"; - echo "<h4>" . _MD_POLL_POLLCONF . "</h4>"; - $poll_form->display(); - //include XOOPS_ROOT_PATH . "/footer.php"; - //exit(); -} - -if ( $op == "savemore" ) { - $option_empty = true; - if (empty($_POST['option_text'])) { - redirect_header("javascript:history.go(-1);", 2, _MD_ERROROCCURED . ': ' . _MD_POLL_POLLOPTIONS . ' !'); - } - $option_text = $_POST['option_text']; - foreach ( $option_text as $optxt ) { - if ( trim($optxt) != "" ) { - $option_empty = false; - break; - } - } - if ($option_empty) redirect_header("javascript:history.go(-1);", 2, _MD_ERROROCCURED . ': ' . _MD_POLL_POLLOPTIONS . ' !'); - - if ( $pollmodules == 'xoopspoll') - $poll = new XoopsPoll($poll_id); - else - $poll = new Umfrage($poll_id); - $i = 0; - $option_color = (empty($_POST['option_color'])) ? NULL : $_POST['option_color']; - foreach ( $option_text as $optxt ) { - $optxt = trim($optxt); - if ( $optxt != "" ) { - if ( $pollmodules == 'xoopspoll') $option = new XoopsPollOption(); - else $option = new UmfrageOption(); - $option->setVar("option_text", $optxt); - $option->setVar("poll_id", $poll->getVar("poll_id")); - $option->setVar("option_color", $option_color[$i]); - $option->store(); - } - $i++; - } - include_once XOOPS_ROOT_PATH . '/class/template.php'; - xoops_template_clear_module_cache($xoopsModule->getVar('mid')); - redirect_header("polls.php?op=edit&poll_id=" . $poll->getVar("poll_id") . "&topic_id=" . $topic_id, 1, _MD_POLL_DBUPDATED); - //exit(); -} - -if ( $op == "delete" ) { - //include XOOPS_ROOT_PATH . "/header.php"; - echo "<h4>" . _MD_POLL_POLLCONF . "</h4>"; - $poll = new XoopsPoll($_GET['poll_id']); - xoops_confirm(array('op' => 'delete_ok', 'topic_id' => $topic_id, 'poll_id' => $poll->getVar('poll_id')), 'polls.php', sprintf(_MD_POLL_RUSUREDEL, $poll->getVar("question"))); - //include XOOPS_ROOT_PATH . "/footer.php"; - //exit(); -} - -if ( $op == "delete_ok" ) { - if ( $pollmodules == 'xoopspoll') - $poll = new XoopsPoll($poll_id); - else - $poll = new Umfrage($poll_id); - if ( $poll->delete() != false ) { - if ( $pollmodules == 'xoopspoll') { - XoopsPollOption::deleteByPollId($poll->getVar("poll_id")); - XoopsPollLog::deleteByPollId($poll->getVar("poll_id")); - } else { - UmfrageOption::deleteByPollId($poll->getVar("poll_id")); - UmfrageLog::deleteByPollId($poll->getVar("poll_id")); - } - include_once XOOPS_ROOT_PATH . '/class/template.php'; - xoops_template_clear_module_cache($xoopsModule->getVar('mid')); - // delete comments for this poll - xoops_comment_delete($xoopsModule->getVar('mid'), $poll->getVar('poll_id')); - $sql = "UPDATE " . $xoopsDB->prefix("bb_topics") . " SET votes = 0, topic_haspoll = 0, poll_id = 0 WHERE topic_id = {$topic_id}"; - if ( !$result = $xoopsDB->query($sql) ) { - //xoops_error($xoopsDB->error()); - } - } - redirect_header("viewtopic.php?topic_id={$topic_id}", 1, _MD_POLL_DBUPDATED); - //exit(); -} - -if ( $op == "restart" ) { - $pollid = intval($_GET['poll_id']); - if ( $pollmodules == 'xoopspoll') - $poll = new XoopsPoll($pollid); - else if ( $pollmodules == 'umfrage') - $poll = new Umfrage($pollid); - $poll_form = new XoopsThemeForm(_MD_POLL_RESTARTPOLL, "poll_form", "polls.php"); - $expire_text = new XoopsFormText(_MD_POLL_EXPIRATION . "<br /><small>" . _MD_POLL_FORMAT . "<br />" . sprintf(_MD_POLL_CURRENTTIME, formatTimestamp(time(), "Y-m-d H:i:s")) . "</small>", "end_time", 20, 19, formatTimestamp(time() + 604800, "Y-m-d H:i:s")); - $poll_form->addElement($expire_text); - $notify_yn = new XoopsFormRadioYN(_MD_POLL_NOTIFY, "notify", 1); - $poll_form->addElement($notify_yn); - $reset_yn = new XoopsFormRadioYN(_MD_POLL_RESET, "reset", 0); - $poll_form->addElement($reset_yn); - $op_hidden = new XoopsFormHidden("op", "restart_ok"); - $poll_form->addElement($op_hidden); - $poll_topic_id_hidden = new XoopsFormHidden("topic_id", $topic_id); - $poll_form->addElement($poll_topic_id_hidden); - $poll_id_hidden = new XoopsFormHidden("poll_id", $poll->getVar("poll_id")); - $poll_form->addElement($poll_id_hidden); - $submit_button = new XoopsFormButton("", "poll_submit", _MD_POLL_RESTART, "submit"); - $poll_form->addElement($submit_button); - //include XOOPS_ROOT_PATH . "/header.php"; - echo "<h4>" . _MD_POLL_POLLCONF . "</h4>"; - $poll_form->display(); - //include XOOPS_ROOT_PATH . "/footer.php"; - //exit(); -} - -if ( $op == "restart_ok" ) { - if ( $pollmodules == 'xoopspoll') - $poll = new XoopsPoll($poll_id); - else - $poll = new Umfrage($poll_id); - $end_time = (empty($_POST['end_time'])) ? "" : $_POST['end_time']; - if ( !empty($end_time) ) { - $timezone = is_object($xoopsUser) ? $xoopsUser->getVar("timezone") : null; -// Start user input time in hegira date - hacked by irmtfan (www.jadoogaran.org) -// $end_time=inputTimeToGregorian($end_time); -// if method is not exist use the original strtotime function - $poll->setVar("end_time", userTimeToServerTime(method_exists('XoopsLocal', 'strtotime') ? XoopsLocal::strtotime($end_time) : strtotime($end_time), $timezone)); -// End user input time in hegira date - hacked by irmtfan (www.jadoogaran.org) - } else { - $poll->setVar("end_time", time() + (86400 * 10)); - } - if ( !empty($_POST["notify"]) && $end_time > time() ) { - // if notify, set mail status to "not mailed" - $poll->setVar("mail_status", POLL_NOTMAILED); - } else { - // if not notify, set mail status to already "mailed" - $poll->setVar("mail_status", POLL_MAILED); - } - if ( !empty($_POST["reset"]) ) { - // reset all logs - if ( $pollmodules == 'xoopspoll') { - XoopsPollLog::deleteByPollId($poll->getVar("poll_id")); - XoopsPollOption::resetCountByPollId($poll->getVar("poll_id")); - } else { - UmfrageLog::deleteByPollId($poll->getVar("poll_id")); - UmfrageOption::resetCountByPollId($poll->getVar("poll_id")); - } - } - if (!$poll->store()) { - //xoops_error($poll->getHtmlErrors()); - exit(); - } - $poll->updateCount(); - include_once XOOPS_ROOT_PATH . '/class/template.php'; - xoops_template_clear_module_cache($xoopsModule->getVar('mid')); - redirect_header("viewtopic.php?topic_id={$topic_id}", 1, _MD_POLL_DBUPDATED); - //exit(); -} - -if ( $op == "log" ) { - //include XOOPS_ROOT_PATH . "/header.php"; - echo "<h4>" . _MD_POLL_POLLCONF . "</h4>"; - echo "<br />View Log<br /> Sorry, not yet. ;-)"; - //include XOOPS_ROOT_PATH . "/footer.php"; - //exit(); -} - -include XOOPS_ROOT_PATH . "/footer.php"; +<?php +/** + * Newbb module + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @copyright The XOOPS Project http://sourceforge.net/projects/xoops/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @package newbb + * @since 4.0 + * @author Taiwen Jiang <ph...@us...> + * @version $Id: polls.php 2175 2008-09-23 14:07:03Z phppp $ + */ + + +include_once dirname(__FILE__) . "/header.php"; + +include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php"; +include_once XOOPS_ROOT_PATH . "/class/xoopslists.php"; +include_once XOOPS_ROOT_PATH . "/class/xoopsblock.php"; + +$pollmodules = NULL; +$xoopspoll = &$module_handler->getByDirname('xoopspoll'); +if (is_object($xoopspoll) && $xoopspoll->getVar('isactive')) { + $pollmodules = 'xoopspoll'; +} else { + //Umfrage + $xoopspoll = &$module_handler->getByDirname('umfrage'); + if (is_object($xoopspoll) && $xoopspoll->getVar('isactive')) + $pollmodules = 'umfrage'; +} + +if ( $pollmodules == 'xoopspoll') +{ + include XOOPS_ROOT_PATH . "/modules/xoopspoll/include/constants.php"; + include_once XOOPS_ROOT_PATH . "/modules/xoopspoll/class/xoopspoll.php"; + include_once XOOPS_ROOT_PATH . "/modules/xoopspoll/class/xoopspolloption.php"; + include_once XOOPS_ROOT_PATH . "/modules/xoopspoll/class/xoopspolllog.php"; + include_once XOOPS_ROOT_PATH . "/modules/xoopspoll/class/xoopspollrenderer.php"; +} +elseif ($pollmodules == 'umfrage') +{ + include XOOPS_ROOT_PATH."/modules/umfrage/include/constants.php"; + include_once XOOPS_ROOT_PATH."/modules/umfrage/class/umfrage.php"; + include_once XOOPS_ROOT_PATH."/modules/umfrage/class/umfrageoption.php"; + include_once XOOPS_ROOT_PATH."/modules/umfrage/class/umfragelog.php"; + include_once XOOPS_ROOT_PATH."/modules/umfrage/class/umfragerenderer.php"; +} +else +{ + redirect_header("javascript:history.go(-1);", 2, _MD_POLLMODULE_ERROR); + exit(); +} +// irmtfan correct the way and typo=addmor -> addmore +$op = "add"; +if (isset($_REQUEST['op'])) $op = $_REQUEST['op']; +if ( !in_array( $op,array('add','save','edit','update','addmore','savemore','delete','delete_ok','restart','restart_ok','log')) ) $op = "add"; +if (isset($_GET['poll_id'])) $poll_id = intval($_GET['poll_id']); +if (isset($_POST['poll_id'])) $poll_id = intval($_POST['poll_id']); +if (isset($_GET['topic_id'])) $topic_id = intval($_GET['topic_id']); +if (isset($_POST['topic_id'])) $topic_id = intval($_POST['topic_id']); + +if (!isset($module_handler)) $module_handler =& xoops_gethandler('module'); +$xoopspoll =& $module_handler->getByDirname($pollmodules); +if (!is_object($xoopspoll) || !$xoopspoll->getVar('isactive')) { + redirect_header("javascript:history.go(-1);", 2, _MD_POLLMODULE_ERROR); + exit(); +} + +include XOOPS_ROOT_PATH . "/header.php"; + +$topic_handler =& xoops_getmodulehandler('topic', 'newbb'); +$topic_obj =& $topic_handler->get($topic_id); +$forum = $topic_obj->getVar('forum_id'); +$forum_handler =& xoops_getmodulehandler('forum', 'newbb'); +$forum_obj =& $forum_handler->get($forum); +if (!$forum_handler->getPermission($forum_obj)) { + redirect_header("index.php", 2, _MD_NORIGHTTOACCESS); + exit(); +} +if (!$topic_handler->getPermission($forum_obj, $topic_obj->getVar('topic_status'), "view")) { + redirect_header("viewforum.php?forum=" . $forum_obj->getVar('forum_id'), 2, _MD_NORIGHTTOVIEW); + exit(); +} + +$isadmin = newbb_isAdmin($forum_obj); +$perm = false; +if ($isadmin) { + $perm = true; +} elseif ($topic_handler->getPermission($forum_obj, $topic_obj->getVar('topic_status'), "addpoll") + //&& $forum_obj->getVar('allow_polls') == 1 +) { + if ( ($op=="add" || $op=="save") && !$topic_obj->getVar("topic_haspoll") && is_object($xoopsUser) && $xoopsUser->getVar("uid") == $topic_obj->getVar("topic_poster") ) { + $perm = true; + } elseif (!empty($poll_id)) { + $poll = new XoopsPoll($poll_id); + if (is_object($xoopsUser) && $xoopsUser->getVar("uid") == $poll->getVar("user_id")) { + $perm = true; + } + } +} +if (!$perm) { + redirect_header("viewtopic.php?topic_id=" . $topic_id, 2, _NOPERM); + exit(); +} + +if ( $op == "add" ) { + $poll_form = new XoopsThemeForm(_MD_POLL_CREATNEWPOLL, "poll_form", "polls.php"); + + $question_text = new XoopsFormText(_MD_POLL_POLLQUESTION, "question", 50, 255); + $poll_form->addElement($question_text, true); + + $desc_tarea = new XoopsFormTextarea(_MD_POLL_POLLDESC, "description"); + $poll_form->addElement($desc_tarea); + + $currenttime = formatTimestamp(time(), "Y-m-d H:i:s"); + $endtime = formatTimestamp(time() + 604800, "Y-m-d H:i:s"); + $expire_text = new XoopsFormText(_MD_POLL_EXPIRATION . "<br /><small>" . _MD_POLL_FORMAT . "<br />" . sprintf(_MD_POLL_CURRENTTIME, $currenttime) . "</small>", "end_time", 30, 19, $endtime); + $poll_form->addElement($expire_text); + + $weight_text = new XoopsFormText(_MD_POLL_DISPLAYORDER, "weight", 6, 5, 0); + $poll_form->addElement($weight_text); + + $multi_yn = new XoopsFormRadioYN(_MD_POLL_ALLOWMULTI, "multiple", 0); + $poll_form->addElement($multi_yn); + + $notify_yn = new XoopsFormRadioYN(_MD_POLL_NOTIFY, "notify", 1); + $poll_form->addElement($notify_yn); + + $option_tray = new XoopsFormElementTray(_MD_POLL_POLLOPTIONS, ""); + $barcolor_array = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . "/modules/".$pollmodules."/images/colorbars/"); + for($i = 0; $i < 10; $i++) { + $current_bar = (current($barcolor_array) != "blank.gif") ? current($barcolor_array) : next($barcolor_array); + $option_text = new XoopsFormText("", "option_text[]", 50, 255); + $option_tray->addElement($option_text); + $color_select = new XoopsFormSelect("", "option_color[{$i}]", $current_bar); + $color_select->addOptionArray($barcolor_array); + $color_select->setExtra("onchange='showImgSelected(\"option_color_image[{$i}]\", \"option_color[{$i}]\", \"modules/".$pollmodules."/images/colorbars\", \"\", \"" . XOOPS_URL . "\")'"); + $color_label = new XoopsFormLabel("", "<img src='" . XOOPS_URL . "/modules/".$pollmodules."/images/colorbars/" . $current_bar . "' name='option_color_image[{$i}]' id='option_color_image[{$i}]' width='30' align='bottom' height='15' alt='' /><br />"); + $option_tray->addElement($color_select); + $option_tray->addElement($color_label); + if ( !next($barcolor_array) ) { + reset($barcolor_array); + } + unset($color_select, $color_label); + } + $poll_form->addElement($option_tray); + + $submit_button = new XoopsFormButton("", "poll_submit", _SUBMIT, "submit"); + $poll_form->addElement($submit_button); + $op_hidden = new XoopsFormHidden("op", "save"); + $poll_form->addElement($op_hidden); + $poll_topic_id_hidden = new XoopsFormHidden("topic_id", $topic_id); + $poll_form->addElement($poll_topic_id_hidden); + //include XOOPS_ROOT_PATH . "/header.php"; + echo "<h4>" . _MD_POLL_POLLCONF . "</h4>"; + $poll_form->display(); + //include XOOPS_ROOT_PATH . "/footer.php"; + //exit(); +} + +if ( $op == "save" ) { + /* + * The option check should be done before submitting + */ + $option_empty = true; + if (empty($_POST['option_text'])) { + redirect_header("javascript:history.go(-1);", 2, _MD_ERROROCCURED . ': ' . _MD_POLL_POLLOPTIONS . ' !'); + } + $option_text = $_POST['option_text']; + foreach ( $option_text as $optxt ) { + if ( trim($optxt) != "" ) { + $option_empty = false; + break; + } + } + if ($option_empty) { + redirect_header("javascript:history.go(-1);", 2, _MD_ERROROCCURED . ': ' . _MD_POLL_POLLOPTIONS . ' !'); + } + if ( $pollmodules == 'xoopspoll') + $poll = new XoopsPoll(); + else if ( $pollmodules == 'umfrage') + $poll = new Umfrage(); + else die("POLL-ERROR: polls.php Line 190"); + $poll->setVar("question", @$_POST['question']); + $poll->setVar("description", @$_POST['description']); + if ( !empty($_POST['end_time']) ) { + $timezone = is_object($xoopsUser) ? $xoopsUser->getVar("timezone") : null; + //$poll->setVar("end_time", userTimeToServerTime(strtotime($_POST['end_time']), $timezone)); + //Hack by irmtfan + $poll->setVar("end_time", userTimeToServerTime(method_exists('XoopsLocal', 'strtotime') ? XoopsLocal::strtotime($_POST['end_time']) : strtotime($_POST['end_time']), $timezone)); + } else { + // if expiration date is not set, set it to 10 days from now + $poll->setVar("end_time", time() + (86400 * 10)); + } + $poll->setVar("display", 0); + $poll->setVar("weight", intval(@$_POST['weight'])); + $poll->setVar("multiple", intval(@$_POST['multiple'])); + if ( !empty($_POST["notify"]) ) { + // if notify, set mail status to "not mailed" + $poll->setVar("mail_status", POLL_NOTMAILED); + } else { + // if not notify, set mail status to already "mailed" + $poll->setVar("mail_status", POLL_MAILED); + } + $uid = is_object($xoopsUser) ? $xoopsUser->getVar("uid") : 0; + $poll->setVar("user_id", $uid); + $new_poll_id = $poll->store(); + $option_color = empty($_POST['option_color']) ? NULL : $_POST['option_color']; + if ( !empty($new_poll_id) ) { + $i = 0; + foreach ( $option_text as $optxt ) { + $optxt = trim($optxt); + if ( $optxt != "" ) { + if ( $pollmodules == 'xoopspoll') + $option = new XoopsPollOption(); + else if ( $pollmodules == 'umfrage') + $option = new UmfrageOption(); + else die("POLL-ERROR: polls.php Line 223"); + $option->setVar("option_text", $optxt); + $option->setVar("option_color", $option_color[$i]); + $option->setVar("poll_id", $new_poll_id); + $option->store(); + } + $i++; + } + $sql = "UPDATE " . $xoopsDB->prefix("bb_topics") . " SET topic_haspoll = 1, poll_id = {$new_poll_id} WHERE topic_id = {$topic_id}"; + if ( !$result = $xoopsDB->query($sql) ) { + xoops_error($xoopsDB->error()); + } + include_once XOOPS_ROOT_PATH . '/class/template.php'; + xoops_template_clear_module_cache($xoopsModule->getVar('mid')); + } else { + xoops_error($poll->getHtmlErrors()); + exit(); + } + redirect_header("viewtopic.php?topic_id={$topic_id}",1,_MD_POLL_DBUPDATED); + //exit(); +} + +if ( $op == "edit" ) { + $pollid = intval($_GET['poll_id']); + if ( $pollmodules == 'xoopspoll') + $poll = new XoopsPoll($pollid); + else if ( $pollmodules == 'umfrage') + $poll = new Umfrage($pollid); + $poll_form = new XoopsThemeForm(_MD_POLL_EDITPOLL, "poll_form", "polls.php"); + $author_label = new XoopsFormLabel(_MD_POLL_AUTHOR, "<a href='" . XOOPS_URL . "/userinfo.php?uid=" . $poll->getVar("user_id") . "'>" . newbb_getUnameFromId($poll->getVar("user_id"), $xoopsModuleConfig['show_realname']) . "</a>"); + $poll_form->addElement($author_label); + $question_text = new XoopsFormText(_MD_POLL_POLLQUESTION, "question", 50, 255, $poll->getVar("question", "E")); + $poll_form->addElement($question_text); + $desc_tarea = new XoopsFormTextarea(_MD_POLL_POLLDESC, "description", $poll->getVar("description", "E")); + $poll_form->addElement($desc_tarea); + $date = formatTimestamp($poll->getVar("end_time"), "Y-m-d H:i:s"); + if ( !$poll->hasExpired() ) { + $expire_text = new XoopsFormText(_MD_POLL_EXPIRATION . "<br /><small>" . _MD_POLL_FORMAT . "<br />" . sprintf(_MD_POLL_CURRENTTIME, formatTimestamp(time(), "Y-m-d H:i:s")) . "</small>", "end_time", 20, 19, $date); + $poll_form->addElement($expire_text); + } else { + $restart_label = new XoopsFormLabel(_MD_POLL_EXPIRATION, sprintf(_MD_POLL_EXPIREDAT, $date) . "<br /><a href='polls.php?op=restart&poll_id=" . $poll->getVar("poll_id") . "'>" . _MD_POLL_RESTART . "</a>"); + $poll_form->addElement($restart_label); + } + $weight_text = new XoopsFormText(_MD_POLL_DISPLAYORDER, "weight", 6, 5, $poll->getVar("weight")); + $poll_form->addElement($weight_text); + $multi_yn = new XoopsFormRadioYN(_MD_POLL_ALLOWMULTI, "multiple", $poll->getVar("multiple")); + $poll_form->addElement($multi_yn); + if ( $pollmodules == 'xoopspoll') + $options_arr = XoopsPollOption::getAllByPollId($poll->getVar("poll_id")); + else + $options_arr =& UmfrageOption::getAllByPollId($poll->getVar("poll_id")); + $notify_value = 1; + if ( $poll->getVar("mail_status") != 0 ) { + $notify_value = 0; + } + $notify_yn = new XoopsFormRadioYN(_MD_POLL_NOTIFY, "notify", $notify_value); + $poll_form->addElement($notify_yn); + $option_tray = new XoopsFormElementTray(_MD_POLL_POLLOPTIONS, ""); + $barcolor_array = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . "/modules/".$pollmodules."/images/colorbars/"); + $i = 0; + foreach ($options_arr as $option) { + $option_text = new XoopsFormText("", "option_text[]", 50, 255, $option->getVar("option_text")); + $option_tray->addElement($option_text); + $option_id_hidden = new XoopsFormHidden("option_id[]", $option->getVar("option_id")); + $option_tray->addElement($option_id_hidden); + $color_select = new XoopsFormSelect("", "option_color[{$i}]", $option->getVar("option_color")); + $color_select->addOptionArray($barcolor_array); + $color_select->setExtra("onchange='showImgSelected(\"option_color_image[{$i}]\", \"option_color[".$i."]\", \"modules/".$pollmodules."/images/colorbars\", \"\", \"" . XOOPS_URL . "\")'"); + $color_label = new XoopsFormLabel("", "<img src='" . XOOPS_URL . "/modules/".$pollmodules."/images/colorbars/" . $option->getVar("option_color", "E") . "' name='option_color_image[{$i}]' id='option_color_image[{$i}]' width='30' align='bottom' height='15' alt='' /><br />"); + $option_tray->addElement($color_select); + $option_tray->addElement($color_label); + unset($color_select, $color_label, $option_id_hidden, $option_text); + $i++; + } + $more_label = new XoopsFormLabel("", "<br /><a href='polls.php?op=addmore&poll_id=" . $poll->getVar("poll_id") . "&topic_id=" . $topic_id . "'>" . _MD_POLL_ADDMORE . "</a>"); + $option_tray->addElement($more_label); + $poll_form->addElement($option_tray); + $op_hidden = new XoopsFormHidden("op", "update"); + $poll_form->addElement($op_hidden); + $poll_topic_id_hidden = new XoopsFormHidden("topic_id", $topic_id); + $poll_form->addElement($poll_topic_id_hidden); + $poll_id_hidden = new XoopsFormHidden("poll_id", $poll->getVar("poll_id")); + $poll_form->addElement($poll_id_hidden); + $submit_button = new XoopsFormButton("", "poll_submit", _SUBMIT, "submit"); + $poll_form->addElement($submit_button); + //include XOOPS_ROOT_PATH . "/header.php"; + echo "<h4>" . _MD_POLL_POLLCONF . "</h4>"; + $poll_form->display(); + //include XOOPS_ROOT_PATH . "/footer.php"; + //exit(); +} + +if ( $op == "update" ) { + $option_empty = true; + if (empty($_POST['option_text'])) { + redirect_header("javascript:history.go(-1);", 2, _MD_ERROROCCURED . ': ' . _MD_POLL_POLLOPTIONS . ' !'); + } + $option_text = $_POST['option_text']; + foreach ( $option_text as $optxt ) { + if ( trim($optxt) != "" ) { + $option_empty = false; + break; + } + } + if ($option_empty) redirect_header("javascript:history.go(-1);", 2, _MD_ERROROCCURED . ': ' . _MD_POLL_POLLOPTIONS . ' !'); + + if ( $pollmodules == 'xoopspoll') + $poll = new XoopsPoll($poll_id); + else + $poll = new Umfrage($poll_id); + $poll->setVar("question", @$_POST['question']); + $poll->setVar("description", @$_POST['description']); + $end_time = (empty($_POST['end_time'])) ? "" : $_POST['end_time']; + if ( !empty($end_time) ) { + $timezone = is_object($xoopsUser) ? $xoopsUser->getVar("timezone") : null; + //$poll->setVar("end_time", userTimeToServerTime(strtotime($end_time), $timezone)); + //Hack by Irmtfan + $poll->setVar("end_time", userTimeToServerTime(method_exists('XoopsLocal', 'strtotime') ? XoopsLocal::strtotime($end_time) : strtotime($end_time), $timezone)); + } + $poll->setVar("display", 0); + $poll->setVar("weight", intval(@$_POST['weight'])); + $poll->setVar("multiple", intval(@$_POST['multiple'])); + if ( !empty($_POST["notify"]) && $end_time > time() ) { + // if notify, set mail status to "not mailed" + $poll->setVar("mail_status", POLL_NOTMAILED); + } else { + // if not notify, set mail status to already "mailed" + $poll->setVar("mail_status", POLL_MAILED); + } + if ( !$poll->store() ) { + exit(); + } + $i = 0; + $option_id = (empty($_POST['option_id'])) ? NULL : $_POST['option_id']; + $option_color = (empty($_POST['option_color'])) ? NULL : $_POST['option_color']; + foreach ( $option_id as $opid ) { + if ( $pollmodules == 'xoopspoll') { + $option = new XoopsPollOption($opid); + $option_text[$i] = trim ($option_text[$i]); + if ( $option_text[$i] != "" ) { + $option->setVar("option_text", $option_text[$i]); + $option->setVar("option_color", $option_color[$i]); + $option->store(); + } else { + if ( $option->delete() != false ) { + XoopsPollLog::deleteByOptionId($option->getVar("option_id")); + } + } + } else { + $option = new UmfrageOption($opid); + $option_text[$i] = trim ($option_text[$i]); + if ( $option_text[$i] != "" ) { + $option->setVar("option_text", $option_text[$i]); + ... [truncated message content] |
From: <ir...@us...> - 2012-08-27 11:18:26
|
Revision: 10123 http://xoops.svn.sourceforge.net/xoops/?rev=10123&view=rev Author: irmtfan Date: 2012-08-27 11:18:20 +0000 (Mon, 27 Aug 2012) Log Message: ----------- improve text link instead of buttons, correct some extra spaces Modified Paths: -------------- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt XoopsModules/newbb/branches/irmtfan/newbb/class/icon.php XoopsModules/newbb/branches/irmtfan/newbb/include/functions.render.php XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html XoopsModules/newbb/branches/irmtfan/newbb/viewtopic.php Modified: XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt 2012-08-27 08:04:06 UTC (rev 10122) +++ XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt 2012-08-27 11:18:20 UTC (rev 10123) @@ -1,3 +1,11 @@ +date: 2012-08-27 - 2 +================================================ +1- improve text link instead of buttons to only show text buttons when: a) alt key is set b)display is not set to true c)only buttons like reply, edit +newbb/include/functions.render.php, newbb/class/icon.php + +2- add alt key for quickreply button and remove one extra space ( ) and sort reply - addpoll - newtopic +newbb/viewtopic.php, newbb/templates/newbb_viewtopic.html + date: 2012-08-27 ================================================ 1- remove icon_path and use newbb_displayImage Modified: XoopsModules/newbb/branches/irmtfan/newbb/class/icon.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/class/icon.php 2012-08-27 08:04:06 UTC (rev 10122) +++ XoopsModules/newbb/branches/irmtfan/newbb/class/icon.php 2012-08-27 11:18:20 UTC (rev 10123) @@ -150,12 +150,13 @@ function assignImage($image, $alt = "", $extra = "") { $this->setImage($image, $alt, $extra); - // START hacked by iemrfan - improve to CSS3 buttons - if ($alt !='') { - return "<button {$extra} id={$image}>$alt</button>"; + // START hacked by irmtfan - improve function to CSS3 buttons + $tag="span"; + if (in_array( substr($image,0,2),array('t_','p_','up') )) { + $tag="button"; } - return true; - // END hacked by iemrfan - improve to CSS3 buttons + return "<{$tag} align=\"middle\" {$extra} id={$image}>$alt</{$tag}>"; + // END hacked by irmtfan - improve function to CSS3 buttons } function assignImages($images) Modified: XoopsModules/newbb/branches/irmtfan/newbb/include/functions.render.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/include/functions.render.php 2012-08-27 08:04:06 UTC (rev 10122) +++ XoopsModules/newbb/branches/irmtfan/newbb/include/functions.render.php 2012-08-27 11:18:20 UTC (rev 10123) @@ -97,12 +97,12 @@ { $icon_handler = newbb_getIconHandler(); // START hacked by irmtfan - // to show text links instead of buttons + // to show text links instead of buttons - func_num_args()==2 => only when $image, $alt is set and optional $display not set global $xoopsModuleConfig; - if (!empty($xoopsModuleConfig['display_text_links'])){ + if (!empty($xoopsModuleConfig['display_text_links']) && func_num_args()== 2){ $display=false; } - // END hacked by irmtfan + // END hacked by irmtfan if (empty($display)) { return $icon_handler->assignImage($image, $alt, $extra); } else { Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html 2012-08-27 08:04:06 UTC (rev 10122) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html 2012-08-27 11:18:20 UTC (rev 10123) @@ -204,7 +204,7 @@ <br /> <div class="left" style="padding: 5px;"> - <{$forum_addpoll}> <{$forum_reply}> <{$forum_post_or_register}> + <{$forum_reply}> <{$forum_addpoll}> <{$forum_post_or_register}> </div> <div class="clear"></div> <br /> Modified: XoopsModules/newbb/branches/irmtfan/newbb/viewtopic.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/viewtopic.php 2012-08-27 08:04:06 UTC (rev 10122) +++ XoopsModules/newbb/branches/irmtfan/newbb/viewtopic.php 2012-08-27 11:18:20 UTC (rev 10123) @@ -463,7 +463,7 @@ if (!$topic_obj->getVar('topic_haspoll')) { if ( is_object($xoopsUser) && $xoopsUser->getVar("uid")==$topic_obj->getVar("topic_poster") ) { $t_poll = newbb_displayImage('t_poll',_MD_ADDPOLL); - $xoopsTpl->assign('forum_addpoll', "<a href=\"".XOOPS_URL."/modules/".$xoopsModule->getVar("dirname", "n")."/polls.php?op=add&topic_id=".$topic_id."\">".$t_poll."</a> "); + $xoopsTpl->assign('forum_addpoll', "<a href=\"".XOOPS_URL."/modules/".$xoopsModule->getVar("dirname", "n")."/polls.php?op=add&topic_id=".$topic_id."\">".$t_poll."</a>"); } } elseif ($isadmin || (is_object($poll) && is_object($xoopsUser) && $xoopsUser->getVar("uid")==$poll->getVar("user_id") ) @@ -623,7 +623,7 @@ $toggles = newbb_getcookie('G', true); $display = (in_array('qr', $toggles)) ? 'none;' : 'block;'; - $xoopsTpl->assign('quickreply', array( 'show' => 1, 'display' => $display, 'icon' => newbb_displayImage('t_qr'), 'form' => $forum_form->render())); + $xoopsTpl->assign('quickreply', array( 'show' => 1, 'display' => $display, 'icon' => newbb_displayImage('t_qr',_MD_QUICKREPLY), 'form' => $forum_form->render())); unset($forum_form); } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ir...@us...> - 2012-08-30 07:57:51
|
Revision: 10136 http://xoops.svn.sourceforge.net/xoops/?rev=10136&view=rev Author: irmtfan Date: 2012-08-30 07:57:41 +0000 (Thu, 30 Aug 2012) Log Message: ----------- ToggleBlockCategory improved, onclick improved, hardcode removed Modified Paths: -------------- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt XoopsModules/newbb/branches/irmtfan/newbb/docs/lang_diff.txt XoopsModules/newbb/branches/irmtfan/newbb/include/display.php XoopsModules/newbb/branches/irmtfan/newbb/include/images.php XoopsModules/newbb/branches/irmtfan/newbb/include/js/newbb_toggle.js XoopsModules/newbb/branches/irmtfan/newbb/index.php XoopsModules/newbb/branches/irmtfan/newbb/language/english/main.php XoopsModules/newbb/branches/irmtfan/newbb/language/persian/main.php XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/english/style.css XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/style.css XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_index.html XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_thread.html XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html XoopsModules/newbb/branches/irmtfan/newbb/viewtopic.php Added Paths: ----------- XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/english/t_qr_expand.png XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/t_qr_expand.png Modified: XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt 2012-08-29 20:46:24 UTC (rev 10135) +++ XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt 2012-08-30 07:57:41 UTC (rev 10136) @@ -1,3 +1,20 @@ +date 2012-08-30 +================================================ +1- add more and less icons - add t_qr_expand.png image and add show see definitions +newbb/include/display.php, newbb/include/images.php +newbb/templates/images/language/english/t_qr_expand.png +newbb/language/english/main.php, newbb/docs/lang_diff.txt + +2- improve ToggleBlockCategory js to recognize a IMG tag +newbb/include/js/newbb_toggle.js + +3- change all toggles in newbb to use ToggleBlockCategory - use newbb_displayImage function for all toggles - alt and title and text links supported +newbb/viewtopic.php, newbb/templates/newbb_viewtopic.html, newbb/templates/newbb_thread.html +newbb/index.php, newbb/templates/newbb_index.html + +4- some hardcodes removed (<small><{$topic_post.post_edit}></small> and signature line +newbb/templates/newbb_thread.html, newbb/templates/images/language/english/style.css + date 2012-08-28 ================================================ 1- improve text link instead of buttons feature. Ability to set the display setting for each link in newbb/include/display.php Modified: XoopsModules/newbb/branches/irmtfan/newbb/docs/lang_diff.txt =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/docs/lang_diff.txt 2012-08-29 20:46:24 UTC (rev 10135) +++ XoopsModules/newbb/branches/irmtfan/newbb/docs/lang_diff.txt 2012-08-30 07:57:41 UTC (rev 10136) @@ -44,3 +44,5 @@ define('_MD_NEWBB_SEEUSERDATA','See User information'); added: define('_MD_NEWBB_HIDEUSERDATA','Hide User information'); +define('_MD_NEWBB_HIDE','Hide'); +define('_MD_NEWBB_SEE','See'); Modified: XoopsModules/newbb/branches/irmtfan/newbb/include/display.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/include/display.php 2012-08-29 20:46:24 UTC (rev 10135) +++ XoopsModules/newbb/branches/irmtfan/newbb/include/display.php 2012-08-30 07:57:41 UTC (rev 10136) @@ -125,6 +125,8 @@ //$displayText['technorati'] = //$displayText['wong'] = //$displayText['anonym'] = +//$displayText['more'] = +//$displayText['less'] = $displayText['p_delete'] = $displayText['p_reply'] = @@ -135,6 +137,7 @@ $displayText['t_new'] = $displayText['t_poll'] = $displayText['t_qr'] = +$displayText['t_qr_expand'] = $displayText['t_reply'] = //$displayText['online'] = @@ -208,6 +211,8 @@ //$displayText['technorati'] = //$displayText['wong'] = //$displayText['anonym'] = +//$displayText['more'] = +//$displayText['less'] = //$displayText['p_delete'] = //$displayText['p_reply'] = @@ -217,7 +222,8 @@ //$displayText['t_new'] = //$displayText['t_poll'] = -//$displayText['t_qr'] = +//$displayText['t_qr'] = +//$displayText['t_qr_expand'] = //$displayText['t_reply'] = //$displayText['online'] = Modified: XoopsModules/newbb/branches/irmtfan/newbb/include/images.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/include/images.php 2012-08-29 20:46:24 UTC (rev 10135) +++ XoopsModules/newbb/branches/irmtfan/newbb/include/images.php 2012-08-30 07:57:41 UTC (rev 10136) @@ -25,7 +25,7 @@ */ // Forum image type -// irmtfan add anonym.png icon +// irmtfan add anonym.png more.png and less.png icon $forumImage[''] = $forumImage['blank'] = $forumImage['attachment'] = @@ -82,6 +82,8 @@ $forumImage['technorati'] = $forumImage['wong'] = $forumImage['anonym'] = +$forumImage['more'] = +$forumImage['less'] = "icon"; for($i = 1; $i <= 5; $i++ ) { @@ -97,7 +99,8 @@ $forumImage['t_new'] = $forumImage['t_poll'] = -$forumImage['t_qr'] = +$forumImage['t_qr'] = +$forumImage['t_qr_expand'] = $forumImage['t_reply'] = $forumImage['online'] = Modified: XoopsModules/newbb/branches/irmtfan/newbb/include/js/newbb_toggle.js =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/include/js/newbb_toggle.js 2012-08-29 20:46:24 UTC (rev 10135) +++ XoopsModules/newbb/branches/irmtfan/newbb/include/js/newbb_toggle.js 2012-08-30 07:57:41 UTC (rev 10136) @@ -64,24 +64,25 @@ function ToggleBlockCategory(block, icon, src_expand, src_collapse, alt_expand, alt_collapse) { + var Img_tag='IMG'; if (document.getElementById) { if (document.getElementById(block).style.display == 'block') { document.getElementById(block).style.display = 'none'; - icon.src = src_collapse; + if (icon.nodeName == Img_tag) { + icon.src = src_collapse; + } icon.alt= alt_collapse; - icon.title= alt_collapse; - SaveCollapsed(block, true); } else { document.getElementById(block).style.display = 'block'; - icon.src = src_expand; + if (icon.nodeName == Img_tag) { + icon.src = src_expand; + } icon.alt= alt_expand; - icon.title= alt_expand; - SaveCollapsed(block, false); } } @@ -90,22 +91,24 @@ if (document.all[block].style.display == 'block') { document.all[block].style.display = 'none'; - icon.src = src_collapse; + if (icon.nodeName == Img_tag) { + icon.src = src_collapse; + } icon.alt= alt_collapse; - icon.title= alt_collapse; - SaveCollapsed(block, true); } else { document.all[block].style.display = 'block'; - icon.src = src_expand; + if (icon.nodeName == Img_tag) { + icon.src = src_expand; + } icon.alt= alt_expand; - icon.title= alt_expand; - SaveCollapsed(block, false); } } + icon.title = icon.alt; + icon.textContent=icon.title; } Modified: XoopsModules/newbb/branches/irmtfan/newbb/index.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/index.php 2012-08-29 20:46:24 UTC (rev 10135) +++ XoopsModules/newbb/branches/irmtfan/newbb/index.php 2012-08-30 07:57:41 UTC (rev 10136) @@ -153,8 +153,17 @@ $cat_element_id = "cat_".$onecat['cat_id']; $expand = (count($toggles) > 0) ? ( (in_array($cat_element_id, $toggles)) ? false : true ) : true; - $cat_display = ($expand) ? 'block;' : 'none;'; - $cat_icon_display = ($expand) ? $category_icon["expand"] : $category_icon["collapse"]; + // START irmtfan to improve newbb_displayImage + if ($expand) { + $cat_display = 'block;'; + $cat_icon_display = "minus"; + $cat_alt = _MD_NEWBB_HIDE; + } else { + $cat_display = 'none;'; + $cat_icon_display = "plus"; + $cat_alt = _MD_NEWBB_SEE; + } + $cat_displayImage = newbb_displayImage($cat_icon_display, $cat_alt); if (isset($forumsByCat[$onecat['cat_id']])) { $forums = $forumsByCat[$onecat['cat_id']]; @@ -179,7 +188,7 @@ 'cat_description' => $myts->displayTarea($onecat['cat_description'],1), 'cat_element_id' => $cat_element_id, 'cat_display' => $cat_display, - 'cat_icon_display' => $cat_icon_display, + 'cat_displayImage' => $cat_displayImage, 'forums' => $forums ); } Modified: XoopsModules/newbb/branches/irmtfan/newbb/language/english/main.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/language/english/main.php 2012-08-29 20:46:24 UTC (rev 10135) +++ XoopsModules/newbb/branches/irmtfan/newbb/language/english/main.php 2012-08-30 07:57:41 UTC (rev 10136) @@ -486,4 +486,6 @@ define('_MD_NEWBB_MAXPIC','Images at the max. Size %s X %s pixels.'); define('_MD_NEWBB_SEARCHDISABLED','The search is disabled and can not be used.'); define('_MD_NEWBB_HIDEUSERDATA','Hide User information'); +define('_MD_NEWBB_HIDE','Hide'); +define('_MD_NEWBB_SEE','See'); ?> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/language/persian/main.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/language/persian/main.php 2012-08-29 20:46:24 UTC (rev 10135) +++ XoopsModules/newbb/branches/irmtfan/newbb/language/persian/main.php 2012-08-30 07:57:41 UTC (rev 10136) @@ -486,4 +486,6 @@ define('_MD_NEWBB_MAXPIC','تصاویر در حداکثر اندازه خود میتوانند %s X %s پیکسل داشته باشند.'); define('_MD_NEWBB_SEARCHDISABLED','امکان جستجو در سایت غیر فعال شده است. برای فعال کردن آن به مدیریت سیستم مراجعه کنید.'); define('_MD_NEWBB_HIDEUSERDATA','مخفی کردن اطلاعات کاربر'); +define('_MD_NEWBB_HIDE','مخفی کردن'); +define('_MD_NEWBB_SEE','نمایش'); ?> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/english/style.css =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/english/style.css 2012-08-29 20:46:24 UTC (rev 10135) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/english/style.css 2012-08-30 07:57:41 UTC (rev 10136) @@ -107,6 +107,8 @@ div.signature { bottom: 10px; + border-top-width:1px; + border-top-style: inherit; } div#index_welcome{ @@ -293,6 +295,7 @@ padding: 5px; margin-top: 10px; border:1px solid #000; + font-size: small; } .post_ip { float: right; Added: XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/english/t_qr_expand.png =================================================================== (Binary files differ) Property changes on: XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/english/t_qr_expand.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/style.css =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/style.css 2012-08-29 20:46:24 UTC (rev 10135) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/style.css 2012-08-30 07:57:41 UTC (rev 10136) @@ -107,6 +107,8 @@ div.signature { bottom: 10px; + border-top-width:1px; + border-top-style: inherit; } div#index_welcome{ @@ -293,6 +295,7 @@ padding: 5px; margin-top: 10px; border:1px solid #000; + font-size: small; } .post_ip { float: /*irmtfan right*/ left; Added: XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/t_qr_expand.png =================================================================== (Binary files differ) Property changes on: XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/t_qr_expand.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_index.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_index.html 2012-08-29 20:46:24 UTC (rev 10135) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_index.html 2012-08-30 07:57:41 UTC (rev 10136) @@ -44,7 +44,10 @@ <table class="index_category" cellspacing="0" width="100%"> <tr class="head"> <td width="3%" valign="middle" align="center"> - <img onclick="ToggleBlockCategory('<{$category.cat_element_id}>', this, '<{$category_icon.expand}>', '<{$category_icon.collapse}>')" src="<{$category.cat_icon_display}>" alt="" /> +<!-- irmtfan simplify onclick method and use newbb_displayImage(this.children[0] for IE7&8) - add alt and title"--> + <div class="pointer" onclick="ToggleBlockCategory('<{$category.cat_element_id}>',(this.firstElementChild || this.children[0]) , '<{$category_icon.expand}>', '<{$category_icon.collapse}>','<{$smarty.const._MD_NEWBB_HIDE}>','<{$smarty.const._MD_NEWBB_SEE}>')"> + <{$category.cat_displayImage}> + </div> </td> <{if $category.cat_image}> <td width="8%"><img src="<{$category.cat_image}>" alt="<{$category.cat_title}>" /></td> Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_thread.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_thread.html 2012-08-29 20:46:24 UTC (rev 10135) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_thread.html 2012-08-30 07:57:41 UTC (rev 10136) @@ -32,23 +32,13 @@ <br /><{$anonym_avatar}> <{/if}> <br /> - <{if $infobox gt 0}> - <!-- irmtfan simplify onclick method remove hardcode style="padding:2px;"--> - <div class="pointer"> - <img onclick="ToggleBlockCategory('<{$topic_post.post_id}>', this, '<{$xoops_url}><{$icon_path}>/less.png', '<{$xoops_url}><{$icon_path}>/more.png','<{$smarty.const._MD_NEWBB_HIDEUSERDATA}>','<{$smarty.const._MD_NEWBB_SEEUSERDATA}>')" - <{if $infobox == 1}> - src="<{$xoops_url}><{$icon_path}>/more.png" alt="<{$smarty.const._MD_NEWBB_SEEUSERDATA}>" title="<{$smarty.const._MD_NEWBB_SEEUSERDATA}>" - <{else}> - src="<{$xoops_url}><{$icon_path}>/less.png" alt="<{$smarty.const._MD_NEWBB_HIDEUSERDATA}>" title="<{$smarty.const._MD_NEWBB_HIDEUSERDATA}>" - <{/if}> - /> - </div> - <div id="<{$topic_post.post_id}>" - <{if $infobox == 1}> style="display: none;" - <{else}> style="display:block;" - <{/if}> - > - <div class="comUserStat"><span class="comUserStatCaption"><{$smarty.const._MD_JOINED}>:</span><br /><{$topic_post.poster.regdate}></div> + <{if $infobox.show}> + <!-- irmtfan simplify onclick method (this.children[0] for IE7&8) - remove hardcode style="padding:2px;"--> + <span class="pointer" onclick="ToggleBlockCategory('<{$topic_post.post_id}>',(this.firstElementChild || this.children[0]) , '<{$infobox.icon.expand}>', '<{$infobox.icon.collapse}>','<{$smarty.const._MD_NEWBB_HIDEUSERDATA}>','<{$smarty.const._MD_NEWBB_SEEUSERDATA}>')"> + <{$infobox.displayImage}> + </span> + <div id="<{$topic_post.post_id}>" style="display: <{$infobox.style}>" > + <div class="comUserStat"><span class="comUserStatCaption"><{$smarty.const._MD_JOINED}>:</span><br /><{$topic_post.poster.regdate}></div> <{if $topic_post.poster.from}> <div class="comUserStat"><span class="comUserStatCaption"><{$smarty.const._MD_FROM}></span> <{$topic_post.poster.from}></div> <{/if}> @@ -104,7 +94,8 @@ <br /> <!-- irmtfan hardcode removed style="float: right; padding: 5px; margin-top: 10px; border:1px solid #000;" --> <div class="post_edit"> - <small><{$topic_post.post_edit}></small> + <!-- irmtfan hardcode removed --> + <{$topic_post.post_edit}> </div> <{/if}> </td> @@ -118,8 +109,8 @@ <{/if}> <{if $topic_post.post_signature}> <div class="signature"> - ____________________<br /> - <{$topic_post.post_signature}> + <!-- irmtfan hardcode removed hardcode ____________________<br /> --> + <{$topic_post.post_signature}> </div> <{/if}> </td> Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html 2012-08-29 20:46:24 UTC (rev 10135) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html 2012-08-30 07:57:41 UTC (rev 10136) @@ -212,10 +212,13 @@ <{if $quickreply.show}> <div> - <a href="#threadbottom" onclick="ToggleBlock('qr', this)"> <{$quickreply.icon}></a> + <!-- irmtfan improve toggle method to ToggleBlockCategory (this.children[0] for IE7&8) change display to style and icon to displayImage for more comprehension --> + <a href="#threadbottom" onclick="ToggleBlockCategory('qr', (this.firstElementChild || this.children[0]), '<{$quickreply.icon.expand}>', '<{$quickreply.icon.collapse}>','<{$smarty.const._MD_NEWBB_HIDE}> <{$smarty.const._MD_QUICKREPLY}>','<{$smarty.const._MD_NEWBB_SEE}> <{$smarty.const._MD_QUICKREPLY}>')" > + <{$quickreply.displayImage}> + </a> </div> <br /> - <div id="qr" style="display: <{$quickreply.display}>"> + <div id="qr" style="display: <{$quickreply.style}>"> <div><{$quickreply.form}></div> </div> <br /> @@ -248,9 +251,9 @@ <br /> <{includeq file='db:newbb_notification_select.html'}> +<!-- irmtfan remove <script type="text/javascript"> -<!-- -xoopsGetElementById('aktuell').scrollIntoView(true); ---> -</script> \ No newline at end of file +<!--xoopsGetElementById('aktuell').scrollIntoView(true); +</script> +--> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/viewtopic.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/viewtopic.php 2012-08-29 20:46:24 UTC (rev 10135) +++ XoopsModules/newbb/branches/irmtfan/newbb/viewtopic.php 2012-08-30 07:57:41 UTC (rev 10136) @@ -127,16 +127,37 @@ $online_handler->init($forum_obj, $topic_obj); $xoopsTpl->assign('online', $online_handler->show_online()); } - -$infobox = intval($xoopsModuleConfig['show_infobox']); //4.05 -$xoopsTpl->assign('infobox', $infobox); //4.05 $xoopsTpl->assign("parentforum", $forum_handler->getParents($forum_obj)); // irmtfan - remove icon_path and use newbb_displayImage $xoopsTpl->assign("anonym_avatar", newbb_displayImage('anonym')); -// icon_path use for infobox onclick image more/less -$icon_handler = newbb_getIconHandler(); -$xoopsTpl->assign("icon_path", $icon_handler->getPath("icon")); +// START irmtfan improve infobox +$infobox= array(); +$infobox['show'] = intval($xoopsModuleConfig['show_infobox']); //4.05 +// irmtfan removed then define after array +//$xoopsTpl->assign('infobox', $infobox); //4.05 +$icon_handler = newbb_getIconHandler(); // can be use in the follwing codes in this file + +if ($infobox['show'] > 0) { + // irmtfan - remove icon_path and use newbb_displayImage + $infobox['icon'] = array( + "expand" => $icon_handler->getImageSource("less"), + "collapse" => $icon_handler->getImageSource("more")) + ; + if($infobox['show'] == 1){ + $infobox['style']='none;'; + $infobox['alt'] = _MD_NEWBB_SEEUSERDATA; + $infobox['src']="more"; + } else { + $infobox['style']='block;'; + $infobox['alt'] = _MD_NEWBB_HIDEUSERDATA; + $infobox['src']="less"; + } + $infobox['displayImage'] = newbb_displayImage($infobox['src'],$infobox['alt']); +} +$xoopsTpl->assign('infobox',$infobox); +// END irmtfan improve infobox + $xoopsTpl->assign(array( 'topic_title' => '<a href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar("dirname", "n").'/viewtopic.php?topic_id='.$topic_id.'">'. $topic_obj->getFullTitle().'</a>', 'forum_name' => $forum_obj->getVar('forum_name'), @@ -622,8 +643,21 @@ $forum_form->addElement($submit_button); $toggles = newbb_getcookie('G', true); - $display = (in_array('qr', $toggles)) ? 'none;' : 'block;'; - $xoopsTpl->assign('quickreply', array( 'show' => 1, 'display' => $display, 'icon' => newbb_displayImage('t_qr',_MD_QUICKREPLY), 'form' => $forum_form->render())); + // START irmtfan improve quickreply smarty variable - add alt key to quick reply button - change $display to $style for more comprehension + $quickreply= array(); + $qr_collapse = "t_qr"; + $qr_expand = "t_qr_expand"; // change this + $quickreply['show']= 1; // could be improved to default = hide = 2 in the future + $quickreply['style'] = (in_array('qr', $toggles)) ? 'none;' : 'block;'; + $quickreply['icon'] = array( + "expand" => $icon_handler->getImageSource($qr_expand), + "collapse" => $icon_handler->getImageSource($qr_collapse)) + ; + // $quickreply['show'] =1 => + $quickreply['displayImage'] = newbb_displayImage($qr_expand,_MD_NEWBB_HIDE.' '._MD_QUICKREPLY); + $quickreply['form'] = $forum_form->render(); + $xoopsTpl->assign('quickreply', $quickreply); + // END irmtfan improve quickreply smarty variable unset($forum_form); } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ir...@us...> - 2012-09-01 08:47:14
|
Revision: 10138 http://xoops.svn.sourceforge.net/xoops/?rev=10138&view=rev Author: irmtfan Date: 2012-09-01 08:47:07 +0000 (Sat, 01 Sep 2012) Log Message: ----------- add toggle $quickreply['expand'], change button to span, add icon.id and innerHTML, remove persian gif images Modified Paths: -------------- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt XoopsModules/newbb/branches/irmtfan/newbb/class/icon.php XoopsModules/newbb/branches/irmtfan/newbb/include/display.php XoopsModules/newbb/branches/irmtfan/newbb/include/js/newbb_toggle.js XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/english/style.css XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/style.css XoopsModules/newbb/branches/irmtfan/newbb/viewtopic.php Removed Paths: ------------- XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/new_forum.gif XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/new_subforum.gif XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/offline.gif XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/online-a.gif XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/p_delete-a.gif XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/p_edit-a.gif XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/p_quote-a.gif XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/p_reply-a.gif XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/p_report-a.gif XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/p_up-a.gif XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/t_new-a.gif XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/t_poll-a.gif XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/t_qr-a.gif XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/t_reply-a.gif Modified: XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt 2012-09-01 06:27:16 UTC (rev 10137) +++ XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt 2012-09-01 08:47:07 UTC (rev 10138) @@ -1,3 +1,17 @@ +date 2012-09-01 +================================================ +1- add toggle $quickreply['expand'] to find quickreply hide/see +newbb/viewtopic.php + +2- add alt and title to text links - change <button> html tag to <span> class="forum_icon forum_button" to support IE7&8 +newbb/class/icon.php, newbb/templates/images/language/english/style.css, newbb/include/display.php (juct change help comments) + +3- improve ToggleBlockCategory js to change icon.id and use innerHTML instead of textContent to support IE7&8 +newbb/include/js/newbb_toggle.js + +4- remove unneeded gif persian images +newbb/templates/images/language/persian + date 2012-08-30 ================================================ 1- add more and less icons - add t_qr_expand.png image and add show see definitions Modified: XoopsModules/newbb/branches/irmtfan/newbb/class/icon.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/class/icon.php 2012-09-01 06:27:16 UTC (rev 10137) +++ XoopsModules/newbb/branches/irmtfan/newbb/class/icon.php 2012-09-01 08:47:07 UTC (rev 10138) @@ -151,12 +151,12 @@ function assignImage($image, $alt = "", $extra = "") { $this->setImage($image, $alt, $extra); - // START hacked by irmtfan - improve function to CSS3 buttons + // START hacked by irmtfan - improve function to CSS3 buttons - add alt and title attributes - use span instead of button to support IE7&8 $tag="span"; - if (in_array( substr($image,0,2),array('t_','p_','up') )) { - $tag="button"; + if (in_array( substr($image,0,2),array('t_','p_','up') ) && $extra === "class='forum_icon'") { + $extra ="class='forum_icon forum_button'"; } - return "<{$tag} align=\"middle\" {$extra} id={$image}>$alt</{$tag}>"; + return "<{$tag} alt=\"{$alt}\" title=\"{$alt}\" align=\"middle\" {$extra} id={$image}>$alt</{$tag}>"; // END hacked by irmtfan - improve function to CSS3 buttons } Modified: XoopsModules/newbb/branches/irmtfan/newbb/include/display.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/include/display.php 2012-09-01 06:27:16 UTC (rev 10137) +++ XoopsModules/newbb/branches/irmtfan/newbb/include/display.php 2012-09-01 08:47:07 UTC (rev 10138) @@ -32,14 +32,14 @@ eg: For buttons: all buttons: - button.forum_icon - button.forum_icon:hover - button.forum_icon:active + span.forum_icon.forum_button + span.forum_icon.forum_button:hover + span.forum_icon.forum_button:active each button (p_edit): - button.forum_icon#p_edit - button.forum_icon#p_edit:hover - button.forum_icon#p_edit:active + span.forum_icon.forum_button#p_edit + span.forum_icon.forum_button#p_edit:hover + span.forum_icon.forum_button#p_edit:active For other images: all images: Modified: XoopsModules/newbb/branches/irmtfan/newbb/include/js/newbb_toggle.js =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/include/js/newbb_toggle.js 2012-09-01 06:27:16 UTC (rev 10137) +++ XoopsModules/newbb/branches/irmtfan/newbb/include/js/newbb_toggle.js 2012-09-01 08:47:07 UTC (rev 10138) @@ -61,7 +61,7 @@ } } } - +// START irmtfan - improve: add alt, title, id and innerHTML - recognize a IMG tag for src function ToggleBlockCategory(block, icon, src_expand, src_collapse, alt_expand, alt_collapse) { var Img_tag='IMG'; @@ -74,6 +74,7 @@ icon.src = src_collapse; } icon.alt= alt_collapse; + icon.id = findBaseName(src_collapse); SaveCollapsed(block, true); } else @@ -83,6 +84,7 @@ icon.src = src_expand; } icon.alt= alt_expand; + icon.id = findBaseName(src_expand); SaveCollapsed(block, false); } } @@ -95,6 +97,7 @@ icon.src = src_collapse; } icon.alt= alt_collapse; + icon.id = findBaseName(src_collapse); SaveCollapsed(block, true); } else @@ -104,14 +107,21 @@ icon.src = src_expand; } icon.alt= alt_expand; + icon.id = findBaseName(src_expand); SaveCollapsed(block, false); } } icon.title = icon.alt; - icon.textContent=icon.title; + icon.innerHTML=icon.alt; // to support IE7&8 use innerHTML istead of textContent } +// source: http://stackoverflow.com/questions/1991608/find-base-name-in-url-in-javascript +function findBaseName(url) { + var fileName = url.substring(url.lastIndexOf('/') + 1); + var dot = fileName.lastIndexOf('.'); + return dot == -1 ? fileName : fileName.substring(0, dot); +} +// END irmtfan - improve: add alt, title and innerHTML - recognize a IMG tag for src - function SaveCollapsed(objid, addcollapsed) { var collapsed = GetCookie(toggle_cookie); @@ -174,4 +184,4 @@ } } return null; -} +} \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/english/style.css =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/english/style.css 2012-09-01 06:27:16 UTC (rev 10137) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/english/style.css 2012-09-01 08:47:07 UTC (rev 10138) @@ -325,12 +325,12 @@ } /* irmtfan source: http://jsfiddle.net/VTLmj/ you can customize each button like this: -button.forum_icon#p_edit -button.forum_icon#p_edit:hover -button.forum_icon#p_edit:active +span.forum_icon.forum_button#p_edit +span.forum_icon.forum_button#p_edit:hover +span.forum_icon.forum_button#p_edit:active find all image names in newbb/include/images.php */ -button.forum_icon { +span.forum_icon.forum_button { background: #407DC7; background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#407DC7), to(#4279B8)); background-image: -webkit-linear-gradient(top, #407DC7, #4279B8); @@ -345,16 +345,14 @@ border-style: solid; border-radius: 5px; box-shadow: 0 1px 7px #080808; -font-family: Tahoma; +font-weight: bold; } -button.forum_icon:hover { +span.forum_icon.forum_button:hover { box-shadow: 0 1px 5px #222; } - -button.forum_icon:active { +span.forum_icon.forum_button:active { box-shadow: inset 0 1px 7px #565656; -border-width: 1px; border-color: white #a1c1e6 black #a1c1e6; -border-style: solid; +font-weight: normal; } /* color - end */ \ No newline at end of file Deleted: XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/new_forum.gif =================================================================== (Binary files differ) Deleted: XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/new_subforum.gif =================================================================== (Binary files differ) Deleted: XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/offline.gif =================================================================== (Binary files differ) Deleted: XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/online-a.gif =================================================================== (Binary files differ) Deleted: XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/p_delete-a.gif =================================================================== (Binary files differ) Deleted: XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/p_edit-a.gif =================================================================== (Binary files differ) Deleted: XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/p_quote-a.gif =================================================================== (Binary files differ) Deleted: XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/p_reply-a.gif =================================================================== (Binary files differ) Deleted: XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/p_report-a.gif =================================================================== (Binary files differ) Deleted: XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/p_up-a.gif =================================================================== (Binary files differ) Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/style.css =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/style.css 2012-09-01 06:27:16 UTC (rev 10137) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/style.css 2012-09-01 08:47:07 UTC (rev 10138) @@ -328,12 +328,12 @@ } /* irmtfan source: http://jsfiddle.net/VTLmj/ you can customize each button like this: -button.forum_icon#p_edit -button.forum_icon#p_edit:hover -button.forum_icon#p_edit:active +span.forum_icon.forum_button#p_edit +span.forum_icon.forum_button#p_edit:hover +span.forum_icon.forum_button#p_edit:active find all image names in newbb/include/images.php */ -button.forum_icon { +span.forum_icon.forum_button { background: #407DC7; background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#407DC7), to(#4279B8)); background-image: -webkit-linear-gradient(top, #407DC7, #4279B8); @@ -348,16 +348,14 @@ border-style: solid; border-radius: 5px; box-shadow: 0 1px 7px #080808; -font-family: Tahoma; +font-weight: bold; } -button.forum_icon:hover { +span.forum_icon.forum_button:hover { box-shadow: 0 1px 5px #222; } - -button.forum_icon:active { +span.forum_icon.forum_button:active { box-shadow: inset 0 1px 7px #565656; -border-width: 1px; border-color: white #a1c1e6 black #a1c1e6; -border-style: solid; +font-weight: normal; } /* color - end */ \ No newline at end of file Deleted: XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/t_new-a.gif =================================================================== (Binary files differ) Deleted: XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/t_poll-a.gif =================================================================== (Binary files differ) Deleted: XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/t_qr-a.gif =================================================================== (Binary files differ) Deleted: XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/t_reply-a.gif =================================================================== (Binary files differ) Modified: XoopsModules/newbb/branches/irmtfan/newbb/viewtopic.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/viewtopic.php 2012-09-01 06:27:16 UTC (rev 10137) +++ XoopsModules/newbb/branches/irmtfan/newbb/viewtopic.php 2012-09-01 08:47:07 UTC (rev 10138) @@ -643,18 +643,26 @@ $forum_form->addElement($submit_button); $toggles = newbb_getcookie('G', true); - // START irmtfan improve quickreply smarty variable - add alt key to quick reply button - change $display to $style for more comprehension + // START irmtfan improve quickreply smarty variable - add alt key to quick reply button - change $display to $style for more comprehension - add toggle $quickreply['expand'] $quickreply= array(); $qr_collapse = "t_qr"; $qr_expand = "t_qr_expand"; // change this - $quickreply['show']= 1; // could be improved to default = hide = 2 in the future - $quickreply['style'] = (in_array('qr', $toggles)) ? 'none;' : 'block;'; $quickreply['icon'] = array( "expand" => $icon_handler->getImageSource($qr_expand), "collapse" => $icon_handler->getImageSource($qr_collapse)) ; - // $quickreply['show'] =1 => - $quickreply['displayImage'] = newbb_displayImage($qr_expand,_MD_NEWBB_HIDE.' '._MD_QUICKREPLY); + $quickreply['show'] = 1; // = !empty($xoopsModuleConfig['quickreply_enabled'] + $quickreply['expand'] = (count($toggles) > 0) ? ( (in_array('qr', $toggles)) ? false : true ) : true; + if ($quickreply['expand']) { + $quickreply['style'] = 'block;'; + $quickreply_icon_display = $qr_expand; + $quickreply_alt = _MD_NEWBB_HIDE.' '._MD_QUICKREPLY; + } else { + $quickreply['style'] = 'none;'; + $quickreply_icon_display = $qr_collapse; + $quickreply_alt = _MD_NEWBB_SEE.' '._MD_QUICKREPLY; + } + $quickreply['displayImage'] = newbb_displayImage($quickreply_icon_display, $quickreply_alt); $quickreply['form'] = $forum_form->render(); $xoopsTpl->assign('quickreply', $quickreply); // END irmtfan improve quickreply smarty variable This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ir...@us...> - 2012-09-05 03:57:26
|
Revision: 10140 http://xoops.svn.sourceforge.net/xoops/?rev=10140&view=rev Author: irmtfan Date: 2012-09-05 03:57:20 +0000 (Wed, 05 Sep 2012) Log Message: ----------- fix onsubmit js in admin mode viewpost and viewtopic Modified Paths: -------------- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewpost.html XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html Modified: XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt 2012-09-04 17:31:14 UTC (rev 10139) +++ XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt 2012-09-05 03:57:20 UTC (rev 10140) @@ -1,3 +1,8 @@ +date 2012-09-05 +================================================ +1- minor bug fix: mistype in viewtopic and viewpost admin mode submit button when admin dont select any action +in newbb_viewpost.html and newbb_viewtopic.html + date 2012-09-01 ================================================ 1- add toggle $quickreply['expand'] to find quickreply hide/see Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewpost.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewpost.html 2012-09-04 17:31:14 UTC (rev 10139) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewpost.html 2012-09-05 03:57:20 UTC (rev 10140) @@ -21,7 +21,8 @@ <{if $viewer_level gt 1}> <div class="right" id="admin"> <{if $mode gt 1}> - <form name="form_posts_admin" action="action.post.php" method="POST" onsubmit="javascript: if(window.document.forum_posts_admin.op.value < 1){return false;}"> + <!-- irmtfan mistype forum_posts_admin => form_posts_admin --> + <form name="form_posts_admin" action="action.post.php" method="POST" onsubmit="javascript: if(window.document.form_posts_admin.op.value < 1){return false;}"> <{$smarty.const._ALL}>: <input type="checkbox" name="post_check" id="post_check" value="1" onclick="xoopsCheckAll('form_posts_admin', 'post_check');" /> <select name="op"> <option value="0"><{$smarty.const._SELECT}></option> Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html 2012-09-04 17:31:14 UTC (rev 10139) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html 2012-09-05 03:57:20 UTC (rev 10140) @@ -53,9 +53,11 @@ <!-- irmtfan hardcode removed style="float: right; text-align: right;" --> <div class="icon_right" id="admin"> <{if $mode gt 1}> - <form name="form_posts_admin" action="topicmanager.php" method="POST" onsubmit="javascript: if(window.document.forum_posts_admin.op.value < 1){return false;}"> + <!-- irmtfan mistype forum_posts_admin => form_posts_admin --> + <form name="form_posts_admin" action="topicmanager.php" method="POST" onsubmit="javascript: if(window.document.form_posts_admin.op.value < 1){return false;}"> <{$smarty.const._ALL}>: <input type="checkbox" name="post_check" id="post_check" value="1" onclick="xoopsCheckAll('form_posts_admin', 'post_check');" /> - <select name="mode"> + <!-- irmtfan mistype mode => op --> + <select name="op"> <option value="0"><{$smarty.const._SELECT}></option> <option value="delete"><{$smarty.const._DELETE}></option> <{if $status eq "pending"}> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ir...@us...> - 2012-09-09 08:06:38
|
Revision: 10159 http://xoops.svn.sourceforge.net/xoops/?rev=10159&view=rev Author: irmtfan Date: 2012-09-09 08:06:31 +0000 (Sun, 09 Sep 2012) Log Message: ----------- fix onclick xoopsCheckAll in viewtopic.php, add alt to down prev and next icons, modify presian language Modified Paths: -------------- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt XoopsModules/newbb/branches/irmtfan/newbb/language/persian/modinfo.php XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewpost.html XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html XoopsModules/newbb/branches/irmtfan/newbb/viewtopic.php Modified: XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt 2012-09-08 21:49:43 UTC (rev 10158) +++ XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt 2012-09-09 08:06:31 UTC (rev 10159) @@ -1,3 +1,12 @@ +date 2012-09-09 +================== +1- some changes in persian language notifications. +language/persian/modinfo.php +2- add alt to down prev and next and change the templates +newbb/viewtopic.php newbb/templates/newbb_viewpost.html and newbb/templates/newbb_viewtopic.html +3- bug fix: js onclick xoopsCheckAll not work when polls is active in viewtopic admin mode. +newbb/templates/newbb_viewtopic.html + date 2012-09-05 ================================================ 1- minor bug fix: mistype in viewtopic and viewpost admin mode submit button when admin dont select any action Modified: XoopsModules/newbb/branches/irmtfan/newbb/language/persian/modinfo.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/language/persian/modinfo.php 2012-09-08 21:49:43 UTC (rev 10158) +++ XoopsModules/newbb/branches/irmtfan/newbb/language/persian/modinfo.php 2012-09-09 08:06:31 UTC (rev 10159) @@ -184,25 +184,25 @@ // Notification event descriptions and mail templates define ('_MI_NEWBB_THREAD_NOTIFY','عنوان در انجمن'); -define ('_MI_NEWBB_THREAD_NOTIFYDSC',' تنظیمات آگهی رسانی که در عنوان هر انجمن به کار میرود '); +define ('_MI_NEWBB_THREAD_NOTIFYDSC','.تنظیمات آگهی رسانی که در این عنوان به کار میرود'); define ('_MI_NEWBB_FORUM_NOTIFY','انجمن'); -define ('_MI_NEWBB_FORUM_NOTIFYDSC','تنظیمات آگهی رسانی که در هر انجمن به کار میرود'); +define ('_MI_NEWBB_FORUM_NOTIFYDSC','تنطیمات آگهی رسانی که در این انجمن به کار میرود.'); define ('_MI_NEWBB_GLOBAL_NOTIFY','کلی'); -define ('_MI_NEWBB_GLOBAL_NOTIFYDSC','تنظیمات آگهیرسانی به طور کلی'); +define ('_MI_NEWBB_GLOBAL_NOTIFYDSC','تنظیمات آگهی رسانی به طور کلی'); define ('_MI_NEWBB_THREAD_NEWPOST_NOTIFY','پیام جدید'); -define ('_MI_NEWBB_THREAD_NEWPOST_NOTIFYCAP','وقتی پیام جدیدی در هر یک از عنوان های انجمن ها زده شد مرا با خبر کن'); -define ('_MI_NEWBB_THREAD_NEWPOST_NOTIFYDSC','وقتی پیام جدیدی در هر یک از عنوان های انجمن ها زده شد به من ارسال کن'); -define ('_MI_NEWBB_THREAD_NEWPOST_NOTIFYSBJ','[{X_SITENAME}] {X_MODULE} اطلاع رسانی خودکار:پیام جدید در هر عنوان'); -define ('_MI_NEWBB_FORUM_NEWTHREAD_NOTIFY','عنوان در انجمن جدید'); -define ('_MI_NEWBB_FORUM_NEWTHREAD_NOTIFYCAP','وقتی عنوان جدیدی در هر یک از انجمن ها زده شد مرا با خبر کن'); -define ('_MI_NEWBB_FORUM_NEWTHREAD_NOTIFYDSC','وقتی عنوان جدیدی در هر یک از انجمن ها زده شد به من ارسال کن'); -define ('_MI_NEWBB_FORUM_NEWTHREAD_NOTIFYSBJ','[{X_SITENAME}] {X_MODULE} اطلاع رسانی خودکار: عنوان جدید در هر انجمن'); +define ('_MI_NEWBB_THREAD_NEWPOST_NOTIFYCAP','وقتی پست جدیدی در این عنوان ارسال شد مرا با خبر کن.'); +define ('_MI_NEWBB_THREAD_NEWPOST_NOTIFYDSC','وقتی پست جدیدی در این عنوان ارسال شود کاربر را از آن مطلع خواهد کرد'); +define ('_MI_NEWBB_THREAD_NEWPOST_NOTIFYSBJ','[{X_SITENAME}] {X_MODULE} اطلاع رسانی خودکار:پیام جدید در عنوان'); +define ('_MI_NEWBB_FORUM_NEWTHREAD_NOTIFY','عنوان جدید در انجمن'); +define ('_MI_NEWBB_FORUM_NEWTHREAD_NOTIFYCAP','وقتی عنوان جدیدی در این انجمن ارسال شد مرا با خبر کن.'); +define ('_MI_NEWBB_FORUM_NEWTHREAD_NOTIFYDSC','وقتی عنوان جدیدی در این انجمن ارسال شود کاربر از آن مطلع خواهد شد.'); +define ('_MI_NEWBB_FORUM_NEWTHREAD_NOTIFYSBJ','[{X_SITENAME}] {X_MODULE} اطلاع رسانی خودکار: عنوان جدید در این انجمن'); define ('_MI_NEWBB_GLOBAL_NEWFORUM_NOTIFY','انجمن جدید'); -define ('_MI_NEWBB_GLOBAL_NEWFORUM_NOTIFYCAP','وقتی انجمن جدیدی در هر شاخه ایجاد شد مرا با خبر کن'); -define ('_MI_NEWBB_GLOBAL_NEWFORUM_NOTIFYDSC','وقتی انجمن جدیدی در هر شاخه ایجاد شد به من ارسال کن'); +define ('_MI_NEWBB_GLOBAL_NEWFORUM_NOTIFYCAP','وقتی انجمن جدیدی در این شاخه ایجاد شد مرا با خبر کن'); +define ('_MI_NEWBB_GLOBAL_NEWFORUM_NOTIFYDSC','وقتی انجمن جدیدی در این شاخه ایجاد شد به من ارسال کن'); define ('_MI_NEWBB_GLOBAL_NEWFORUM_NOTIFYSBJ','[{X_SITENAME}] {X_MODULE} اطلاع رسانی خودکار:انجمن جدید'); define ('_MI_NEWBB_GLOBAL_NEWPOST_NOTIFY','پیام جدید'); -define ('_MI_NEWBB_GLOBAL_NEWPOST_NOTIFYCAP','برای هر پست جدید مرا با خبر کن'); +define ('_MI_NEWBB_GLOBAL_NEWPOST_NOTIFYCAP','مرا برای هر پست جدیدی با خبر کن'); define ('_MI_NEWBB_GLOBAL_NEWPOST_NOTIFYDSC','هر پست جدید را برای من ارسال کن'); define ('_MI_NEWBB_GLOBAL_NEWPOST_NOTIFYSBJ','[{X_SITENAME}] {X_MODULE} اطلاع رسانی خودکار:پیام جدید'); define ('_MI_NEWBB_FORUM_NEWPOST_NOTIFY','پیام جدید'); @@ -210,7 +210,7 @@ define ('_MI_NEWBB_FORUM_NEWPOST_NOTIFYDSC','هر پیام جدیدی که در همین انجمن زده شد به من ارسال کن'); define ('_MI_NEWBB_FORUM_NEWPOST_NOTIFYSBJ','[{X_SITENAME}] {X_MODULE} اطلاع رسانی خودکار:پیام جدید در انجمن'); define ('_MI_NEWBB_GLOBAL_NEWFULLPOST_NOTIFY','(پیام جدید(متن کامل'); -define ('_MI_NEWBB_GLOBAL_NEWFULLPOST_NOTIFYCAP',' متن کامل هر پیام جدید را به من اطلاع بده '); +define ('_MI_NEWBB_GLOBAL_NEWFULLPOST_NOTIFYCAP','مرا برای هر پیام جدید با خبر کن و متن کامل پست را هم همراه آن ارسال کن.'); define ('_MI_NEWBB_GLOBAL_NEWFULLPOST_NOTIFYDSC','متن کامل هر پیام جدید را به من ارسال کن'); define ('_MI_NEWBB_GLOBAL_NEWFULLPOST_NOTIFYSBJ','[{X_SITENAME}] {X_MODULE} (اطلاع رسانی خودکار:پیام جدید(متن کامل'); define ('_MI_NEWBB_GLOBAL_DIGEST_NOTIFY','خلاصه'); Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewpost.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewpost.html 2012-09-08 21:49:43 UTC (rev 10158) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewpost.html 2012-09-09 08:06:31 UTC (rev 10159) @@ -47,7 +47,8 @@ <br /> <div style="padding: 5px;"> - <a id="threadtop"></a><a href="#threadbottom"><{$smarty.const._MD_BOTTOM}></a> <{$left}> <a href="viewtopic.php?viewmode=flat&order=<{$order_current}>&topic_id=<{$topic_id}>&forum=<{$forum_id}>&move=prev&topic_time=<{$topic_time}>"><{$smarty.const._MD_PREVTOPIC}></a> <{$right}> <a href="viewtopic.php?viewmode=flat&order=<{$order_current}>&topic_id=<{$topic_id}>&forum=<{$forum_id}>&move=next&topic_time=<{$topic_time}>"><{$smarty.const._MD_NEXTTOPIC}></a> + <!-- irmtfan correct prev and next icons --> + <a id="threadtop"></a><{$down}><a href="#threadbottom"><{$smarty.const._MD_BOTTOM}></a> <{$previous}> <a href="viewtopic.php?viewmode=flat&order=<{$order_current}>&topic_id=<{$topic_id}>&forum=<{$forum_id}>&move=prev&topic_time=<{$topic_time}>"><{$smarty.const._MD_PREVTOPIC}></a> <{$next}> <a href="viewtopic.php?viewmode=flat&order=<{$order_current}>&topic_id=<{$topic_id}>&forum=<{$forum_id}>&move=next&topic_time=<{$topic_time}>"><{$smarty.const._MD_NEXTTOPIC}></a> </div> <br /> Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html 2012-09-08 21:49:43 UTC (rev 10158) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html 2012-09-09 08:06:31 UTC (rev 10159) @@ -79,7 +79,8 @@ <{/if}> <div class="clear"></div> <br /> - +<!-- irmtfan add to not show polls in admin mode --> +<{if $mode lte 1}> <{if $topic_poll}> <{if $topic_pollresult}> <{includeq file="db:newbb_poll_results.html" poll=$poll}> @@ -87,13 +88,15 @@ <{includeq file="db:newbb_poll_view.html" poll=$poll}> <{/if}> <{/if}> +<{/if}> <div class="clear"></div> <br /> <div style="padding: 5px;"> <!-- irmtfan hardcode removed style="float: left; text-align:left;"" --> <span class="icon_left"> - <a id="threadtop"></a><a href="#threadbottom"><{$smarty.const._MD_BOTTOM}></a> <{$left}> <a href="viewtopic.php?order=<{$order_current}>&topic_id=<{$topic_id}>&forum=<{$forum_id}>&move=prev"><{$smarty.const._MD_PREVTOPIC}></a> <{$right}> <a href="viewtopic.php?order=<{$order_current}>&topic_id=<{$topic_id}>&forum=<{$forum_id}>&move=next"><{$smarty.const._MD_NEXTTOPIC}></a> + <!-- irmtfan correct prev and next icons --> + <a id="threadtop"></a><{$down}><a href="#threadbottom"><{$smarty.const._MD_BOTTOM}></a> <{$previous}> <a href="viewtopic.php?order=<{$order_current}>&topic_id=<{$topic_id}>&forum=<{$forum_id}>&move=prev"><{$smarty.const._MD_PREVTOPIC}></a> <{$next}> <a href="viewtopic.php?order=<{$order_current}>&topic_id=<{$topic_id}>&forum=<{$forum_id}>&move=next"><{$smarty.const._MD_NEXTTOPIC}></a> </span> <!-- irmtfan hardcode removed style="float: right; text-align:right;"" --> <span class="icon_right"> @@ -195,7 +198,8 @@ <div> <div class="left"> - <a id="threadbottom"></a><a href="#threadtop"><{$smarty.const._MD_TOP}></a> <{$left}> <a href="viewtopic.php?viewmode=flat&order=<{$order_current}>&topic_id=<{$topic_id}>&forum=<{$forum_id}>&move=prev"><{$smarty.const._MD_PREVTOPIC}></a> <{$right}> <a href="viewtopic.php?viewmode=flat&order=<{$order_current}>&topic_id=<{$topic_id}>&forum=<{$forum_id}>&move=next"><{$smarty.const._MD_NEXTTOPIC}></a> + <!-- irmtfan correct prev and next icons --> + <a id="threadbottom"></a><a href="#threadtop"><{$smarty.const._MD_TOP}></a> <{$previous}> <a href="viewtopic.php?viewmode=flat&order=<{$order_current}>&topic_id=<{$topic_id}>&forum=<{$forum_id}>&move=prev"><{$smarty.const._MD_PREVTOPIC}></a> <{$next}> <a href="viewtopic.php?viewmode=flat&order=<{$order_current}>&topic_id=<{$topic_id}>&forum=<{$forum_id}>&move=next"><{$smarty.const._MD_NEXTTOPIC}></a> </div> <!-- irmtfan hardcode removed style="float: right; text-align:right;"" --> <div class="icon_right"> Modified: XoopsModules/newbb/branches/irmtfan/newbb/viewtopic.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/viewtopic.php 2012-09-08 21:49:43 UTC (rev 10158) +++ XoopsModules/newbb/branches/irmtfan/newbb/viewtopic.php 2012-09-09 08:06:31 UTC (rev 10159) @@ -107,7 +107,7 @@ $total_posts = $topic_handler->getPostCount($topic_obj, $status); $postsArray = $topic_handler->getAllPosts($topic_obj, $order, $xoopsModuleConfig['posts_per_page'], $start, $post_id, $status); -//Threadersteller zählt nicht +//Threadersteller zählt nicht if (!$xoopsUser || ($xoopsUser->getVar('uid') != $topic_obj->getVar('topic_poster')) ) { $topic_obj->incrementCounter(); } @@ -517,10 +517,10 @@ $xoopsTpl->assign('rating_enable', $xoopsModuleConfig['rating_enabled']); $xoopsTpl->assign('groupbar_enable', $xoopsModuleConfig['groupbar_enabled']); $xoopsTpl->assign('anonymous_prefix', $xoopsModuleConfig['anonymous_prefix']); - -$xoopsTpl->assign('previous', newbb_displayImage('previous')); -$xoopsTpl->assign('next', newbb_displayImage('next')); -$xoopsTpl->assign('down', newbb_displayImage('down')); +// irmtfan add alt for prev next and down icons. +$xoopsTpl->assign('previous', newbb_displayImage('previous',_MD_PREVTOPIC)); +$xoopsTpl->assign('next', newbb_displayImage('next',_MD_NEXTTOPIC)); +$xoopsTpl->assign('down', newbb_displayImage('down',_MD_BOTTOM)); $xoopsTpl->assign('post_content', newbb_displayImage('post')); if (!empty($xoopsModuleConfig['rating_enabled'])) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ir...@us...> - 2012-09-10 10:57:39
|
Revision: 10170 http://xoops.svn.sourceforge.net/xoops/?rev=10170&view=rev Author: irmtfan Date: 2012-09-10 10:57:32 +0000 (Mon, 10 Sep 2012) Log Message: ----------- bug fix: notification not show in newbb/viewtopic.php?post_id=XXXX URLs need a module update after implementation Modified Paths: -------------- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt XoopsModules/newbb/branches/irmtfan/newbb/xoops_version.php Modified: XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt 2012-09-10 06:44:36 UTC (rev 10169) +++ XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt 2012-09-10 10:57:32 UTC (rev 10170) @@ -1,5 +1,10 @@ date 2012-09-10 =============================== +1- bug fix: notification not show in newbb/viewtopic.php?post_id=XXXX URLs +in newbb/xoops_version.php + +date 2012-09-10 +=============================== 1- back rank_image and rank_title to rank.image rank.title smarty variables to make consistency with old newbb versions. in newbb/class/user.php, newbb/templates/newbb_thread.html Modified: XoopsModules/newbb/branches/irmtfan/newbb/xoops_version.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/xoops_version.php 2012-09-10 06:44:36 UTC (rev 10169) +++ XoopsModules/newbb/branches/irmtfan/newbb/xoops_version.php 2012-09-10 10:57:32 UTC (rev 10170) @@ -721,7 +721,8 @@ $modversion['notification']['category'][1]['title'] = _MI_NEWBB_THREAD_NOTIFY; $modversion['notification']['category'][1]['description'] = _MI_NEWBB_THREAD_NOTIFYDSC; $modversion['notification']['category'][1]['subscribe_from'] = 'viewtopic.php'; -$modversion['notification']['category'][1]['item_name'] = 'topic_id'; +// irmtfan remove because "item_name" can be "topic_id" and/or "post_id" +// $modversion['notification']['category'][1]['item_name'] = 'topic_id'; $modversion['notification']['category'][1]['allow_bookmark'] = 1; $modversion['notification']['category'][2]['name'] = 'forum'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ir...@us...> - 2012-09-16 04:37:59
|
Revision: 10177 http://xoops.svn.sourceforge.net/xoops/?rev=10177&view=rev Author: irmtfan Date: 2012-09-16 04:37:52 +0000 (Sun, 16 Sep 2012) Log Message: ----------- improve js scroll to current post/topic Modified Paths: -------------- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_thread.html XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html Modified: XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt 2012-09-15 10:51:08 UTC (rev 10176) +++ XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt 2012-09-16 04:37:52 UTC (rev 10177) @@ -1,3 +1,8 @@ +date 2012-09-16 +=================================== +1- improve: Add forum_post_prefix smarty variable to have unique Ids for posts. Add js function to scroll to current post in viewtopic.php links. +in newbb/templates/newbb_thread.html , newbb/templates/newbb_viewtopic.html + date 2012-09-11 =============================== 1- bug fix: viewtopic admin mode action incorrectly on the topic instead of selected posts of the topic.(important) Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_thread.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_thread.html 2012-09-15 10:51:08 UTC (rev 10176) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_thread.html 2012-09-16 04:37:52 UTC (rev 10177) @@ -1,4 +1,14 @@ +<!-- START irmtfan assign forum_post_prefix smarty --> +<{if $forum_post_prefix === null }> + <!-- change the value to what you prefer. even value="" (no prefix) is acceptable --> + <{assign var=forum_post_prefix value="forumpost"}> + <!-- it is the first time then add id=0 for recognizoing top of the topic to scroll when $post_id=0 (just $topic_id in the URL) --> + <div id="<{$forum_post_prefix}>0"></div> +<{/if}> +<!-- END irmtfan assign forum_post_prefix smarty --> +<!-- irmtfan removed <{if $post_id == $topic_post.post_id}><div id="aktuell"></div><{/if}> +--> <table class="outer" cellpadding="0" cellspacing="0" border="0" width="100%" align="center" style="border-bottom-width: 0px;"> <tr> <!-- irmtfan hardcode removed align="left" --> @@ -12,7 +22,8 @@ <!-- irmtfan hardcode removed style="float: right;" --> <div class="ThreadTitle"> <{if $topic_post.post_id > 0}> - <a href="<{$xoops_url}>/modules/<{$xoops_dirname}>/viewtopic.php?post_id=<{$topic_post.post_id}>">#<{$topic_post.post_no}></a> + <!-- irmtfan add id for each post --> + <a id="<{$forum_post_prefix}><{$topic_post.post_id}>" href="<{$xoops_url}>/modules/<{$xoops_dirname}>/viewtopic.php?post_id=<{$topic_post.post_id}>">#<{$topic_post.post_no}></a> <{/if}> </div> </th> Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html 2012-09-15 10:51:08 UTC (rev 10176) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html 2012-09-16 04:37:52 UTC (rev 10177) @@ -162,7 +162,9 @@ <div class="resultMsg"><{$smarty.const._MD_TOPICLOCK}></div> <br /> <{/if}> +<!-- irmtfan remove here and move to the newbb_thread.html <{if $post_id == 0}><div id="aktuell"></div><{/if}> +--> <{foreachq item=topic_post from=$topic_posts}> <{includeq file="db:newbb_thread.html" topic_post=$topic_post mode=$mode}> <br /> @@ -262,4 +264,14 @@ <script type="text/javascript"> <!--xoopsGetElementById('aktuell').scrollIntoView(true); </script> ---> \ No newline at end of file +--> +<!-- START irmtfan add scroll js function to scroll down to current post or top of the topic --> +<script type="text/javascript"> +if (document.body.scrollIntoView && window.location.href.indexOf('#') == -1){ + var el = xoopsGetElementById('<{$forum_post_prefix}><{$post_id}>'); + if (el){ + el.scrollIntoView(true); + } +} +</script> +<!-- END irmtfan add scroll js function to scroll down to current post or top of the topic --> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ir...@us...> - 2012-09-19 10:47:10
|
Revision: 10185 http://xoops.svn.sourceforge.net/xoops/?rev=10185&view=rev Author: irmtfan Date: 2012-09-19 10:47:00 +0000 (Wed, 19 Sep 2012) Log Message: ----------- fix bug: delete child posts first, pagenav select, missing xoops_module_header smarty Modified Paths: -------------- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt XoopsModules/newbb/branches/irmtfan/newbb/class/post.php XoopsModules/newbb/branches/irmtfan/newbb/edit.php XoopsModules/newbb/branches/irmtfan/newbb/newtopic.php XoopsModules/newbb/branches/irmtfan/newbb/post.php XoopsModules/newbb/branches/irmtfan/newbb/reply.php XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewall.html XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewforum.html XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewpost.html XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html Modified: XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt 2012-09-18 09:51:54 UTC (rev 10184) +++ XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt 2012-09-19 10:47:00 UTC (rev 10185) @@ -1,3 +1,16 @@ +date 2012-09-19 +=================================== +1- bug fix: in post delete process: wrongly delete parent post before childs but the right way is deleting childs before deleting parent post.(reverse order deleting) +in newbb/class/post.php + +2- bug fix: solve nested forms issue when the pagenav type is select +in newbb/templates/newbb_viewall.html, newbb/templates/newbb_viewforum.html, +newbb/templates/newbb_viewpost.html, newbb/templates/newbb_viewtopic.html + +3- bug fix: xoops_module_header smarty variable is missing. +newbb/edit.php, newbb/newtopic.php, newbb/post.php, newbb/reply.php + + date 2012-09-18 =================================== 1- bug fix: in topic delete process: in view all and view forum: after delete selected topics all topics and their posts will be wrongly deleted from database.(very important) Modified: XoopsModules/newbb/branches/irmtfan/newbb/class/post.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/class/post.php 2012-09-18 09:51:54 UTC (rev 10184) +++ XoopsModules/newbb/branches/irmtfan/newbb/class/post.php 2012-09-19 10:47:00 UTC (rev 10185) @@ -810,7 +810,8 @@ require_once XOOPS_ROOT_PATH . "/class/xoopstree.php"; $mytree = new XoopsTree($this->db->prefix("bb_posts"), "post_id", "pid"); $arr = $mytree->getAllChild($post->getVar('post_id')); - for ($i = 0; $i < count($arr); $i++) { + // irmtfan - delete childs in a reverse order + for ($i = count($arr) - 1; $i >= 0 ; $i--) { $childpost =& $this->create(false); $childpost->assignVars($arr[$i]); $this->_delete($childpost, $force); Modified: XoopsModules/newbb/branches/irmtfan/newbb/edit.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/edit.php 2012-09-18 09:51:54 UTC (rev 10184) +++ XoopsModules/newbb/branches/irmtfan/newbb/edit.php 2012-09-19 10:47:00 UTC (rev 10185) @@ -75,7 +75,10 @@ $xoopsOption['template_main'] = 'newbb_edit_post.html'; $xoopsConfig["module_cache"][$xoopsModule->getVar("mid")] = 0; +// irmtfan add xoops_module_header +$xoopsOption['xoops_module_header']= $xoops_module_header; include XOOPS_ROOT_PATH.'/header.php'; +$xoopsTpl->assign('xoops_module_header', $xoops_module_header); /* $xoopsTpl->assign('lang_forum_index', sprintf(_MD_FORUMINDEX, htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES))); Modified: XoopsModules/newbb/branches/irmtfan/newbb/newtopic.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/newtopic.php 2012-09-18 09:51:54 UTC (rev 10184) +++ XoopsModules/newbb/branches/irmtfan/newbb/newtopic.php 2012-09-19 10:47:00 UTC (rev 10185) @@ -50,7 +50,10 @@ $xoopsOption['template_main'] = 'newbb_edit_post.html'; $xoopsConfig["module_cache"][$xoopsModule->getVar("mid")] = 0; // Disable cache +// irmtfan add xoops_module_header +$xoopsOption['xoops_module_header']= $xoops_module_header; include XOOPS_ROOT_PATH.'/header.php'; +$xoopsTpl->assign('xoops_module_header', $xoops_module_header); /* $xoopsTpl->assign('lang_forum_index', sprintf(_MD_FORUMINDEX, htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES))); Modified: XoopsModules/newbb/branches/irmtfan/newbb/post.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/post.php 2012-09-18 09:51:54 UTC (rev 10184) +++ XoopsModules/newbb/branches/irmtfan/newbb/post.php 2012-09-19 10:47:00 UTC (rev 10185) @@ -411,7 +411,10 @@ $xoopsOption['template_main'] = 'newbb_edit_post.html'; $xoopsConfig["module_cache"][$xoopsModule->getVar("mid")] = 0; +// irmtfan add xoops_module_header +$xoopsOption['xoops_module_header']= $xoops_module_header; include XOOPS_ROOT_PATH . "/header.php"; +$xoopsTpl->assign('xoops_module_header', $xoops_module_header); if ( !empty($_POST['contents_upload']) ) { $attachments_tmp = array(); Modified: XoopsModules/newbb/branches/irmtfan/newbb/reply.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/reply.php 2012-09-18 09:51:54 UTC (rev 10184) +++ XoopsModules/newbb/branches/irmtfan/newbb/reply.php 2012-09-19 10:47:00 UTC (rev 10185) @@ -86,7 +86,10 @@ $xoopsOption['template_main'] = 'newbb_edit_post.html'; $xoopsConfig["module_cache"][$xoopsModule->getVar("mid")] = 0; +// irmtfan add xoops_module_header +$xoopsOption['xoops_module_header']= $xoops_module_header; include XOOPS_ROOT_PATH.'/header.php'; +$xoopsTpl->assign('xoops_module_header', $xoops_module_header); /* $xoopsTpl->assign('lang_forum_index', sprintf(_MD_FORUMINDEX, htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES))); Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewall.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewall.html 2012-09-18 09:51:54 UTC (rev 10184) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewall.html 2012-09-19 10:47:00 UTC (rev 10185) @@ -123,7 +123,7 @@ </div> <!-- irmtfan hardcode removed style="padding: 5px;float: right; text-align:right;" --> <div class="pagenav"> -<{$pagenav}> +<{$pagenav|replace:'form':'div'}> <!-- irmtfan to solve nested forms issue --> </div> </div> <div class="clear"></div> @@ -203,7 +203,7 @@ <{if $pagenav}> <!-- irmtfan hardcode removed style="padding: 5px;float: right; text-align:right;" --> -<div class="pagenav"><{$pagenav}></div> +<div class="pagenav"><{$pagenav|replace:'form':'div'}> <!-- irmtfan to solve nested forms issue --></div> <br /> <{/if}> <div class="clear"></div> Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewforum.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewforum.html 2012-09-18 09:51:54 UTC (rev 10184) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewforum.html 2012-09-19 10:47:00 UTC (rev 10185) @@ -76,7 +76,7 @@ </div> <!-- irmtfan hardcode removed style="float: right; text-align:right;" --> <div class="icon_right"> - <{$forum_pagenav}> + <{$forum_pagenav|replace:'form':'div'}> <!-- irmtfan to solve nested forms issue --> </div> </div> <div class="clear"></div> @@ -184,7 +184,7 @@ <{$forum_addpoll}> <{$forum_post_or_register}> </div> <div class="right"> - <{$forum_pagenav}> + <{$forum_pagenav|replace:'form':'div'}> <!-- irmtfan to solve nested forms issue --> </div> </div> <div class="clear"></div> Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewpost.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewpost.html 2012-09-18 09:51:54 UTC (rev 10184) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewpost.html 2012-09-19 10:47:00 UTC (rev 10185) @@ -82,7 +82,7 @@ </div> <!-- irmtfan hardcode removed style="padding: 5px;float: right; text-align:right;" --> <div class="pagenav"> - <{$pagenav}> + <{$pagenav|replace:'form':'div'}> <!-- irmtfan to solve nested forms issue --> </div> </div> <div class="clear"></div> @@ -116,7 +116,7 @@ </div> <!-- irmtfan hardcode removed style="float: right; text-align:right;" --> <div class="icon_right"> - <{$pagenav}> + <{$pagenav|replace:'form':'div'}> <!-- irmtfan to solve nested forms issue --> </div> </div> <div class="clear"></div> Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html 2012-09-18 09:51:54 UTC (rev 10184) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html 2012-09-19 10:47:00 UTC (rev 10185) @@ -151,7 +151,7 @@ </div> <!-- irmtfan hardcode removed style="float: right; text-align:right;" --> <div class="icon_right"> - <{$forum_page_nav}> + <{$forum_page_nav|replace:'form':'div'}> <!-- irmtfan to solve nested forms issue --> </div> </div> <div class="clear"></div> @@ -205,7 +205,7 @@ </div> <!-- irmtfan hardcode removed style="float: right; text-align:right;"" --> <div class="icon_right"> - <{$forum_page_nav}> + <{$forum_page_nav|replace:'form':'div'}> <!-- irmtfan to solve nested forms issue --> </div> </div> <div class="clear"></div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ir...@us...> - 2012-09-25 06:31:53
|
Revision: 10190 http://xoops.svn.sourceforge.net/xoops/?rev=10190&view=rev Author: irmtfan Date: 2012-09-25 06:31:40 +0000 (Tue, 25 Sep 2012) Log Message: ----------- bug fix: add footer.php to read style.css and js files from templates/css and templates/js and add to <head>, days changed to seconds Modified Paths: -------------- XoopsModules/newbb/branches/irmtfan/newbb/action.post.php XoopsModules/newbb/branches/irmtfan/newbb/action.topic.php XoopsModules/newbb/branches/irmtfan/newbb/blocks/newbb_block.php XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt XoopsModules/newbb/branches/irmtfan/newbb/class/icon.php XoopsModules/newbb/branches/irmtfan/newbb/class/post.php XoopsModules/newbb/branches/irmtfan/newbb/class/topic.php XoopsModules/newbb/branches/irmtfan/newbb/edit.php XoopsModules/newbb/branches/irmtfan/newbb/header.php XoopsModules/newbb/branches/irmtfan/newbb/index.php XoopsModules/newbb/branches/irmtfan/newbb/list.topic.php XoopsModules/newbb/branches/irmtfan/newbb/newtopic.php XoopsModules/newbb/branches/irmtfan/newbb/polls.php XoopsModules/newbb/branches/irmtfan/newbb/post.php XoopsModules/newbb/branches/irmtfan/newbb/ratethread.php XoopsModules/newbb/branches/irmtfan/newbb/reply.php XoopsModules/newbb/branches/irmtfan/newbb/search.php XoopsModules/newbb/branches/irmtfan/newbb/topicmanager.php XoopsModules/newbb/branches/irmtfan/newbb/viewforum.php XoopsModules/newbb/branches/irmtfan/newbb/viewpost.php XoopsModules/newbb/branches/irmtfan/newbb/viewtopic.php Added Paths: ----------- XoopsModules/newbb/branches/irmtfan/newbb/footer.php XoopsModules/newbb/branches/irmtfan/newbb/templates/css/ XoopsModules/newbb/branches/irmtfan/newbb/templates/css/index.html XoopsModules/newbb/branches/irmtfan/newbb/templates/css/language/ XoopsModules/newbb/branches/irmtfan/newbb/templates/css/language/english/ XoopsModules/newbb/branches/irmtfan/newbb/templates/css/language/english/index.html XoopsModules/newbb/branches/irmtfan/newbb/templates/css/language/english/style.css XoopsModules/newbb/branches/irmtfan/newbb/templates/css/language/index.html XoopsModules/newbb/branches/irmtfan/newbb/templates/css/language/persian/ XoopsModules/newbb/branches/irmtfan/newbb/templates/css/language/persian/index.html XoopsModules/newbb/branches/irmtfan/newbb/templates/css/language/persian/style.css XoopsModules/newbb/branches/irmtfan/newbb/templates/js/ XoopsModules/newbb/branches/irmtfan/newbb/templates/js/index.html XoopsModules/newbb/branches/irmtfan/newbb/templates/js/language/ XoopsModules/newbb/branches/irmtfan/newbb/templates/js/language/english/ XoopsModules/newbb/branches/irmtfan/newbb/templates/js/language/english/index.html XoopsModules/newbb/branches/irmtfan/newbb/templates/js/language/english/newbb_toggle.js XoopsModules/newbb/branches/irmtfan/newbb/templates/js/language/index.html Removed Paths: ------------- XoopsModules/newbb/branches/irmtfan/newbb/include/js/ XoopsModules/newbb/branches/irmtfan/newbb/include/newbb.htc XoopsModules/newbb/branches/irmtfan/newbb/include/pngbehavior.htc XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/english/style.css XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/style.css Modified: XoopsModules/newbb/branches/irmtfan/newbb/action.post.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/action.post.php 2012-09-24 22:31:08 UTC (rev 10189) +++ XoopsModules/newbb/branches/irmtfan/newbb/action.post.php 2012-09-25 06:31:40 UTC (rev 10190) @@ -207,6 +207,7 @@ } else { redirect_header(XOOPS_URL."/modules/newbb/viewpost.php?uid=$uid", 2, _MD_DBUPDATED); } - +// irmtfan move to footer.php +include_once dirname(__FILE__) . "/footer.php"; include XOOPS_ROOT_PATH.'/footer.php'; ?> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/action.topic.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/action.topic.php 2012-09-24 22:31:08 UTC (rev 10189) +++ XoopsModules/newbb/branches/irmtfan/newbb/action.topic.php 2012-09-25 06:31:40 UTC (rev 10190) @@ -171,6 +171,7 @@ } else { redirect_header(XOOPS_URL."/modules/newbb/viewforum.php?forum=$forum_id", 2, _MD_DBUPDATED); } - +// irmtfan move to footer.php +include_once dirname(__FILE__) . "/footer.php"; include XOOPS_ROOT_PATH.'/footer.php'; ?> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/blocks/newbb_block.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/blocks/newbb_block.php 2012-09-24 22:31:08 UTC (rev 10189) +++ XoopsModules/newbb/branches/irmtfan/newbb/blocks/newbb_block.php 2012-09-25 06:31:40 UTC (rev 10190) @@ -31,9 +31,9 @@ if (!defined('XOOPS_ROOT_PATH')) { exit(); } +// irmtfan use full path because block maybe used outside newbb +include_once XOOPS_ROOT_PATH . "/modules/newbb/include/functions.ini.php"; -include_once dirname(dirname(__FILE__))."/include/functions.ini.php"; - if (defined('NEWBB_BLOCK_DEFINED')) return; define('NEWBB_BLOCK_DEFINED',true); @@ -882,4 +882,6 @@ $tpl->assign('block', $block); $tpl->display('db:newbb_block_author.html'); } +// irmtfan add local stylesheet and js footer.php +include_once XOOPS_ROOT_PATH . "/modules/newbb/footer.php"; ?> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt 2012-09-24 22:31:08 UTC (rev 10189) +++ XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt 2012-09-25 06:31:40 UTC (rev 10190) @@ -1,3 +1,25 @@ +date 2012-09-25 +=================================== +1- bug fix: change the method of adding stylesheet and scripts from overrighting xoops_module_header smarty variable to $xoTheme. +move codes from header.php to the new footer.php file. add local stylesheet and js for newbb blocks outside module space. +modify: +in newbb/action.post.php, newbb/action.topic.php, newbb/edit.php, newbb/header.php, +newbb/index.php, newbb/list.topic.php, newbb/newtopic.php, newbb/polls.php, +newbb/post.php, newbb/action.post.php, newbb/ratethread.php, newbb/reply.php +newbb/search.php, newbb/topicmanager.php, newbb/viewforum.php, newbb/viewpost.php, newbb/viewtopic.php +add: +in newbb/footer.php + +2- improve: move js files from include/js to templates/js/language/LANG. all js files inside language directory will be added to header. +move "style.css" file from templates/images/language/LANG to templates/css/language/LANG. +in newbb/class/icon.php, newbb/footer.php, newbb/templates/js/language/LANG/*.js, newbb/templates/css/language/LANG/style.css + +3- delete unneeded files: +newbb/include/pngbehavior.htc, newbb/include/newbb.htc, newbb/include/js/*.* + +4- bug fix: days should be changed to seconds. +in newbb/class/post.php, newbb/class/topic.php + date 2012-09-19 =================================== 1- bug fix: in post delete process: wrongly delete parent post before childs but the right way is deleting childs before deleting parent post.(reverse order deleting) Modified: XoopsModules/newbb/branches/irmtfan/newbb/class/icon.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/class/icon.php 2012-09-24 22:31:08 UTC (rev 10189) +++ XoopsModules/newbb/branches/irmtfan/newbb/class/icon.php 2012-09-25 06:31:40 UTC (rev 10190) @@ -91,31 +91,32 @@ /** * TODO: get compatible with new theme engine */ - - function getPath(/*$set, */$type, $dirname = "newbb", $default = "") + // START irmtfan - improve to get other "end dirnames" like "css" and "js" - change images with $end_dir + function getPath(/*$set, */$type, $dirname = "newbb", $default = "", $end_dir = "images") { global $xoopsConfig; static $paths; - if (isset($paths[$type])) { - return $paths[$type]; + if (isset($paths[$end_dir . '/' . $type])) { + return $paths[$end_dir . '/' . $type]; } $theme_path = $this->template->currentTheme->path; - $rel_images = "modules/{$dirname}/images"; + $rel_dir = "modules/{$dirname}/{$end_dir}"; - $path = is_dir($theme_path."/{$rel_images}/{$type}/") - ? $theme_path."/{$rel_images}/{$type}" - : ( is_dir(XOOPS_THEME_PATH."/default/{$rel_images}/{$type}/") - ? XOOPS_THEME_PATH."/default/{$rel_images}/{$type}" - : ( empty($default) || is_dir(XOOPS_ROOT_PATH."/modules/{$dirname}/templates/images/{$type}/") - ? XOOPS_ROOT_PATH."/modules/{$dirname}/templates/images/{$type}" - : XOOPS_ROOT_PATH."/modules/{$dirname}/templates/images/{$default}" + $path = is_dir($theme_path."/{$rel_dir}/{$type}/") + ? $theme_path."/{$rel_dir}/{$type}" + : ( is_dir(XOOPS_THEME_PATH."/default/{$rel_dir}/{$type}/") + ? XOOPS_THEME_PATH."/default/{$rel_dir}/{$type}" + : ( empty($default) || is_dir(XOOPS_ROOT_PATH."/modules/{$dirname}/templates/{$end_dir}/{$type}/") + ? XOOPS_ROOT_PATH."/modules/{$dirname}/templates/{$end_dir}/{$type}" + : XOOPS_ROOT_PATH."/modules/{$dirname}/templates/{$end_dir}/{$default}" ) ); - $paths[$type] = str_replace(XOOPS_ROOT_PATH, "", $path); + $paths[$end_dir . '/' . $type] = str_replace(XOOPS_ROOT_PATH, "", $path); - return $paths[$type]; + return $paths[$end_dir . '/' . $type]; } + // END irmtfan - improve to get other "end dirnames" like "css" and "js" - change images with $end_dir function init(/*$set = "default", */$language = "english", $dirname = "newbb") { Modified: XoopsModules/newbb/branches/irmtfan/newbb/class/post.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/class/post.php 2012-09-24 22:31:08 UTC (rev 10189) +++ XoopsModules/newbb/branches/irmtfan/newbb/class/post.php 2012-09-25 06:31:40 UTC (rev 10190) @@ -1018,6 +1018,7 @@ if (!func_num_args()){ $newbbConfig = newbb_load_config(); $expire = isset($newbbConfig["pending_expire"]) ? intval($newbbConfig["pending_expire"]) : 7; + $expire = $expire * 24 * 3600; // days to seconds } if (empty($expire)) return false; $crit_expire = new CriteriaCompo(new Criteria("approved", 0, "<=")); Modified: XoopsModules/newbb/branches/irmtfan/newbb/class/topic.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/class/topic.php 2012-09-24 22:31:08 UTC (rev 10189) +++ XoopsModules/newbb/branches/irmtfan/newbb/class/topic.php 2012-09-25 06:31:40 UTC (rev 10190) @@ -418,6 +418,7 @@ if (!func_num_args()){ $newbbConfig = newbb_load_config(); $expire = isset($newbbConfig["pending_expire"]) ? intval($newbbConfig["pending_expire"]) : 7; + $expire = $expire * 24 * 3600; // days to seconds } if (empty($expire)) return false; $crit_expire = new CriteriaCompo(new Criteria("approved", 0, "<=")); Modified: XoopsModules/newbb/branches/irmtfan/newbb/edit.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/edit.php 2012-09-24 22:31:08 UTC (rev 10189) +++ XoopsModules/newbb/branches/irmtfan/newbb/edit.php 2012-09-25 06:31:40 UTC (rev 10190) @@ -75,10 +75,8 @@ $xoopsOption['template_main'] = 'newbb_edit_post.html'; $xoopsConfig["module_cache"][$xoopsModule->getVar("mid")] = 0; -// irmtfan add xoops_module_header -$xoopsOption['xoops_module_header']= $xoops_module_header; -include XOOPS_ROOT_PATH.'/header.php'; -$xoopsTpl->assign('xoops_module_header', $xoops_module_header); +// irmtfan remove and move to header.php +//include XOOPS_ROOT_PATH.'/header.php'; /* $xoopsTpl->assign('lang_forum_index', sprintf(_MD_FORUMINDEX, htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES))); @@ -146,6 +144,7 @@ ); } $xoopsTpl->assign_by_ref("posts_context", $posts_context); - +// irmtfan move to footer.php +include_once dirname(__FILE__) . "/footer.php"; include XOOPS_ROOT_PATH.'/footer.php'; ?> \ No newline at end of file Added: XoopsModules/newbb/branches/irmtfan/newbb/footer.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/footer.php (rev 0) +++ XoopsModules/newbb/branches/irmtfan/newbb/footer.php 2012-09-25 06:31:40 UTC (rev 10190) @@ -0,0 +1,43 @@ +<?php +/* + You may not change or alter any portion of this comment or credits + of supporting developers from this source code or any supporting source code + which is considered copyrighted (c) material of the original comment or credit authors. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +/** + * @copyright The XUUPS Project http://sourceforge.net/projects/xuups/ + * @license http://www.fsf.org/copyleft/gpl.html GNU public license + * @package NEWBB + * @since 4.3 + * @author irmtfan <ir...@ya...> + * @author The Persian Xoops Support Site<www.xoops.ir> + * @version $Id: footer.php 1.11 2012-09-23 20:24:01 + */ + +defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined"); + +global $xoopsConfig, $xoTheme; + +include_once XOOPS_ROOT_PATH . "/modules/newbb/include/functions.render.php"; +$icon_handler = newbb_getIconHandler(); +// get css rel path from setted language +$css_rel_path=$icon_handler->getPath("language/" . $xoopsConfig['language'], "newbb", "language/english", "css"); +// add local stylesheet +$xoTheme->addStylesheet($css_rel_path . '/style.css'); + +// get js rel path from setted language +$js_rel_path=$icon_handler->getPath("language/" . $xoopsConfig['language'], "newbb", "language/english", "js"); +// add all local js files inside js directory +xoops_load('XoopsLists'); +$allfiles = XoopsLists::getFileListAsArray(XOOPS_ROOT_PATH . $js_rel_path); +foreach ($allfiles as $jsfile) { + if (strtolower(pathinfo($jsfile, PATHINFO_EXTENSION)) === 'js') { + $xoTheme->addScript($js_rel_path . '/' . $jsfile); + } +} +?> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/header.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/header.php 2012-09-24 22:31:08 UTC (rev 10189) +++ XoopsModules/newbb/branches/irmtfan/newbb/header.php 2012-09-25 06:31:40 UTC (rev 10190) @@ -71,8 +71,14 @@ foreach ($xoopsModuleConfig["valid_menumodes"] as $key => $val) { if ($key != $menumode) $menumode_other[] = array("title"=>$val, "link"=>$menu_url.$key); } +// irmtfan new method for add js scripts +global $xoopsTpl; +$xoopsTpl->assign("xoops_module_header",' + <script type="text/javascript">var toggle_cookie="'.$forumCookie['prefix'].'G'.'";</script> + '. @$xoopsTpl->get_template_vars("xoops_module_header")); - +/* START irmtfan remove and move to newbb/footer.php */ +/* $newbb_module_header = ''; $newbb_module_header .= '<link rel="alternate" type="application/rss+xml" title="'.$xoopsModule->getVar("name").'" href="'.XOOPS_URL.'/modules/'.$dirname.'/rss.php" />'; if (!empty($xoopsModuleConfig['pngforie_enabled'])) { @@ -108,6 +114,8 @@ } $xoops_module_header = $newbb_module_header; // for cache hack +*/ +/* END irmtfan remove and move to newbb/footer.php */ if (!empty($xoopsModuleConfig["welcome_forum"]) && is_object($xoopsUser) && !$xoopsUser->getVar('posts')) { mod_loadFunctions("welcome", $dirname); Deleted: XoopsModules/newbb/branches/irmtfan/newbb/include/newbb.htc =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/include/newbb.htc 2012-09-24 22:31:08 UTC (rev 10189) +++ XoopsModules/newbb/branches/irmtfan/newbb/include/newbb.htc 2012-09-25 06:31:40 UTC (rev 10190) @@ -1,89 +0,0 @@ -<attach event="ondocumentready" handler="parseStylesheets" /> -<script language="JScript"> -/** - * Pseudos - V1.30.050121 - hover & active - * --------------------------------------------- - * Peterned - http://www.xs4all.nl/~peterned/ - * (c) 2005 - Peter Nederlof - * - * Credits - Arnoud Berendsen - * - Martin Reurings - * - Robert Hanson - * - * howto: body { behavior:url("csshover.htc"); } - * --------------------------------------------- - */ - -var currentSheet, doc = window.document, activators = { - onhover:{on:'onmouseover', off:'onmouseout'}, - onactive:{on:'onmousedown', off:'onmouseup'} -} - -function parseStylesheets() { - var sheets = doc.styleSheets, l = sheets.length; - for(var i=0; i<l; i++) - parseStylesheet(sheets[i]); -} - function parseStylesheet(sheet) { - if(sheet.imports) { - try { - var imports = sheet.imports, l = imports.length; - for(var i=0; i<l; i++) parseStylesheet(sheet.imports[i]); - } catch(securityException){} - } - - try { - var rules = (currentSheet = sheet).rules, l = rules.length; - for(var j=0; j<l; j++) parseCSSRule(rules[j]); - } catch(securityException){} - } - - function parseCSSRule(rule) { - var select = rule.selectorText, style = rule.style.cssText; - if(!(/(^|\s)(([^a]([^ ]+)?)|(a([^#.][^ ]+)+)):(hover|active)/i).test(select) || !style) return; - - var pseudo = select.replace(/[^:]+:([a-z-]+).*/i, 'on$1'); - var newSelect = select.replace(/(\.([a-z0-9_-]+):[a-z]+)|(:[a-z]+)/gi, '.$2' + pseudo); - var className = (/\.([a-z0-9_-]*on(hover|active))/i).exec(newSelect)[1]; - var affected = select.replace(/:hover.*$/, ''); - var elements = getElementsBySelect(affected); - - currentSheet.addRule(newSelect, style); - for(var i=0; i<elements.length; i++) - new HoverElement(elements[i], className, activators[pseudo]); - } - -function HoverElement(node, className, events) { - if(!node.hovers) node.hovers = {}; - if(node.hovers[className]) return; - node.hovers[className] = true; - node.attachEvent(events.on, - function() { node.className += ' ' + className; }); - node.attachEvent(events.off, - function() { node.className = - node.className.replace(new RegExp('\\s+'+className, 'g'),''); }); -} - -function getElementsBySelect(rule) { - var parts, nodes = [doc]; - parts = rule.split(' '); - for(var i=0; i<parts.length; i++) { - nodes = getSelectedNodes(parts[i], nodes); - } return nodes; -} - function getSelectedNodes(select, elements) { - var result, node, nodes = []; - var classname = (/\.([a-z0-9_-]+)/i).exec(select); - var identify = (/\#([a-z0-9_-]+)/i).exec(select); - var tagName = select.replace(/(\.|\#|\:)[a-z0-9_-]+/i, ''); - for(var i=0; i<elements.length; i++) { - result = tagName? elements[i].all.tags(tagName):elements[i].all; - for(var j=0; j<result.length; j++) { - node = result[j]; - if((identify && node.id != identify[1]) || (classname && !(new RegExp('\\b' + - classname[1] + '\\b').exec(node.className)))) continue; - nodes[nodes.length] = node; - } - } return nodes; - } -</script> \ No newline at end of file Deleted: XoopsModules/newbb/branches/irmtfan/newbb/include/pngbehavior.htc =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/include/pngbehavior.htc 2012-09-24 22:31:08 UTC (rev 10189) +++ XoopsModules/newbb/branches/irmtfan/newbb/include/pngbehavior.htc 2012-09-25 06:31:40 UTC (rev 10190) @@ -1,79 +0,0 @@ -<public:component> -<public:attach event="onpropertychange" onevent="propertyChanged()" /> -<public:attach event="onbeforeprint" for="window" onevent="beforePrint()" /> -<public:attach event="onafterprint" for="window" onevent="afterPrint()" /> -<script> - -/* - * PNG Behavior - * - * This script was created by Erik Arvidsson (erik(at)eae.net) - * for WebFX (http://webfx.eae.net) - * Copyright 2002 - * - * For usage see license at http://webfx.eae.net/license.html - * - * Version: 1.01a - * Created: 2001-??-?? First working version - * Updated: 2002-03-28 Fixed issue when starting with a non png image and - * switching between non png images - * 2003-01-06 Fixed RegExp to correctly work with IE 5.0x - * 2004-04-25 Fixed PNG image printing, eliminated need for external - * GIF file, fixed intermittent uninitialised variable - * error [by AG, <http://www.scss.com.au/family/andrew/> ] - * 2004-09-30 Reverted inline javascript image to transparent GIF. The - * new XP SP2 'security' measures prevented the JS image - * from working. [by AG] - * 2004-10-22 Rewrote fixImage() to try and work around some reported - * problems with PNGs vanishing! [by AG] - * - */ - -var IS_PNG = /\-a\.png$/i; /* <-- NOTE: remove the "\-trans" to process *all* PNGs */ -var supported = /MSIE (5\.5)|[6789]/.test(navigator.userAgent) && navigator.platform == 'Win32'; -var realSrc; -var blankSrc = 'images/blank.gif'; -if (supported) fixImage(); -function propertyChanged() { - if (supported && event.propertyName == 'src' && element.src != blankSrc) { - fixImage(); - } -} -function fixImage() { - if (realSrc && element.src == realSrc) { - // this is an attempt to set the image to itself! - // pointless - leave the filter as-is, restore the blank image - element.src = blankSrc; - } else { - // set the image to something different - if (IS_PNG.test(element.src)) { - // fixable PNG - realSrc = element.src; - element.src = blankSrc; - element.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + realSrc + "',sizingMethod='scale')"; - } else { - // ordinary image - make sure the fix is removed - if (realSrc) { - realSrc = null; - element.runtimeStyle.filter = ''; - } - } - } -} -function beforePrint() { - if (realSrc) { - supported = false; - element.src = realSrc; - element.runtimeStyle.filter = ''; - supported = true; - } -} -function afterPrint() { - if (realSrc) { - var rs = realSrc; - realSrc = null; - element.src = rs; - } -} -</script> -</public:component> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/index.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/index.php 2012-09-24 22:31:08 UTC (rev 10189) +++ XoopsModules/newbb/branches/irmtfan/newbb/index.php 2012-09-25 06:31:40 UTC (rev 10190) @@ -51,20 +51,23 @@ } /* rss feed */ +// irmtfan new method if (!empty($xoopsModuleConfig['rss_enable'])) { - $xoops_module_header .= ' - <link rel="alternate" type="application/rss+xml" title="'.$xoopsModule->getVar('name').'" href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/rss.php" /> - '; + $xoopsTpl->assign("xoops_module_header",' + <link rel="alternate" type="application/xml+rss" title="'.$xoopsModule->getVar('name').'" href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/rss.php" /> + '. @$xoopsTpl->get_template_vars("xoops_module_header")); } $xoopsOption['template_main'] = 'newbb_index.html'; $xoopsOption['xoops_pagetitle'] = $xoops_pagetitle; -$xoopsOption['xoops_module_header'] = $xoops_module_header; -include $GLOBALS['xoops']->path('header.php'); +// irmtfan remove and move to footer.php +//$xoopsOption['xoops_module_header'] = $xoops_module_header; +//include $GLOBALS['xoops']->path('header.php'); mod_loadFunctions("render", "newbb"); $xoopsTpl->assign('xoops_pagetitle', $xoops_pagetitle); -$xoopsTpl->assign('xoops_module_header', $xoops_module_header); +// irmtfan remove and move to footer.php +//$xoopsTpl->assign('xoops_module_header', $xoops_module_header); $xoopsTpl->assign('forum_index_title', $forum_index_title); //if ($xoopsModuleConfig['wol_enabled']) { if (!empty($xoopsModuleConfig['wol_enabled'])) { @@ -260,5 +263,7 @@ "img_forum" => newbb_displayImage('forum', _MD_NONEWPOSTS), 'img_subforum' => newbb_displayImage('subforum'))); +// irmtfan move to footer.php +include_once dirname(__FILE__) . "/footer.php"; include $GLOBALS['xoops']->path('footer.php'); ?> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/list.topic.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/list.topic.php 2012-09-24 22:31:08 UTC (rev 10189) +++ XoopsModules/newbb/branches/irmtfan/newbb/list.topic.php 2012-09-25 06:31:40 UTC (rev 10190) @@ -11,15 +11,17 @@ */ include_once dirname(__FILE__) . "/header.php"; - +// irmtfan new method if (!empty($xoopsModuleConfig['rss_enable'])) { - $xoops_module_header .= '<link rel="alternate" type="application/xml+rss" title="'.$xoopsModule->getVar('name').'" href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/rss.php" />'; + $xoopsTpl->assign("xoops_module_header",' + <link rel="alternate" type="application/xml+rss" title="'.$xoopsModule->getVar('name').'" href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/rss.php" /> + '. @$xoopsTpl->get_template_vars("xoops_module_header")); } -$xoopsOption['xoops_module_header']= $xoops_module_header; +//$xoopsOption['xoops_module_header']= $xoops_module_header; $xoopsOption['template_main'] = 'newbb_viewall.html'; -include XOOPS_ROOT_PATH."/header.php"; +//include XOOPS_ROOT_PATH."/header.php"; -$xoopsTpl->assign('xoops_module_header', $xoops_module_header); +//$xoopsTpl->assign('xoops_module_header', $xoops_module_header); mod_loadFunctions("time", "newbb"); mod_loadFunctions("render", "newbb"); @@ -89,5 +91,7 @@ $xoopsTpl->assign('forum_index_title', $pagetitle); $xoopsTpl->assign('xoops_pagetitle', $pagetitle); +// irmtfan move to footer.php +include_once dirname(__FILE__) . "/footer.php"; include XOOPS_ROOT_PATH."/footer.php"; ?> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/newtopic.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/newtopic.php 2012-09-24 22:31:08 UTC (rev 10189) +++ XoopsModules/newbb/branches/irmtfan/newbb/newtopic.php 2012-09-25 06:31:40 UTC (rev 10190) @@ -50,10 +50,10 @@ $xoopsOption['template_main'] = 'newbb_edit_post.html'; $xoopsConfig["module_cache"][$xoopsModule->getVar("mid")] = 0; // Disable cache -// irmtfan add xoops_module_header -$xoopsOption['xoops_module_header']= $xoops_module_header; -include XOOPS_ROOT_PATH.'/header.php'; -$xoopsTpl->assign('xoops_module_header', $xoops_module_header); +// irmtfan remove and move to footer.php +//$xoopsOption['xoops_module_header']= $xoops_module_header; +//include XOOPS_ROOT_PATH.'/header.php'; +//$xoopsTpl->assign('xoops_module_header', $xoops_module_header); /* $xoopsTpl->assign('lang_forum_index', sprintf(_MD_FORUMINDEX, htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES))); @@ -89,5 +89,7 @@ $post_id = 0; $topic_id = 0; include 'include/form.post.php'; +// irmtfan move to footer.php +include_once dirname(__FILE__) . "/footer.php"; include XOOPS_ROOT_PATH.'/footer.php'; ?> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/polls.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/polls.php 2012-09-24 22:31:08 UTC (rev 10189) +++ XoopsModules/newbb/branches/irmtfan/newbb/polls.php 2012-09-25 06:31:40 UTC (rev 10190) @@ -586,6 +586,7 @@ //include XOOPS_ROOT_PATH . "/footer.php"; //exit(); } - +// irmtfan move to footer.php +include_once dirname(__FILE__) . "/footer.php"; include XOOPS_ROOT_PATH . "/footer.php"; ?> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/post.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/post.php 2012-09-24 22:31:08 UTC (rev 10189) +++ XoopsModules/newbb/branches/irmtfan/newbb/post.php 2012-09-25 06:31:40 UTC (rev 10190) @@ -411,10 +411,10 @@ $xoopsOption['template_main'] = 'newbb_edit_post.html'; $xoopsConfig["module_cache"][$xoopsModule->getVar("mid")] = 0; -// irmtfan add xoops_module_header -$xoopsOption['xoops_module_header']= $xoops_module_header; -include XOOPS_ROOT_PATH . "/header.php"; -$xoopsTpl->assign('xoops_module_header', $xoops_module_header); +// irmtfan remove and move to footer.php +//$xoopsOption['xoops_module_header']= $xoops_module_header; +//include XOOPS_ROOT_PATH . "/header.php"; +//$xoopsTpl->assign('xoops_module_header', $xoops_module_header); if ( !empty($_POST['contents_upload']) ) { $attachments_tmp = array(); @@ -536,6 +536,7 @@ include 'include/form.post.php'; } - +// irmtfan move to footer.php +include_once dirname(__FILE__) . "/footer.php"; include XOOPS_ROOT_PATH . '/footer.php'; ?> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/ratethread.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/ratethread.php 2012-09-24 22:31:08 UTC (rev 10189) +++ XoopsModules/newbb/branches/irmtfan/newbb/ratethread.php 2012-09-25 06:31:40 UTC (rev 10190) @@ -103,6 +103,6 @@ $ratemessage = _MD_VOTEAPPRE . "<br />" . sprintf(_MD_THANKYOU, $xoopsConfig['sitename']); redirect_header("viewtopic.php?topic_id=".$topic_id."&forum=".$forum."", 2, $ratemessage); exit(); - -include 'footer.php'; +// irmtfan enhance include footer.php +include XOOPS_ROOT_PATH.'/footer.php'; ?> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/reply.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/reply.php 2012-09-24 22:31:08 UTC (rev 10189) +++ XoopsModules/newbb/branches/irmtfan/newbb/reply.php 2012-09-25 06:31:40 UTC (rev 10190) @@ -86,10 +86,10 @@ $xoopsOption['template_main'] = 'newbb_edit_post.html'; $xoopsConfig["module_cache"][$xoopsModule->getVar("mid")] = 0; -// irmtfan add xoops_module_header -$xoopsOption['xoops_module_header']= $xoops_module_header; -include XOOPS_ROOT_PATH.'/header.php'; -$xoopsTpl->assign('xoops_module_header', $xoops_module_header); +// irmtfan remove and move to footer.php +//$xoopsOption['xoops_module_header']= $xoops_module_header; +//include XOOPS_ROOT_PATH.'/header.php'; +//$xoopsTpl->assign('xoops_module_header', $xoops_module_header); /* $xoopsTpl->assign('lang_forum_index', sprintf(_MD_FORUMINDEX, htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES))); @@ -192,6 +192,7 @@ ); } $xoopsTpl->assign_by_ref("posts_context", $posts_context); - +// irmtfan move to footer.php +include_once dirname(__FILE__) . "/footer.php"; include XOOPS_ROOT_PATH.'/footer.php'; ?> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/search.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/search.php 2012-09-24 22:31:08 UTC (rev 10189) +++ XoopsModules/newbb/branches/irmtfan/newbb/search.php 2012-09-25 06:31:40 UTC (rev 10190) @@ -39,7 +39,8 @@ $xoopsConfig['module_cache'][$xoopsModule->getVar('mid')] = 0; $xoopsOption['template_main']= 'newbb_search.html'; -include XOOPS_ROOT_PATH.'/header.php'; +// irmtfan remove and move to header.php +//include XOOPS_ROOT_PATH.'/header.php'; mod_loadFunctions("render", "newbb"); mod_loadFunctions("forum", "newbb"); @@ -212,6 +213,7 @@ if ($xoopsConfigSearch['keyword_min'] > 0) { $xoopsTpl->assign("search_rule", sprintf(_SR_KEYIGNORE, $xoopsConfigSearch['keyword_min'])); } - +// irmtfan move to footer.php +include_once dirname(__FILE__) . "/footer.php"; include XOOPS_ROOT_PATH.'/footer.php'; ?> \ No newline at end of file Added: XoopsModules/newbb/branches/irmtfan/newbb/templates/css/index.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/css/index.html (rev 0) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/css/index.html 2012-09-25 06:31:40 UTC (rev 10190) @@ -0,0 +1 @@ +<script>history.go(-1);</script> Added: XoopsModules/newbb/branches/irmtfan/newbb/templates/css/language/english/index.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/css/language/english/index.html (rev 0) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/css/language/english/index.html 2012-09-25 06:31:40 UTC (rev 10190) @@ -0,0 +1 @@ +<script>history.go(-1);</script> Added: XoopsModules/newbb/branches/irmtfan/newbb/templates/css/language/english/style.css =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/css/language/english/style.css (rev 0) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/css/language/english/style.css 2012-09-25 06:31:40 UTC (rev 10190) @@ -0,0 +1,358 @@ +/* -- style.css -- */ +.forum_header { + float : center; + overflow : hidden; + border : 1px solid #aaaaaa; + width : 100%; +} + +.forum_title { + float : left; + text-align : left; + padding : 5px; + width : 100%; + +} + +.forum_title a { + font-weight: bold; +} + + +.forum_stats { + float:center; + overflow:hidden; + text-align:left; + /* border:1px solid #aaaaaa; */ + padding:5px; +} + +.forum_stats_left { + float: left; + text-align: left; + width:45%; +} + +.forum_stats_right { + float: right; + text-align: right; + width:45%; +} + +.forum_body { + margin-top: -10px; + padding-top: 20px; + float:center; + width:99%; + overflow:hidden; +} + +.forum_footer { + float:center; + width:99%; + overflow:hidden; +} + +.index_category{ + border: 0px; + /*margin-top: -10px; + margin-bottom: 5px;*/ +} + +.ThreadUserName a { + font-weight: bold; + margin-bottom: 2px; + /*color: #000; irmtfan */ +} + +.ThreadTitle, .ThreadTitle a{ + font-weight: bold; + margin-bottom: 2px; + /*color: #fff; irmtfan */ +} + +.icon_left { + float: left; text-align: left; +} + +.icon_right { + float: right; text-align: right; +} + +div.karma +{ + background-color: transparent; + text-align: left; + border-top: 1px solid #DDDDFF; + border-left: 1px solid #DDDDFF; + border-right: 1px solid #AAAAAA; + border-bottom: 1px solid #AAAAAA; + padding: 10px; +} + +span.digest +{ +} + +span.index_title{ + float: left; + border: 0px; +} + +span.index_extra{ + float: right; + padding: 2px; + border: 0px; +} + +div.signature { + bottom: 10px; + border-top-width:1px; + border-top-style: inherit; +} + +div#index_welcome{ + margin: 10px; + margin-bottom: 10px; +} +html>body div#index_welcome { + margin-bottom: 15px; +} + +#index_welcome div.title{ + font-size: 18px; + font-weight: bold; + border-bottom: dashed 1px; + padding: 5px; +} + +#index_welcome div.desc{ + padding: 5px; + font-size: 12px; + color: #000; +} + +#index_welcome div.visit{ + padding: 10px 5px; +} + +.left { text-align: left; } +.right { text-align: right; } +.floatleft { float: left;} +.floatright { float: right;} + +#index_forum a{ + font-weight: bold; +} + +table.index_category{ + border: 0px; + margin-top: -10px; + margin-bottom: 5px; +} + +table.index_category td{ + padding: 2px; +} + +table.index_category td a:first-letter{} + +table.index_category .desc, table.index_category .desc a{ + font-weight: normal !important; + padding-left: 0; + margin-top: 5px; + margin-bottom: 0px; +} + +table.index_category .desc:first-letter, table.index_category .desc a:first-letter{} + +#index_forum span.item{ + padding: 0px 0px 0px 0px; + margin: 0px; + border: 0px; +} + +#index_forum span.extra{ + float: right; + text-align: left; + margin: 0px; +} + +div#forum_header{ + margin: 5px; +} +#forum_header div{ + padding-top: 5px; +} + + + +/* -- dropdown menu -- */ + +div.dropdown{ + float: left; +} + +div.dropdown .menu, div.dropdown .userbar{ + font-weight: bold; + float: left; + margin: 0px 1px; + border: 0px !important; + padding: 0px; +} + +div.dropdown .item{ + font-weight: bold; + padding: 2px 5px; + white-space: nowrap; + border: 0px !important; +} + +div.dropdown ul, div.dropdown table { + width: 135px; +} +/* -- dropdown menu -- */ + +/* -- user level -- */ +table.userlevel{ + width: 90%; + border: 0px; + padding: 0px; + border-collapse: collapse; + border-spacing: 0; + text-align: left; +} + +table.userlevel td{ + height: 13px; + padding: 0px; +} + +table.userlevel td.end{ + width: 3px; +} + +table.userlevel td.end img{ + width: 3px; + height: 13px; +} + +table.userlevel td.center{ + width: 100%; +} + +table.userlevel td.center img{ + height: 12px; +} +/* -- user level -- */ + +span.online_admin{ + color:#FFA34F; +} + +span.online_moderator{ + color:#006600; +} + + +/* + * From http://www.positioniseverything.net/easyclearing.html + */ +.clear:after { + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; +} +.clear {display: inline-table;} +/* Hides from IE-mac \*/ +* html .clear {height: 1%;} +.clear {display: block;} +/* End hide from IE-mac */ + +/* color -- dropdown menu for Forum */ +div.dropdown a, div.dropdown .menubar a{ + /* irmtfan remove hardcode color color:#FFF; */ +} + +div.dropdown .menu, div.dropdown .menubar, div.dropdown .item, div.dropdown .separator{ + /* irmtfan remove hardcode color background-color: #436792;*/ + /* same color set as in your theme/style.ss .th{} is recommended */ + /* irmtfan remove hardcode color color:#FFF; */ +} + +div.dropdown .separator{ + border: 1px inset #e0e0e0; +} + +div.dropdown .menu a:hover, div.dropdown .userbar a:hover{ + color: #333; +} +/* irmtfan class added for solve some hard codes */ +.post_edit { + float: right; + padding: 5px; + margin-top: 10px; + border:1px solid #000; + font-size: small; +} +.post_ip { + float: right; + padding: 5px; + margin-top: 10px; +} +.pagenav { + float: right; + text-align: right; + padding: 5px; +} +.align_left, #align_left { + margin-left: 0; + text-align: left; +} +.align_right, #align_right { + margin-right: 0; + text-align: right; +} +.poll { + text-align: center; + margin: 3px; +} +.pointer { + cursor:pointer; + padding:2px; +} +/* irmtfan source: http://jsfiddle.net/VTLmj/ +you can customize each button like this: +span.forum_icon.forum_button#p_edit +span.forum_icon.forum_button#p_edit:hover +span.forum_icon.forum_button#p_edit:active +find all image names in newbb/include/images.php +*/ +span.forum_icon.forum_button { +background: #407DC7; +background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#407DC7), to(#4279B8)); +background-image: -webkit-linear-gradient(top, #407DC7, #4279B8); +background-image: -moz-linear-gradient(top, #407DC7, #4279B8); +background-image: -ms-linear-gradient(top, #407DC7, #4279B8); +background-image: -o-linear-gradient(top, #407DC7, #4279B8); +border-width: 1px; +color: white; +padding: 4px 4px; +text-shadow: 0 1px 0 gray; +border-color: white #A1C1E6 #2B4763 #A1C1E6; +border-style: solid; +border-radius: 5px; +box-shadow: 0 1px 7px #080808; +font-weight: bold; +} +span.forum_icon.forum_button:hover { +box-shadow: 0 1px 5px #222; +} +span.forum_icon.forum_button:active { +box-shadow: inset 0 1px 7px #565656; +border-color: white #a1c1e6 black #a1c1e6; +font-weight: normal; +} +/* color - end */ \ No newline at end of file Added: XoopsModules/newbb/branches/irmtfan/newbb/templates/css/language/index.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/css/language/index.html (rev 0) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/css/language/index.html 2012-09-25 06:31:40 UTC (rev 10190) @@ -0,0 +1 @@ +<script>history.go(-1);</script> Added: XoopsModules/newbb/branches/irmtfan/newbb/templates/css/language/persian/index.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/css/language/persian/index.html (rev 0) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/css/language/persian/index.html 2012-09-25 06:31:40 UTC (rev 10190) @@ -0,0 +1 @@ +<script>history.go(-1);</script> Added: XoopsModules/newbb/branches/irmtfan/newbb/templates/css/language/persian/style.css =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/css/language/persian/style.css (rev 0) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/css/language/persian/style.css 2012-09-25 06:31:40 UTC (rev 10190) @@ -0,0 +1,361 @@ +/* -- style.css -- */ +.forum_header { + float : center; + overflow : hidden; + border : 1px solid #aaaaaa; + width : 100%; +} + +.forum_title { + float : /*irmtfan left*/ right; + text-align : /*irmtfan left*/ right; + padding : 5px; + width : 100%; + +} + +.forum_title a { + font-weight: bold; +} + + +.forum_stats { + float:center; + overflow:hidden; + text-align:/*irmtfan left*/right; + /* border:1px solid #aaaaaa; */ + padding:5px; +} + +.forum_stats_left { + float: /*irmtfan left*/ right; + text-align: /*irmtfan left*/ right; + width:45%; +} + +.forum_stats_right { + float: /*irmtfan right*/left; + text-align: /*irmtfan right*/ left; + width:45%; +} + +.forum_body { + margin-top: -10px; + padding-top: 20px; + float:center; + width:99%; + overflow:hidden; +} + +.forum_footer { + float:center; + width:99%; + overflow:hidden; +} + +.index_category{ + border: 0px; + /*margin-top: -10px; + margin-bottom: 5px;*/ +} + +.ThreadUserName a { + font-weight: bold; + margin-bottom: 2px; + /*color: #000; irmtfan */ +} + +.ThreadTitle, .ThreadTitle a{ + font-weight: bold; + margin-bottom: 2px; + /*color: #fff; irmtfan */ +} + +.icon_left { + float: /*irmtfan left*/ right; text-align: /*irmtfan left*/ right; +} + +.icon_right { + float: /*irmtfan right*/ left; text-align: /*irmtfan right*/ left; +} + +div.karma +{ + background-color: transparent; + text-align: left; + border-top: 1px solid #DDDDFF; + border-left: 1px solid #DDDDFF; + border-right: 1px solid #AAAAAA; + border-bottom: 1px solid #AAAAAA; + padding: 10px; +} + +span.digest +{ +} + +span.index_title{ + float: /*irmtfan left*/ right; + border: 0px; +} + +span.index_extra{ + float: /*irmtfan right*/ left; + padding: 2px; + border: 0px; +} + +div.signature { + bottom: 10px; + border-top-width:1px; + border-top-style: inherit; +} + +div#index_welcome{ + margin: 10px; + margin-bottom: 10px; +} +html>body div#index_welcome { + margin-bottom: 15px; +} + +#index_welcome div.title{ + font-size: 18px; + font-weight: bold; + border-bottom: dashed 1px; + padding: 5px; +} + +#index_welcome div.desc{ + padding: 5px; + font-size: 12px; + color: #000; +} + +#index_welcome div.visit{ + padding: 10px 5px; +} + +.left { text-align: /*irmtfan left*/ right; } +.right { text-align: /*irmtfan right*/ left; } +.floatleft { float: /*irmtfan left*/ right;} +.floatright { float: /*irmtfan right*/ left;} + +#index_forum a{ + font-weight: bold; +} + +table.index_category{ + border: 0px; + margin-top: -10px; + margin-bottom: 5px; +} + +table.index_category td{ + padding: 2px; +} + +table.index_category td a:first-letter{} + +table.index_category .desc, table.index_category .desc a{ + font-weight: normal !important; + /* irmtfan padding-left: 0; */ padding-right: 0; + margin-top: 5px; + margin-bottom: 0px; +} + +table.index_category .desc:first-letter, table.index_category .desc a:first-letter{} + +#index_forum span.item{ + padding: 0px 0px 0px 0px; + margin: 0px; + border: 0px; +} + +#index_forum span.extra{ + float: /*irmtfan right*/ left; + text-align: /*irmtfan left*/ right; + margin: 0px; +} + +div#forum_header{ + margin: 5px; +} +#forum_header div{ + padding-top: 5px; +} + + + +/* -- dropdown menu -- */ + +div.dropdown{ + float: /*irmtfan left*/ right; +} + +div.dropdown .menu, div.dropdown .userbar{ + font-weight: bold; + float: /*irmtfan left*/ right; + margin: 0px 1px; + border: 0px !important; + padding: 0px; +} + +div.dropdown .item{ + font-weight: bold; + padding: 2px 5px; + white-space: nowrap; + border: 0px !important; +} + +div.dropdown ul, div.dropdown table { + width: 135px; +} +/* -- dropdown menu -- */ + +/* -- user level -- */ +table.userlevel{ + width: 90%; + border: 0px; + padding: 0px; + border-collapse: collapse; + border-spacing: 0; + text-align: /*irmtfan left*/ right; +} + +table.userlevel td{ + height: 13px; + padding: 0px; +} + +table.userlevel td.end{ + width: 3px; +} + +table.userlevel td.end img{ + width: 3px; + height: 13px; +} + +table.userlevel td.center{ + width: 100%; +} + +table.userlevel td.center img{ + height: 12px; +} +/* -- user level -- */ + +span.online_admin{ + color:#FFA34F; +} + +span.online_moderator{ + color:#006600; +} + + +/* + * From http://www.positioniseverything.net/easyclearing.html + */ +.clear:after { + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; +} +.clear {display: inline-table;} +/* Hides from IE-mac \*/ +* html .clear {height: 1%;} +.clear {display: block;} +/* End hide from IE-mac */ + +/* color -- dropdown menu for Forum */ +div.dropdown a, div.dropdown .menubar a{ + /* irmtfan remove hardcode color color:#FFF; */ +} + +div.dropdown .menu, div.dropdown .menubar, div.dropdown .item, div.dropdown .separator{ + /* irmtfan remove hardcode color background-color: #436792;*/ + /* same color set as in your theme/style.ss .th{} is recommended */ + /* irmtfan remove hardcode color color:#FFF; */ +} + +div.dropdown .separator{ + border: 1px inset #e0e0e0; +} + +div.dropdown .menu a:hover, div.dropdown .userbar a:hover{ + color: #333; +} +/* irmtfan class added for solve some hard codes */ +.post_edit { + float: /*irmtfan right*/ left; + padding: 5px; + margin-top: 10px; + border:1px solid #000; + font-size: small; +} +.post_ip { + float: /*irmtfan right*/ left; + padding: 5px; + margin-top: 10px; +} +.pagenav { + float: /*irmtfan right*/ left; + text-align: /*irmtfan right*/ left; + padding: 5px; +} +.align_left, #align_left { + direction: rtl; + /* irmtfan margin-left: 0; */ margin-right: 0; + text-align: /*irmtfan left*/ right; +} +.align_right, #align_right { + direction: rtl; + /* irmtfan margin-right: 0; */ margin-left: 0; + text-align: /*irmtfan right*/ left; +} +.poll { + direction: rtl; + text-align: center; + margin: 3px; +} +.pointer { + cursor:pointer; + padding:2px; +} +/* irmtfan source: http://jsfiddle.net/VTLmj/ +you can customize each button like this: +span.forum_icon.forum_button#p_edit +span.forum_icon.forum_button#p_edit:hover +span.forum_icon.forum_button#p_edit:active +find all image names in newbb/include/images.php +*/ +span.forum_icon.forum_button { +background: #407DC7; +background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#407DC7), to(#4279B8)); +background-image: -webkit-linear-gradient(top, #407DC7, #4279B8); +background-image: -moz-linear-gradient(top, #407DC7, #4279B8); +background-image: -ms-linear-gradient(top, #407DC7, #4279B8); +background-image: -o-linear-gradient(top, #407DC7, #4279B8); +border-width: 1px; +color: white; +padding: 4px 4px; +text-shadow: 0 1px 0 gray; +border-color: white #A1C1E6 #2B4763 #A1C1E6; +border-style: solid; +border-radius: 5px; +box-shadow: 0 1px 7px #080808; +font-weight: bold; +} +span.forum_icon.forum_button:hover { +box-shadow: 0 1px 5px #222; +} +span.forum_icon.forum_button:active { +box-shadow: inset 0 1px 7px #565656; +border-color: white #a1c1e6 black #a1c1e6; +font-weight: normal; +} +/* color - end */ \ No newline at end of file Deleted: XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/english/style.css =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/english/style.css 2012-09-24 22:31:08 UTC (rev 10189) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/english/style.css 2012-09-25 06:31:40 UTC (rev 10190) @@ -1,358 +0,0 @@ -/* -- style.css -- */ -.forum_header { - float : center; - overflow : hidden; - border : 1px solid #aaaaaa; - width : 100%; -} - -.forum_title { - float : left; - text-align : left; - padding : 5px; - width : 100%; - -} - -.forum_title a { - font-weight: bold; -} - - -.forum_stats { - float:center; - overflow:hidden; - text-align:left; - /* border:1px solid #aaaaaa; */ - padding:5px; -} - -.forum_stats_left { - float: left; - text-align: left; - width:45%; -} - -.forum_stats_right { - float: right; - text-align: right; - width:45%; -} - -.forum_body { - margin-top: -10px; - padding-top: 20px; - float:center; - width:99%; - overflow:hidden; -} - -.forum_footer { - float:center; - width:99%; - overflow:hidden; -} - -.index_category{ - border: 0px; - /*margin-top: -10px; - margin-bottom: 5px;*/ -} - -.ThreadUserName a { - font-weight: bold; - margin-bottom: 2px; - /*color: #000; irmtfan */ -} - -.ThreadTitle, .ThreadTitle a{ - font-weight: bold; - margin-bottom: 2px; - /*color: #fff; irmtfan */ -} - -.icon_left { - float: left; text-align: left; -} - -.icon_right { - float: right; text-align: right; -} - -div.karma -{ - background-color: transparent; - text-align: left; - border-top: 1px solid #DDDDFF; - border-left: 1px solid #DDDDFF; - border-right: 1px solid #AAAAAA; - border-bottom: 1px solid #AAAAAA; - padding: 10px; -} - -span.digest -{ -} - -span.index_title{ - float: left; - border: 0px; -} - -span.index_extra{ - float: right; - padding: 2px; - border: 0px; -} - -div.signature { - bottom: 10px; - border-top-width:1px; - border-top-style: inherit; -} - -div#index_welcome{ - margin: 10px; - margin-bottom: 10px; -} -html>body div#index_welcome { - margin-bottom: 15px; -} - -#index_welcome div.title{ - font-size: 18px; - font-weight: bold; - border-bottom: dashed 1px; - padding: 5px; -} - -#index_welcome div.desc{ - padding: 5px; - font-size: 12px; - color: #000; -} - -#index_welcome div.visit{ - padding: 10px 5px; -} - -.left { text-align: left; } -.right { text-align: right; } -.floatleft { float: left;} -.floatright { float: right;} - -#index_forum a{ - font-weight: bold; -} - -table.index_category{ - border: 0px; - margin-top: -10px; - margin-bottom: 5px; -} - -table.index_category td{ - padding: 2px; -} - -table.index_category td a:first-letter{} - -table.index_category .desc, table.index_category .desc a{ - font-weight: normal !important; - padding-left: 0; - margin-top: 5px; - margin-bottom: 0px; -} - -table.index_category .desc:first-letter, table.index_category .desc a:first-letter{} - -#index_forum span.item{ - padding: 0px 0px 0px 0px; - margin: 0px; - border: 0px; -} - -#index_forum span.extra{ - float: right; - text-align: left; - margin: 0px; -} - -div#forum_header{ - margin: 5px; -} -#forum_header div{ - padding-top: 5px; -} - - - -/* -- dropdown menu -- */ - -div.dropdown{ - float: left; -} - -div.dropdown .menu, div.dropdown .userbar{ - font-weight: bold; - float: left; - margin: 0px 1px; - border: 0px !important; - padding: 0px; -} - -div.dropdown .item{ - font-weight: bold; - padding: 2px 5px; - white-space: nowrap; - border: 0px !important; -} - -div.dropdown ul, div.dropdown table { - width: 135px; -} -/* -- dropdown menu -- */ - -/* -- user level -- */ -table.userlevel{ - width: 90%; - border: 0px; - padding: 0px; - border-collapse: collapse; - border-spacing: 0; - text-align: left; -} - -table.userlevel td{ - height: 13px; - padding: 0px; -} - -table.userlevel td.end{ - width: 3px; -} - -table.userlevel td.end img{ - width: 3px; - height: 13px; -} - -table.userlevel td.center{ - width: 100%; -} - -table.userlevel td.center img{ - height: 12px; -} -/* -- user level -- */ - -span.online_admin{ - color:#FFA34F; -} - -span.online_moderator{ - color:#006600; -} - - -/* - * From http://www.positioniseverything.net/easyclearing.html - */ -.clear:after { - content: "."; - display: block; - height: 0; - clear: both; - visibility: hidden; -} -.clear {display: inline-table;} -/* Hides from IE-mac \*/ -* html .clear {height: 1%;} -.clear {display: block;} -/* End hide from IE-mac */ - -/* color -- dropdown menu for Forum */ -div.dropdown a, div.dropdown .menubar a{ - /* irmtfan remove hardcode color color:#FFF; */ -} - -div.dropdown .menu, div.dropdown .menubar, div.dropdown .item, div.dropdown .separator{ - /* irmtfan remove hardcode color background-color: #436792;*/ - /* same color set as in your theme/style.ss .th{} is recommended */ - /* irmtfan remove hardcode color color:#FFF; */ -} - -div.dropdown .separator{ - border: 1px inset #e0e0e0; -} - -div.dropdown .menu a:hover, div.dropdown .userbar a:hover{ - color: #333; -} -/* irmtfan class added for solve some hard codes */ -.post_edit { - float: right; - padding: 5px; - margin-top: 10px; - border:1px solid #000; - font-size: small; -} -.post_ip { - float: right; - padding: 5px; - margin-top: 10px; -} -.pagenav { - float: right; - text-align: right; - padding: 5px; -} -.align_left, #align_left { - margin-left: 0; - text-align: left; -} -.align_right, #align_right { - margin-right: 0; - text-align: right; -} -.poll { - text-align: center; - margin: 3px; -} -.pointer { - cursor:pointer; - padding:2px; -} -/* irmtfan source: http://jsfiddle.net/VTLmj/ -you can customize each button like this: -span.forum_icon.forum_button#p_edit -span.forum_icon.forum_button#p_edit:hover -span.forum_icon.forum_button#p_edit:active -find all image names in newbb/include/images.php -*/ -span.forum_icon.forum_button { -background: #407DC7; -background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#407DC7), to(#4279B8)); -background-image: -webkit-linear-gradient(top, #407DC7, #4279B8); -background-image: -moz-linear-gradient(top, #407DC7, #4279B8); -background-image: -ms-linear-gradient(top, #407DC7, #4279B8); -background-image: -o-linear-gradient(top, #407DC7, #4279B8); -border-width: 1px; -color: white; -padding: 4px 4px; -text-shadow: 0 1px 0 gray; -border-color: white #A1C1E6 #2B4763 #A1C1E6; -border-style: solid; -border-radius: 5px; -box-shadow: 0 1px 7px #080808; -font-weight: bold; -} -span.forum_icon.forum_button:hover { -box-shadow: 0 1px 5px #222; -} -span.forum_icon.forum_button:active { -box-shadow: inset 0 1px 7px #565656; -border-color: white #a1c1e6 black #a1c1e6; -font-weight: normal; -} -/* color - end */ \ No newline at end of file Deleted: XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/style.css =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/style.css 2012-09-24 22:31:08 UTC (rev 10189) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/images/language/persian/style.css 2012-09-25 06:31:40 UTC (rev 10190) @@ -1,361 +0,0 @@ -/* -- style.css -- */ -.forum_header { - float : center; - overflow : hidden; - border : 1px solid #aaaaaa; - width : 100%; -} - -.forum_title { - float : /*irmtfan left*/ right; - text-align : /*irmtfan left*/ right; - padding : 5px; - width : 100%; - -} - -.forum_title a { - font-weight: bold; -} - - -.forum_stats { - float:center; - overflow:hidden; - text-align:/*irmtfan left*/right; - /* border:1px solid #aaaaaa; */ - padding:5px; -} - -.forum_stats_left { - float: /*irmtfan left*/ right; - text-align: /*irmtfan left*/ right; - width:45%; -} - -.forum_stats_right { - float: /*irmtfan right*/left; - text-align: /*irmtfan right*/ left; - width:45%; -} - -.forum_body { - margin-top: -10px; - padding-top: 20px; - float:center; - width:99%; - overflow:hidden; -} - -.forum_footer { - float:center; - width:99%; - overflow:hidden; -} - -.index_category{ - border: 0px; - /*margin-top: -10px; - margin-bottom: 5px;*/ -} - -.ThreadUserName a { - font-weight: bold; - margin-bottom: 2px; - /*color: #000; irmtfan */ -} - -.ThreadTitle, .ThreadTitle a{ - font-weight: bold; - margin-bottom: 2px; - /*color: #fff; irmtfan */ -} - -.icon_left { - float: /*irmtfan left*/ right; text-align: /*irmtfan left*/ right; -} - -.icon_right { - float: /*irmtfan right*/ left; text-align: /*irmtfan right*/ left; -} - -div.karma -{ - background-color: transparent; - text-align: left; - border-top: 1px solid #DDDDFF; - border-left: 1px solid #DDDDFF; - border-right: 1px solid #AAAAAA; - border-bottom: 1px solid #AAAAAA; - padding: 10px; -} - -span.digest -{ -} - -span.index_title{ - float: /*irmtfan left*/ right; - border: 0px; -} - -span.index_extra{ - float: /*irmtfan right*/ left; - padding: 2px; - border: 0px; -} - -div.signature { - bottom: 10px; - border-top-width:1px; - border-top-style: inherit; -} - -div#index_welcome{ - margin: 10px; - margin-bottom: 10px; -} -html>body div#index_welcome { - margin-bottom: 15px; -} - -#index_welcome div.title{ - font-size: 18px; - font-weight: bold; - border-bottom: dashed 1px; - padding: 5px; -} - -#index_welcome div.desc{ - padding: 5px; - font-size: 12px; - color: #000; -} - -#index_welcome div.visit{ - padding: 10px 5px; -} - -.left { text-align: /*irmtfan left*/ right; } -.right { text-align: /*irmtfan right*/ left; } -.floatleft { float: /*irmtfan left*/ right;} -.floatright { float: /*irmtfan right*/ left;} - -#index_forum a{ - font-weight: bold; -} - -table.index_category{ - border: 0px; - margin-top: -10px; - margin-bottom: 5px; -} - -table.index_category td{ - padding: 2px; -} - -table.index_category td a:first-letter{} - -table.index_category .desc, table.index_category .desc a{ - font-weight: normal !important; - /* irmtfan padding-left: 0; */ padding-right: 0; - margin-top: 5px; - margin-bottom: 0px; -} - -table.index_category .desc:first-letter, table.index_category .desc a:first-letter{} - -#index_forum span.item{ - padding: 0px 0px 0px 0px; - margin: 0px; - border: 0px; -} - -#index_forum span.extra{ - float: /*irmtfan right*/ left; - text-align: /*irmtfan left*/ right; - margin: 0px; -} - -div#forum_header{ - margin: 5px; -} -#forum_header div{ - padding-top: 5px; -} - - - -/* -- dropdown menu -- */ - -div.dropdown{ - float: /*irmtfan left*/ right; -} - -div.dropdown .menu, div.dropdown .userbar{ - font-weight: bold; - float: /*irmtfan left*/ right; - margin: 0px 1px; - border: 0px !important; - padding: 0px; -} - -div.dropdown .item{ - font-weight: bold; - padding: 2px 5px; - white-space: nowrap; - border: 0px !important; -} - -div.dropdown ul, div.dropdown table { - width: 135px; -} -/* -- dropdown menu -- */ - -/* -- user level -- */ -table.userlevel{ - width: 90%; - border: 0px; - padding: 0px; - border-collapse: collapse; - border-spacing: 0; - text-align: /*irmtfan left*/ right; -} - -table.userlevel td{ - height: 13px; - padding: 0px; -} - -table.userlevel td.end{ - width: 3px; -} - -table.userlevel td.end img{ - width: 3px; - height: 13px; -} - -table.userlevel td.center{ - width: 100%; -} - -table.userlevel td.center img{ - height: 12px; -} -/* -- user level -- */ - -span.online_admin{ - color:#FFA34F; -} - -span.online_moderator{ - color:#006600; -} - - -/* - * From http://www.positioniseverything.net/easyclearing.html - */ -.clear:after { - content: "."; - display: block; - height: 0; - clear: both; - visibility: hidden; -} -.clear {display: inline-table;} -/* Hides from IE-mac \*/ -* html .clear {height: 1%;} -.clear {display: block;} -/* End hide from IE-mac */ - -/* color -- dropdown menu for Forum */ -div.dropdown a, div.dropdown .menubar a{ - /* irmtfan remove hardcode colo... [truncated message content] |
From: <ir...@us...> - 2012-09-26 12:51:35
|
Revision: 10194 http://xoops.svn.sourceforge.net/xoops/?rev=10194&view=rev Author: irmtfan Date: 2012-09-26 12:51:23 +0000 (Wed, 26 Sep 2012) Log Message: ----------- bug fix: move semicolon, javascript:history.go(-1), redirect header for admin report, topic_lock, rating enable, inneHTML for non img Tags Modified Paths: -------------- XoopsModules/newbb/branches/irmtfan/newbb/action.post.php XoopsModules/newbb/branches/irmtfan/newbb/action.topic.php XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_report.php XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt XoopsModules/newbb/branches/irmtfan/newbb/docs/lang_diff.txt XoopsModules/newbb/branches/irmtfan/newbb/index.php XoopsModules/newbb/branches/irmtfan/newbb/language/english/admin.php XoopsModules/newbb/branches/irmtfan/newbb/language/english/main.php XoopsModules/newbb/branches/irmtfan/newbb/language/persian/admin.php XoopsModules/newbb/branches/irmtfan/newbb/language/persian/main.php XoopsModules/newbb/branches/irmtfan/newbb/polls.php XoopsModules/newbb/branches/irmtfan/newbb/post.php XoopsModules/newbb/branches/irmtfan/newbb/ratethread.php XoopsModules/newbb/branches/irmtfan/newbb/templates/js/language/english/newbb_toggle.js XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_index.html XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_thread.html XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html XoopsModules/newbb/branches/irmtfan/newbb/topicmanager.php XoopsModules/newbb/branches/irmtfan/newbb/viewtopic.php XoopsModules/newbb/branches/irmtfan/newbb/votepolls.php Modified: XoopsModules/newbb/branches/irmtfan/newbb/action.post.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/action.post.php 2012-09-26 12:04:53 UTC (rev 10193) +++ XoopsModules/newbb/branches/irmtfan/newbb/action.post.php 2012-09-26 12:51:23 UTC (rev 10194) @@ -20,7 +20,8 @@ $mode = !empty($_GET['mode']) ? intval($_GET['mode']) : 1; if ( empty($post_id) || empty($op)) { - redirect_header("javascript:history.go(-1);", 2, _MD_NORIGHTTOACCESS); + // irmtfan - issue with javascript:history.go(-1) + redirect_header($_SERVER['HTTP_REFERER'], 2, _MD_NORIGHTTOACCESS); exit(); } Modified: XoopsModules/newbb/branches/irmtfan/newbb/action.topic.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/action.topic.php 2012-09-26 12:04:53 UTC (rev 10193) +++ XoopsModules/newbb/branches/irmtfan/newbb/action.topic.php 2012-09-26 12:51:23 UTC (rev 10194) @@ -18,7 +18,8 @@ if ( empty($topic_id) || empty($op)) { - redirect_header("javascript:history.go(-1);", 2, _MD_NORIGHTTOACCESS); + // irmtfan - issue with javascript:history.go(-1) + redirect_header($_SERVER['HTTP_REFERER'], 2, _MD_NORIGHTTOACCESS); exit(); } Modified: XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_report.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_report.php 2012-09-26 12:04:53 UTC (rev 10193) +++ XoopsModules/newbb/branches/irmtfan/newbb/admin/admin_report.php 2012-09-26 12:51:23 UTC (rev 10194) @@ -43,6 +43,9 @@ switch ($op) { case "save": $report_ids = $_POST['report_id']; + // irmtfan add error redirect header + if (empty($report_ids)) + redirect_header( "admin_report.php?item={$item}" . (empty($start) ? "" : "&start={$start}"), 1, _AM_NEWBB_REPORTNOTSELECT); $report_memos = isset($_POST['report_memo']) ? $_POST['report_memo'] : array(); foreach ($report_ids as $rid => $value) { if (!$value) continue; @@ -51,19 +54,24 @@ $report_obj->setVar("report_memo", $report_memos[$rid]); $report_handler->insert($report_obj); } - redirect_header( "admin_report.php?item={$item}" . (empty($start) ? "" : "&start={$start}"), 1); + // irmtfan add message + redirect_header( "admin_report.php?item={$item}" . (empty($start) ? "" : "&start={$start}"), 1, _AM_NEWBB_REPORTSAVE); break; case "delete": $report_ids = $_POST['report_id']; + // irmtfan add error redirect header + if (empty($report_ids)) + redirect_header( "admin_report.php?item={$item}" . (empty($start) ? "" : "&start={$start}"), 1, _AM_NEWBB_REPORTNOTSELECT); foreach ($report_ids as $rid => $value) { if (!$value) continue; if ($report_obj = $report_handler->get($rid)) { $report_handler->delete($report_obj); } } - redirect_header( "admin_report.php?item={$item}" . (empty($start) ? "" : "&start={$start}"), 1); + // irmtfan add message + redirect_header( "admin_report.php?item={$item}" . (empty($start) ? "" : "&start={$start}"), 1, _AM_NEWBB_REPORTDELETE); break; Modified: XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt 2012-09-26 12:04:53 UTC (rev 10193) +++ XoopsModules/newbb/branches/irmtfan/newbb/changelog-rev10109.txt 2012-09-26 12:51:23 UTC (rev 10194) @@ -1,3 +1,25 @@ +date 2012-09-26 +=================================== +1- bug fix: move semicolon from php files to template files. 'block;' => 'block' AND 'none;' => 'none' +in newbb/index.php, newbb/viewtopic.php, newbb/templates/newbb_thread.html, newbb/templates/newbb_viewtopic.html, newbb/templates/newbb_index.html + +2- bug fix: Issue with javascript in redirect_header javascript:history.go(-1) +in newbb/action.post.php, newbb/action.topic.php, newbb/polls.php, newbb/post.php, newbb/ratethread.php, newbb/topicmanager.php, newbb/votepolls.php + +3- bug fix: add messages for redirect_header +in newbb/post.php, newbb/votepolls.php, newbb/admin/admin_report.php, newbb/language/english/main.php, newbb/language/english/admin.php, newbb/docs/lang_diff.txt + +4- fix and improve: add redirect header when no report is selected in admin_report.php in submit. +newbb/admin/admin_report.php, newbb/language/english/admin.php, newbb/docs/lang_diff.txt + +5- bug fix: user dont see "the topic is locked" if the show_reg was set to 0. revise forum_post_or_register smarty and assign 3 new smraty variables: forum_post, forum_register, topic_lock +in newbb/viewtopic.php + +6- bug fix: user can see rating when he dont have permission to post and/or reply. +in newbb/viewtopic.php, newbb/templates/newbb_viewtopic.html + +7- bug fix: innerHTML change only if the TAG is not img. + date 2012-09-25 =================================== 1- bug fix: change the method of adding stylesheet and scripts from overrighting xoops_module_header smarty variable to $xoTheme. Modified: XoopsModules/newbb/branches/irmtfan/newbb/docs/lang_diff.txt =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/docs/lang_diff.txt 2012-09-26 12:04:53 UTC (rev 10193) +++ XoopsModules/newbb/branches/irmtfan/newbb/docs/lang_diff.txt 2012-09-26 12:51:23 UTC (rev 10194) @@ -50,3 +50,11 @@ define('_MD_RESTORETOPIC','Restore this topic'); define('_MD_TOPICRESTORE','The topic has been restored.'); define('_MD_DESC_RESTORE','Once you press the restore button at the bottom of this form the topic you have selected, and all its related posts, will be restored.'); + +define('_MD_POLL_NOOPTION','You must choose an option !!'); + +admin.php +--------- +define('_AM_NEWBB_REPORTSAVE','Selected Reports have been processed successfully'); +define('_AM_NEWBB_REPORTDELETE','Selected Reports have been deleted from database successfully'); +define('_AM_NEWBB_REPORTNOTSELECT','No Report is selected!'); \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/index.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/index.php 2012-09-26 12:04:53 UTC (rev 10193) +++ XoopsModules/newbb/branches/irmtfan/newbb/index.php 2012-09-26 12:51:23 UTC (rev 10194) @@ -158,11 +158,11 @@ $expand = (count($toggles) > 0) ? ( (in_array($cat_element_id, $toggles)) ? false : true ) : true; // START irmtfan to improve newbb_displayImage if ($expand) { - $cat_display = 'block;'; + $cat_display = 'block'; //irmtfan move semicolon $cat_icon_display = "minus"; $cat_alt = _MD_NEWBB_HIDE; } else { - $cat_display = 'none;'; + $cat_display = 'none'; //irmtfan move semicolon $cat_icon_display = "plus"; $cat_alt = _MD_NEWBB_SEE; } Modified: XoopsModules/newbb/branches/irmtfan/newbb/language/english/admin.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/language/english/admin.php 2012-09-26 12:04:53 UTC (rev 10193) +++ XoopsModules/newbb/branches/irmtfan/newbb/language/english/admin.php 2012-09-26 12:51:23 UTC (rev 10194) @@ -297,4 +297,8 @@ define('_AM_NEWBB_UPLOAD','max. Upload each file :'); define('_AM_NEWBB_MEMLIMITTOLARGE','Attention! Value \'memory_limit\' to PHP.INI less than \'post_max_size\''); define('_AM_NEWBB_MEMLIMITOK','Files can be uploaded with a maximum of %s.'); +// irmtfan add messages +define('_AM_NEWBB_REPORTSAVE','Selected Reports have been processed successfully'); +define('_AM_NEWBB_REPORTDELETE','Selected Reports have been deleted from database successfully'); +define('_AM_NEWBB_REPORTNOTSELECT','No Report is selected!'); ?> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/language/english/main.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/language/english/main.php 2012-09-26 12:04:53 UTC (rev 10193) +++ XoopsModules/newbb/branches/irmtfan/newbb/language/english/main.php 2012-09-26 12:51:23 UTC (rev 10194) @@ -491,7 +491,10 @@ define('_MD_NEWBB_MAXUPLOADFILEINI','The uploaded file exceeds the upload_max_filesize directive in php.ini.'); define('_MD_NEWBB_MAXPIC','Images at the max. Size %s X %s pixels.'); define('_MD_NEWBB_SEARCHDISABLED','The search is disabled and can not be used.'); +// irmtfan added messages define('_MD_NEWBB_HIDEUSERDATA','Hide User information'); define('_MD_NEWBB_HIDE','Hide'); define('_MD_NEWBB_SEE','See'); +// votepolls.php - irmtfan +define('_MD_POLL_NOOPTION','You must choose an option !!'); ?> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/language/persian/admin.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/language/persian/admin.php 2012-09-26 12:04:53 UTC (rev 10193) +++ XoopsModules/newbb/branches/irmtfan/newbb/language/persian/admin.php 2012-09-26 12:51:23 UTC (rev 10194) @@ -230,14 +230,17 @@ define('_AM_NEWBB_AUTHOR_WORD_EXTRA',"سخنان بیشتری از موسس ماژول"); // admin_report.php -define("_AM_NEWBB_REPORTADMIN","مدیریت پیام های گزارش شده"); -define("_AM_NEWBB_PROCESSEDREPORT","دیدن پاسخ ارسال شده توسط ناظر به گزارش فرستاده شده"); -define("_AM_NEWBB_PROCESSREPORT","گزارش های ارسال شده"); +define("_AM_NEWBB_REPORTADMIN","مدیریت گزارش های ارسالی در خصوص پست ها"); +define("_AM_NEWBB_PROCESSEDREPORT","دیدن گزارش های های پاسخ داده شده"); +define("_AM_NEWBB_PROCESSREPORT","دیدن گزارش های پاسخ داده نشده و نیازمند رسیدگی"); define("_AM_NEWBB_REPORTTITLE","عنوان گزارش"); define("_AM_NEWBB_REPORTEXTRA","بخش اضافی"); -define("_AM_NEWBB_REPORTPOST","پیام گزارش شده"); +define("_AM_NEWBB_REPORTPOST","پستی که گزارش شده"); define("_AM_NEWBB_REPORTTEXT","متن گزارش ارسال شده"); -define("_AM_NEWBB_REPORTMEMO","Process memo"); +define("_AM_NEWBB_REPORTMEMO","پاسخ داده شده به گزارش ارسال شده"); +define('_AM_NEWBB_REPORTSAVE','گزارش های انتخاب شده رسیدگی شدند.'); +define('_AM_NEWBB_REPORTDELETE','گزارش های انتخاب شده از پایگاه داده ها حذف شدند.'); +define('_AM_NEWBB_REPORTNOTSELECT','هیچ گزارشی انتخاب نشده است!'); // admin_report.php define("_AM_NEWBB_DIGESTADMIN","مدیریت خلاصه ها"); Modified: XoopsModules/newbb/branches/irmtfan/newbb/language/persian/main.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/language/persian/main.php 2012-09-26 12:04:53 UTC (rev 10193) +++ XoopsModules/newbb/branches/irmtfan/newbb/language/persian/main.php 2012-09-26 12:51:23 UTC (rev 10194) @@ -493,4 +493,6 @@ define('_MD_NEWBB_HIDEUSERDATA','مخفی کردن اطلاعات کاربر'); define('_MD_NEWBB_HIDE','مخفی کردن'); define('_MD_NEWBB_SEE','نمایش'); +// votepolls.php - irmtfan +define('_MD_POLL_NOOPTION','شما باید یکی از گزینه ها را انتخاب کنید!!'); ?> \ No newline at end of file Modified: XoopsModules/newbb/branches/irmtfan/newbb/polls.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/polls.php 2012-09-26 12:04:53 UTC (rev 10193) +++ XoopsModules/newbb/branches/irmtfan/newbb/polls.php 2012-09-26 12:51:23 UTC (rev 10194) @@ -53,7 +53,8 @@ } else { - redirect_header("javascript:history.go(-1);", 2, _MD_POLLMODULE_ERROR); + // irmtfan - issue with javascript:history.go(-1) + redirect_header($_SERVER['HTTP_REFERER'], 2, _MD_POLLMODULE_ERROR); exit(); } // irmtfan correct the way and typo=addmor -> addmore @@ -68,7 +69,8 @@ if (!isset($module_handler)) $module_handler =& xoops_gethandler('module'); $xoopspoll =& $module_handler->getByDirname($pollmodules); if (!is_object($xoopspoll) || !$xoopspoll->getVar('isactive')) { - redirect_header("javascript:history.go(-1);", 2, _MD_POLLMODULE_ERROR); + // irmtfan - issue with javascript:history.go(-1) + redirect_header($_SERVER['HTTP_REFERER'], 2, _MD_POLLMODULE_ERROR); exit(); } @@ -170,7 +172,8 @@ */ $option_empty = true; if (empty($_POST['option_text'])) { - redirect_header("javascript:history.go(-1);", 2, _MD_ERROROCCURED . ': ' . _MD_POLL_POLLOPTIONS . ' !'); + // irmtfan - issue with javascript:history.go(-1) + redirect_header($_SERVER['HTTP_REFERER'], 2, _MD_ERROROCCURED . ': ' . _MD_POLL_POLLOPTIONS . ' !'); } $option_text = $_POST['option_text']; foreach ( $option_text as $optxt ) { @@ -180,7 +183,8 @@ } } if ($option_empty) { - redirect_header("javascript:history.go(-1);", 2, _MD_ERROROCCURED . ': ' . _MD_POLL_POLLOPTIONS . ' !'); + // irmtfan - issue with javascript:history.go(-1) + redirect_header($_SERVER['HTTP_REFERER'], 2, _MD_ERROROCCURED . ': ' . _MD_POLL_POLLOPTIONS . ' !'); } if ( $pollmodules == 'xoopspoll') $poll = new XoopsPoll(); @@ -319,7 +323,8 @@ if ( $op == "update" ) { $option_empty = true; if (empty($_POST['option_text'])) { - redirect_header("javascript:history.go(-1);", 2, _MD_ERROROCCURED . ': ' . _MD_POLL_POLLOPTIONS . ' !'); + // irmtfan - issue with javascript:history.go(-1) + redirect_header($_SERVER['HTTP_REFERER'], 2, _MD_ERROROCCURED . ': ' . _MD_POLL_POLLOPTIONS . ' !'); } $option_text = $_POST['option_text']; foreach ( $option_text as $optxt ) { @@ -328,7 +333,8 @@ break; } } - if ($option_empty) redirect_header("javascript:history.go(-1);", 2, _MD_ERROROCCURED . ': ' . _MD_POLL_POLLOPTIONS . ' !'); + // irmtfan - issue with javascript:history.go(-1) + if ($option_empty) redirect_header($_SERVER['HTTP_REFERER'], 2, _MD_ERROROCCURED . ': ' . _MD_POLL_POLLOPTIONS . ' !'); if ( $pollmodules == 'xoopspoll') $poll = new XoopsPoll($poll_id); @@ -439,7 +445,8 @@ if ( $op == "savemore" ) { $option_empty = true; if (empty($_POST['option_text'])) { - redirect_header("javascript:history.go(-1);", 2, _MD_ERROROCCURED . ': ' . _MD_POLL_POLLOPTIONS . ' !'); + // irmtfan - issue with javascript:history.go(-1) + redirect_header($_SERVER['HTTP_REFERER'], 2, _MD_ERROROCCURED . ': ' . _MD_POLL_POLLOPTIONS . ' !'); } $option_text = $_POST['option_text']; foreach ( $option_text as $optxt ) { @@ -448,7 +455,8 @@ break; } } - if ($option_empty) redirect_header("javascript:history.go(-1);", 2, _MD_ERROROCCURED . ': ' . _MD_POLL_POLLOPTIONS . ' !'); + // irmtfan - issue with javascript:history.go(-1) + if ($option_empty) redirect_header($_SERVER['HTTP_REFERER'], 2, _MD_ERROROCCURED . ': ' . _MD_POLL_POLLOPTIONS . ' !'); if ( $pollmodules == 'xoopspoll') $poll = new XoopsPoll($poll_id); Modified: XoopsModules/newbb/branches/irmtfan/newbb/post.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/post.php 2012-09-26 12:04:53 UTC (rev 10193) +++ XoopsModules/newbb/branches/irmtfan/newbb/post.php 2012-09-26 12:51:23 UTC (rev 10194) @@ -130,7 +130,8 @@ if ( !empty($_POST['contents_submit']) ) { $message = $_POST['message']; if (empty($message)) { - redirect_header("javascript:history.go(-1);", 1); + // irmtfan - issue with javascript:history.go(-1) - add error message + redirect_header($_SERVER['HTTP_REFERER'], 1, _MD_ERROR_BACK); exit(); } if ( !empty($isedit) && $post_id > 0 ) { Modified: XoopsModules/newbb/branches/irmtfan/newbb/ratethread.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/ratethread.php 2012-09-26 12:04:53 UTC (rev 10193) +++ XoopsModules/newbb/branches/irmtfan/newbb/ratethread.php 2012-09-26 12:51:23 UTC (rev 10194) @@ -44,7 +44,9 @@ && !$topic_handler->getPermission($topic_obj->getVar("forum_id"), $topic_obj->getVar('topic_status'), "reply") ) { - redirect_header("javascript:history.go(-1);", 2, _NOPERM); + // irmtfan - issue with javascript:history.go(-1) + redirect_header($_SERVER['HTTP_REFERER'], 2, _NOPERM); + exit(); } if (empty($rate)) { Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/js/language/english/newbb_toggle.js =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/js/language/english/newbb_toggle.js 2012-09-26 12:04:53 UTC (rev 10193) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/js/language/english/newbb_toggle.js 2012-09-26 12:51:23 UTC (rev 10194) @@ -1,67 +1,4 @@ -function ToggleBlock(block, icon) -{ - if (document.getElementById) - { - if (document.getElementById(block).style.display == 'block') - { - document.getElementById(block).style.display = 'none'; - SaveCollapsed(block, true); - } - else - { - document.getElementById(block).style.display = 'block'; - SaveCollapsed(block, false); - } - } - else if (document.all) - { - if (document.all[block].style.display == 'block') - { - document.all[block].style.display = 'none'; - SaveCollapsed(block, true); - } - else - { - document.all[block].style.display = 'block'; - SaveCollapsed(block, false); - } - } -} - -function ToggleBlock2(block, icon) -{ - if (document.getElementById) - { - if (document.getElementById(block).style.display == 'block') - { - document.getElementById(block).style.display = 'none'; - icon.src = 'images/plus.png'; - SaveCollapsed(block, true); - } - else - { - document.getElementById(block).style.display = 'block'; - icon.src = 'images/minus.png'; - SaveCollapsed(block, false); - } - } - else if (document.all) - { - if (document.all[block].style.display == 'block') - { - document.all[block].style.display = 'none'; - icon.src = 'images/plus.png'; - SaveCollapsed(block, true); - } - else - { - document.all[block].style.display = 'block'; - icon.src = 'images/minus.png'; - SaveCollapsed(block, false); - } - } -} -// START irmtfan - improve: add alt, title, id and innerHTML - recognize a IMG tag for src +// START irmtfan - improve: add alt, title, id and innerHTML - recognize a IMG tag for src - innerHTML for non img TAGs function ToggleBlockCategory(block, icon, src_expand, src_collapse, alt_expand, alt_collapse) { var Img_tag='IMG'; @@ -112,7 +49,9 @@ } } icon.title = icon.alt; - icon.innerHTML=icon.alt; // to support IE7&8 use innerHTML istead of textContent + if (icon.nodeName != Img_tag) { + icon.innerHTML=icon.alt; // to support IE7&8 use innerHTML istead of textContent + } } // source: http://stackoverflow.com/questions/1991608/find-base-name-in-url-in-javascript function findBaseName(url) { Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_index.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_index.html 2012-09-26 12:04:53 UTC (rev 10193) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_index.html 2012-09-26 12:51:23 UTC (rev 10194) @@ -65,8 +65,8 @@ <{/if}> </tr> </table> - - <div id="<{$category.cat_element_id}>" style="display: <{$category.cat_display}>"> + <!-- irmtfan move semicolon --> + <div id="<{$category.cat_element_id}>" style="display: <{$category.cat_display}>;"> <table border="0" cellspacing="2" cellpadding="0" width="100%"> <{if $category.forums}> <tr class="head" align="center"> Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_thread.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_thread.html 2012-09-26 12:04:53 UTC (rev 10193) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_thread.html 2012-09-26 12:51:23 UTC (rev 10194) @@ -48,7 +48,8 @@ <span class="pointer" onclick="ToggleBlockCategory('<{$topic_post.post_id}>',(this.firstElementChild || this.children[0]) , '<{$infobox.icon.expand}>', '<{$infobox.icon.collapse}>','<{$smarty.const._MD_NEWBB_HIDEUSERDATA}>','<{$smarty.const._MD_NEWBB_SEEUSERDATA}>')"> <{$infobox.displayImage}> </span> - <div id="<{$topic_post.post_id}>" style="display: <{$infobox.style}>" > + <!-- irmtfan move semicolon --> + <div id="<{$topic_post.post_id}>" style="display: <{$infobox.style}>;" > <div class="comUserStat"><span class="comUserStatCaption"><{$smarty.const._MD_JOINED}>:</span><br /><{$topic_post.poster.regdate}></div> <{if $topic_post.poster.from}> <div class="comUserStat"><span class="comUserStatCaption"><{$smarty.const._MD_FROM}></span> <{$topic_post.poster.from}></div> Modified: XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html 2012-09-26 12:04:53 UTC (rev 10193) +++ XoopsModules/newbb/branches/irmtfan/newbb/templates/newbb_viewtopic.html 2012-09-26 12:51:23 UTC (rev 10194) @@ -124,8 +124,8 @@ <{/foreach}> <{/if}> </select> - - <{if $rating_enable}> + <!-- irmtfan user should not see rating if he dont have permission --> + <{if $rating_enable && $forum_post && $forum_reply}> <select name="rate" id="rate" onchange="if(this.options[this.selectedIndex].value.length >0 ) { window.document.location=this.options[this.selectedIndex].value;}" @@ -226,7 +226,8 @@ </a> </div> <br /> - <div id="qr" style="display: <{$quickreply.style}>"> + <!-- irmtfan move semicolon --> + <div id="qr" style="display: <{$quickreply.style}>;"> <div><{$quickreply.form}></div> </div> <br /> Modified: XoopsModules/newbb/branches/irmtfan/newbb/topicmanager.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/topicmanager.php 2012-09-26 12:04:53 UTC (rev 10193) +++ XoopsModules/newbb/branches/irmtfan/newbb/topicmanager.php 2012-09-26 12:51:23 UTC (rev 10194) @@ -221,7 +221,8 @@ // irmtfan full URL echo $action[$mode]['msg']."<p><a href='".XOOPS_URL."/modules/".$xoopsModule->getVar("dirname")."/viewtopic.php?topic_id=$topic_id&forum=$newforum'>"._MD_GOTONEWFORUM."</a></p><p><a href='".XOOPS_URL."/modules/newbb/index.php'>"._MD_RETURNFORUMINDEX."</a></p>"; } else { - redirect_header("javascript:history.go(-1)",2,_MD_ERRORFORUM); + // irmtfan - issue with javascript:history.go(-1) + redirect_header($_SERVER['HTTP_REFERER'],2,_MD_ERRORFORUM); } } else { $topic_id = $topic_id[0]; Modified: XoopsModules/newbb/branches/irmtfan/newbb/viewtopic.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/viewtopic.php 2012-09-26 12:04:53 UTC (rev 10193) +++ XoopsModules/newbb/branches/irmtfan/newbb/viewtopic.php 2012-09-26 12:51:23 UTC (rev 10194) @@ -149,11 +149,11 @@ "collapse" => $icon_handler->getImageSource("more")) ; if($infobox['show'] == 1){ - $infobox['style']='none;'; + $infobox['style']='none'; //irmtfan move semicolon $infobox['alt'] = _MD_NEWBB_SEEUSERDATA; $infobox['src']="more"; } else { - $infobox['style']='block;'; + $infobox['style']='block'; //irmtfan move semicolon $infobox['alt'] = _MD_NEWBB_HIDEUSERDATA; $infobox['src']="less"; } @@ -183,18 +183,22 @@ $t_new = newbb_displayImage('t_new', _MD_POSTNEW); $t_reply = newbb_displayImage('t_reply', _MD_REPLY); - +// irmtfan show topic status if show reg is 0 and revise forum_post_or_register if ($topic_handler->getPermission($forum_obj, $topic_obj->getVar('topic_status'), "post")) { - $xoopsTpl->assign('forum_post_or_register', "<a href=\"".XOOPS_URL."/modules/".$xoopsModule->getVar("dirname", "n")."/newtopic.php?forum=".$forum_id."\">".$t_new."</a>"); -} elseif ( !empty($GLOBALS["xoopsModuleConfig"]["show_reg"]) ) { + $xoopsTpl->assign('forum_post', "<a href=\"".XOOPS_URL."/modules/".$xoopsModule->getVar("dirname", "n")."/newtopic.php?forum=".$forum_id."\">".$t_new."</a>"); +} else { if ($topic_obj->getVar('topic_status')) { - $xoopsTpl->assign('forum_post_or_register', _MD_TOPICLOCKED); - } elseif ( !is_object($xoopsUser)) { - $xoopsTpl->assign('forum_post_or_register', '<a href="'.XOOPS_URL.'/user.php?xoops_redirect='.htmlspecialchars($xoopsRequestUri).'">'._MD_REGTOPOST.'</a>'); + $xoopsTpl->assign('topic_lock', _MD_TOPICLOCKED); + } + if (!empty($GLOBALS["xoopsModuleConfig"]["show_reg"]) && !is_object($xoopsUser)) { + $xoopsTpl->assign('forum_register', '<a href="'.XOOPS_URL.'/user.php?xoops_redirect='.htmlspecialchars($xoopsRequestUri).'">'._MD_REGTOPOST.'</a>'); } -} else { - $xoopsTpl->assign('forum_post_or_register', ''); } +// irmtfan for backward compatibility assign forum_post_or_register smarty again. +$xoopsTpl->assign('forum_post_or_register',@$xoopsTpl->get_template_vars("forum_post") . + @$xoopsTpl->get_template_vars("forum_register") . + @$xoopsTpl->get_template_vars("topic_lock")); + if ($topic_handler->getPermission($forum_obj, $topic_obj->getVar('topic_status'), "reply")) { $xoopsTpl->assign('forum_reply', "<a href=\"".XOOPS_URL."/modules/".$xoopsModule->getVar("dirname", "n")."/reply.php?topic_id=".$topic_id."\">".$t_reply."</a>"); } @@ -672,11 +676,11 @@ $quickreply['show'] = 1; // = !empty($xoopsModuleConfig['quickreply_enabled'] $quickreply['expand'] = (count($toggles) > 0) ? ( (in_array('qr', $toggles)) ? false : true ) : true; if ($quickreply['expand']) { - $quickreply['style'] = 'block;'; + $quickreply['style'] = 'block'; //irmtfan move semicolon $quickreply_icon_display = $qr_expand; $quickreply_alt = _MD_NEWBB_HIDE.' '._MD_QUICKREPLY; } else { - $quickreply['style'] = 'none;'; + $quickreply['style'] = 'none'; //irmtfan move semicolon $quickreply_icon_display = $qr_collapse; $quickreply_alt = _MD_NEWBB_SEE.' '._MD_QUICKREPLY; } Modified: XoopsModules/newbb/branches/irmtfan/newbb/votepolls.php =================================================================== --- XoopsModules/newbb/branches/irmtfan/newbb/votepolls.php 2012-09-26 12:04:53 UTC (rev 10193) +++ XoopsModules/newbb/branches/irmtfan/newbb/votepolls.php 2012-09-26 12:51:23 UTC (rev 10194) @@ -72,7 +72,8 @@ $topic_handler =& xoops_getmodulehandler('topic', 'newbb'); $topic_obj =& $topic_handler->get($topic_id); if (!$topic_handler->getPermission($topic_obj->getVar("forum_id"), $topic_obj->getVar('topic_status'), "vote")) { - redirect_header("javascript:history.go(-1);", 2, _NOPERM); + // irmtfan - issue with javascript:history.go(-1) + redirect_header($_SERVER['HTTP_REFERER'], 2, _NOPERM); } if ( !empty($_POST['option_id']) ) { @@ -128,5 +129,6 @@ redirect_header(XOOPS_URL."/modules/newbb/viewtopic.php?topic_id=$topic_id&forum=$forum&poll_id=$poll_id&pollresult=1", 1, $msg); exit(); } -redirect_header(XOOPS_URL."/modules/newbb/viewtopic.php?topic_id=$topic_id&forum=$forum", 1, "You must choose an option !!"); -?> +// irmtfan - add error message +redirect_header(XOOPS_URL."/modules/newbb/viewtopic.php?topic_id=$topic_id&forum=$forum", 1, _MD_POLL_NOOPTION); +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |