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] |