/** * Checks if a user has postpermission in given thread * @param database object * @param int * @param int * @param int * @param boolean * @param boolean * * @pre: fb_has_read_permission() */ function fb_has_post_permission(&$kunena_db, $catid, $replyto, $userid, $pubwrite, $ismod) { $fbConfig =& CKunenaConfig::getInstance(); if ($ismod) { return 1; } // moderators always have post permission if ($replyto != 0) { $kunena_db->setQuery("SELECT thread FROM #__fb_messages WHERE id='{$replyto}'"); $topicID = $kunena_db->loadResult(); if ($topicID != 0) { //message replied to is not the topic post; check if the topic post itself is locked $sql = "SELECT locked FROM #__fb_messages WHERE id='{$topicID}'"; } else { $sql = "SELECT locked FROM #__fb_messages WHERE id='{$replyto}'"; } $kunena_db->setQuery($sql); if ($kunena_db->loadResult() == 1) { return -1; } // topic locked } //topic not locked; check if forum is locked $kunena_db->setQuery("SELECT locked FROM #__fb_categories WHERE id='{$catid}'"); if ($kunena_db->loadResult() == 1) { return -2; } // forum locked if ($userid != 0 || $pubwrite) { return 1; } // post permission :-) return 0; // no public writing allowed }
function KunenaViewPagination($catid, $threadid, $page, $totalpages, $maxpages) { $fbConfig =& CKunenaConfig::getInstance(); $startpage = $page - floor($maxpages / 2) < 1 ? 1 : $page - floor($maxpages / 2); $endpage = $startpage + $maxpages; if ($endpage > $totalpages) { $startpage = $totalpages - $maxpages < 1 ? 1 : $totalpages - $maxpages; $endpage = $totalpages; } $output = '<span class="fb_pagination">' . _PAGE; if ($startpage > 1) { if ($endpage < $totalpages) { $endpage--; } $output .= CKunenaLink::GetThreadPageLink($fbConfig, 'view', $catid, $threadid, 1, $fbConfig->messages_per_page, 1, '', $rel = 'follow'); if ($startpage > 2) { $output .= "..."; } } for ($i = $startpage; $i <= $endpage && $i <= $totalpages; $i++) { if ($page == $i) { $output .= "<strong>{$i}</strong>"; } else { $output .= CKunenaLink::GetThreadPageLink($fbConfig, 'view', $catid, $threadid, $i, $fbConfig->messages_per_page, $i, '', $rel = 'follow'); } } if ($endpage < $totalpages) { if ($endpage < $totalpages - 1) { $output .= "..."; } $output .= CKunenaLink::GetThreadPageLink($fbConfig, 'view', $catid, $threadid, $totalpages, $fbConfig->messages_per_page, $totalpages, '', $rel = 'follow'); } $output .= '</span>'; return $output; }
function setdefault() { $db = JFactory::getDBO (); $app = JFactory::getApplication (); $config = KunenaFactory::getConfig (); if (! JRequest::checkToken ()) { $app->enqueueMessage ( JText::_ ( 'COM_KUNENA_ERROR_TOKEN' ), 'error' ); $app->redirect ( KunenaRoute::_($this->baseurl, false) ); } $config->backup (); $config->remove (); $config = new CKunenaConfig(); $config->create(); $app->enqueueMessage ( JText::_('COM_KUNENA_CONFIG_DEFAULT')); $app->redirect ( KunenaRoute::_($this->baseurl, false) ); }
/** * Generate forum API * * @param moscomprofilerUser $user * @param array $params * @return object */ function getConfig($user) { global $_CB_database; static $forum = null; if ($forum === null) { $forum = $this->getForumParams(); if ($forum !== null) { if ($forum->prefix != 'kunena' || $forum->prefix == 'kunena' && !class_exists('KunenaForum')) { if (!$forum->config) { $query = 'SELECT * FROM ' . $_CB_database->NameQuote('#__' . $forum->prefix . '_config'); $_CB_database->setQuery($query); $forum->config = $_CB_database->loadAssoc(); } else { if ($forum->component == 'com_fireboard') { global $fbConfig; $config =& $fbConfig; } elseif ($forum->component != 'com_kunena') { global $sbConfig; $config =& $sbConfig; } include_once $forum->config; if ($forum->component == 'com_kunena') { $config = get_object_vars(CKunenaConfig::getInstance()); } $forum->config = $config; } } elseif (class_exists('KunenaFactory')) { $forum->config = get_object_vars(KunenaFactory::getConfig()); } else { $forum->config = null; } $forum->version = $this->getVersion($forum); } } if ($forum !== null && isset($user->id)) { $forum->userdetails = $this->getUserDetails($user, $forum); } return $forum; }
public function &getInstance() { static $instance = NULL; if (! $instance) { $instance = new CKunenaConfig (); $instance->load (); } return $instance; }
function TagExtended(&$tag_new, &$task, $tag, $between) { # Function replaces TAGs with corresponding # Encode was already been called for between $fbConfig =& CKunenaConfig::getInstance(); $kunena_my =& JFactory::getUser(); if ($task->in_code) { switch (strtolower($tag->name)) { case 'code:1': // fb ancient compatibility // fb ancient compatibility case 'code': $types = array("php", "mysql", "html", "js", "javascript"); $code_start_html = '<div class="fbcode"><table cellspacing="1" cellpadding="3" border="0"><tr><td><b>' . _KUNENA_MSG_CODE . '</b></td></tr><tr><td><hr />'; if (!empty($tag->options["type"]) && in_array($tag->options["type"], $types)) { $t_type = $tag->options["type"]; } else { $t_type = "php"; } // make sure we show line breaks $code_start_html .= "<code class=\"{$t_type}\">"; $code_end_html = '</code><hr /></td></tr></table></div>'; // Preserve spaces and tabs in code $codetext = str_replace("\t", "__FBTAB__", $between); $codetext = kunena_htmlspecialchars($codetext, ENT_QUOTES); $codetext = str_replace(" ", " ", $codetext); $tag_new = $code_start_html . $codetext . $code_end_html; #reenter regular replacements $task->in_code = FALSE; return TAGPARSER_RET_REPLACED; break; default: break; } return TAGPARSER_RET_NOTHING; } switch (strtolower($tag->name)) { # call html_entity_decode_utf8 if Encode() did not already!!! # in general $between was already Encoded (if not explicitly suppressed!) case 'email': $tempstr = kunena_htmlspecialchars($between, ENT_QUOTES); if (substr($tempstr, 0, 7) == 'mailto:') { $between = substr($tempstr, 7); } else { $tempstr = 'mailto:' . $tempstr; } $tag_new = "<a href='" . $tempstr . "'>" . $between . '</a>'; return TAGPARSER_RET_REPLACED; break; case 'url': $tempstr = kunena_htmlspecialchars($between, ENT_QUOTES); if (!preg_match("`^(https?://)`", $tempstr)) { $tempstr = 'http://' . $tempstr; } $tag_new = "<a href='" . $tempstr . "' rel=\"nofollow\" target=\"_blank\">" . $between . '</a>'; return TAGPARSER_RET_REPLACED; break; case 'img': if ($between) { static $file_ext = null; $matches = null; if (empty($file_ext)) { $params =& JComponentHelper::getParams('com_media'); $file_ext = explode(',', $params->get('upload_extensions')); } preg_match('/\\.([\\w\\d]+)$/', $between, $matches); if (!in_array(strtolower($matches[1]), $file_ext)) { break; } $tempstr = kunena_htmlspecialchars($between, ENT_QUOTES); $task->autolink_disable--; # continue autolink conversion // Make sure we add image size if specified and while we are // at it also set maximum image width from text width config. // // NOTICE: image max variables from config are not intended // for formating but to limit the size of uploads, which can // be larger than the available post area to support super- // sized popups. $imgmaxsize = (int) ($fbConfig->rtewidth * 9 / 10); // 90% of text width $imgtagsize = isset($tag->options["size"]) ? (int) kunena_htmlspecialchars($tag->options["size"]) : 0; if ($imgtagsize > 0 && $imgtagsize < $imgmaxsize) { $imgmaxsize = $imgtagsize; } // Need to check if we are nested inside a URL code if ($task->autolink_disable == 0) { // This part: <div style=\"table-layout:fixed; display:table;\"> ... </div> compliments of IE8 $tag_new = "<a href='" . $tempstr . "' rel=\"lightbox\"><img src='" . $tempstr . ($imgtagsize ? "' width='" . $imgmaxsize : '') . "' style='max-width:" . $imgmaxsize . "px; ' alt='' /></a>"; } else { // This part: <div style=\"table-layout:fixed; display:table;\"> ... </div> compliments of IE8 $tag_new = "<img src='" . $tempstr . ($imgtagsize ? "' width='" . $imgmaxsize : '') . "' style='max-width:" . $imgmaxsize . "px; ' alt='' />"; } return TAGPARSER_RET_REPLACED; } return TAGPARSER_RET_NOTHING; break; case 'file': if ($between) { $tempstr = kunena_htmlspecialchars($between, ENT_QUOTES); $task->autolink_disable--; # continue autolink conversion $tag_new = "<div class=\"fb_file_attachment\"><span class=\"contentheading\">" . _KUNENA_FILEATTACH . "</span><br>" . _KUNENA_FILENAME . "<a href='" . $tempstr . "' target=\"_blank\" rel=\"nofollow\">" . ($tag->options["name"] ? kunena_htmlspecialchars($tag->options["name"]) : $tempstr) . "</a><br>" . _KUNENA_FILESIZE . kunena_htmlspecialchars($tag->options["size"], ENT_QUOTES) . "</div>"; return TAGPARSER_RET_REPLACED; } return TAGPARSER_RET_NOTHING; break; case 'quote': $tag_new = '<span class="fb_quote">' . $between . '</span>'; return TAGPARSER_RET_REPLACED; break; case 'list': $tag_new = '<ul>'; $tag_new .= "\n"; $linearr = explode('[*]', $between); for ($i = 0; $i < count($linearr); $i++) { $tmp = trim($linearr[$i]); if (strlen($tmp)) { $tag_new .= '<li>' . trim($linearr[$i]) . '</li>'; $tag_new .= "\n"; } } $tag_new .= '</ul>'; $tag_new .= "\n"; return TAGPARSER_RET_REPLACED; break; case 'video': $task->autolink_disable--; if (!$between) { return TAGPARSER_RET_NOTHING; } // --- config start ------------ $vid_minwidth = 20; $vid_minheight = 20; // min. display size //$vid_maxwidth = 640; $vid_maxheight = 480; // max. display size $vid_maxwidth = (int) ($fbConfig->rtewidth * 9 / 10); // Max 90% of text width $vid_maxheight = 480; // max. display size $vid_sizemax = 100; // max. display zoom in percent // --- config end -------------- $vid["type"] = isset($tag->options["type"]) ? kunena_htmlspecialchars(strtolower($tag->options["type"])) : ''; $vid["param"] = isset($tag->options["param"]) ? kunena_htmlspecialchars($tag->options["param"]) : ''; if (!$vid["type"]) { $vid_players = array('divx' => 'divx', 'flash' => 'swf', 'mediaplayer' => 'avi,mp3,wma,wmv', 'quicktime' => 'mov,qt,qti,qtif,qtvr', 'realplayer', 'rm'); foreach ($vid_players as $vid_player => $vid_exts) { foreach (explode(',', $vid_exts) as $vid_ext) { if (preg_match('/^(.*\\.' . $vid_ext . ')$/i', $between) > 0) { $vid["type"] = $vid_player; break 2; } } } unset($vid_players); } if (!$vid["type"]) { if ($vid_auto = preg_match('/^http:\\/\\/.*?([^.]*)\\.[^.]*(\\/|$)/', $between, $vid_regs) > 0) { $vid["type"] = strtolower($vid_regs[1]); switch ($vid["type"]) { case 'clip': $vid["type"] = 'clip.vn'; break; case 'web': $vid["type"] = 'web.de'; break; case 'wideo': $vid["type"] = 'wideo.fr'; break; } } } $vid_providers = array('animeepisodes' => array('flash', 428, 352, 0, 0, 'http://video.animeepisodes.net/vidiac.swf', '\\/([\\w\\-]*).htm', array(array(6, 'flashvars', 'video=%vcode%'))), 'biku' => array('flash', 450, 364, 0, 0, 'http://www.biku.com/opus/player.swf?VideoID=%vcode%&embed=true&autoStart=false', '\\/([\\w\\-]*).html'), 'bofunk' => array('flash', 446, 370, 0, 0, 'http://www.bofunk.com/e/%vcode%', ''), 'break' => array('flash', 464, 392, 0, 0, 'http://embed.break.com/%vcode%', ''), 'clip.vn' => array('flash', 448, 372, 0, 0, 'http://clip.vn/w/%vcode%,en,0', '\\/watch\\/([\\w\\-]*),vn'), 'clipfish' => array('flash', 464, 380, 0, 0, 'http://www.clipfish.de/videoplayer.swf?as=0&videoid=%vcode%&r=1&c=0067B3', 'videoid=([\\w\\-]*)'), 'clipshack' => array('flash', 430, 370, 0, 0, 'http://clipshack.com/player.swf?key=%vcode%', 'key=([\\w\\-]*)', array(array(6, 'wmode', 'transparent'))), 'collegehumor' => array('flash', 480, 360, 0, 0, 'http://www.collegehumor.com/moogaloop/moogaloop.swf?clip_id=%vcode%&fullscreen=1', '\\/video:(\\d*)'), 'current' => array('flash', 400, 400, 0, 0, 'http://current.com/e/%vcode%', '\\/items\\/(\\d*)', array(array(6, 'wmode', 'transparent'))), 'dailymotion' => array('flash', 420, 331, 0, 0, 'http://www.dailymotion.com/swf/%vcode%', '\\/video\\/([a-zA-Z0-9]*)'), 'downloadfestival' => array('flash', 450, 358, 0, 0, 'http://www.downloadfestival.tv/mofo/video/player/playerb003External.swf?rid=%vcode%', '\\/watch\\/([\\d]*)'), 'flashvars' => array('flash', 480, 360, 0, 0, $between, '', array(array(6, 'flashvars', $vid["param"]))), 'fliptrack' => array('flash', 402, 302, 0, 0, 'http://www.fliptrack.com/v/%vcode%', '\\/watch\\/([\\w\\-]*)'), 'fliqz' => array('flash', 450, 392, 0, 0, 'http://content.fliqz.com/components/2d39cfef9385473c89939c2a5a7064f5.swf', 'vid=([\\w]*)', array(array(6, 'flashvars', 'file=%vcode%&'), array(6, 'wmode', 'transparent'), array(6, 'bgcolor', '#000000'))), 'gametrailers' => array('flash', 480, 392, 0, 0, 'http://www.gametrailers.com/remote_wrap.php?mid=%vcode%', '\\/(\\d*).html'), 'gamevideos' => array('flash', 420, 405, 0, 0, 'http://www.gamevideos.com/swf/gamevideos11.swf?embedded=1&fullscreen=1&autoplay=0&src=http://www.gamevideos.com/video/videoListXML%3Fid%3D%vcode%%26adPlay%3Dfalse', '\\/video\\/id\\/(\\d*)', array(array(6, 'bgcolor', '#000000'), array(6, 'wmode', 'window'))), 'glumbert' => array('flash', 448, 336, 0, 0, 'http://www.glumbert.com/embed/%vcode%', '\\/media\\/([\\w\\-]*)', array(array(6, 'wmode', 'transparent'))), 'gmx' => array('flash', 425, 367, 0, 0, 'http://video.gmx.net/movie/%vcode%', '\\/watch\\/(\\d*)'), 'google' => array('flash', 400, 326, 0, 0, 'http://video.google.com/googleplayer.swf?docId=%vcode%', 'docid=(\\d*)'), 'googlyfoogly' => array('mediaplayer', 400, 300, 0, 25, 'http://media.googlyfoogly.com/images/videos/%vcode%.wmv', ''), 'ifilm' => array('flash', 448, 365, 0, 0, 'http://www.ifilm.com/efp', '\\/video\\/(\\d*)', array(array(6, 'flashvars', 'flvbaseclip=%vcode%'))), 'jumpcut' => array('flash', 408, 324, 0, 0, 'http://jumpcut.com/media/flash/jump.swf?id=%vcode%&asset_type=movie&asset_id=%vcode%&eb=1', '\\/\\?id=([\\w\\-]*)'), 'kewego' => array('flash', 400, 368, 0, 0, 'http://www.kewego.com/p/en/%vcode%.html', '\\/([\\w\\-]*)\\.html', array(array(6, 'wmode', 'transparent'))), 'liveleak' => array('flash', 450, 370, 0, 0, 'http://www.liveleak.com/player.swf', '\\/view\\?i=([\\w\\-]*)', array(array(6, 'flashvars', 'autostart=false&token=%vcode%'), array(6, 'wmode', 'transparent'))), 'livevideo' => array('flash', 445, 369, 0, 0, 'http://www.livevideo.com/flvplayer/embed/%vcode%', ''), 'megavideo' => array('flash', 432, 351, 0, 0, 'http://www.megavideo.com/v/%vcode%..0', '', array(array(6, 'wmode', 'transparent'))), 'metacafe' => array('flash', 400, 345, 0, 0, 'http://www.metacafe.com/fplayer/%vcode%/.swf', '\\/watch\\/(\\d*\\/[\\w\\-]*)', array(array(6, 'wmode', 'transparent'))), 'mofile' => array('flash', 480, 395, 0, 0, 'http://tv.mofile.com/cn/xplayer.swf', '\\.com\\/([\\w\\-]*)', array(array(6, 'flashvars', 'v=%vcode%&autoplay=0&nowSkin=0_0'), array(6, 'wmode', 'transparent'))), 'multiply' => array('flash', 400, 350, 0, 0, 'http://images.multiply.com/multiply/multv.swf', '', array(array(6, 'flashvars', 'first_video_id=%vcode%&base_uri=multiply.com&is_owned=1'))), 'myspace' => array('flash', 430, 346, 0, 0, 'http://lads.myspace.com/videos/vplayer.swf', 'VideoID=(\\d*)', array(array(6, 'flashvars', 'm=%vcode%&v=2&type=video'))), 'myvideo' => array('flash', 470, 406, 0, 0, 'http://www.myvideo.de/movie/%vcode%', '\\/watch\\/(\\d*)'), 'quxiu' => array('flash', 437, 375, 0, 0, 'http://www.quxiu.com/photo/swf/swfobj.swf?id=%vcode%', '\\/play_([\\d_]*)\\.htm', array(array(6, 'menu', 'false'))), 'revver' => array('flash', 480, 392, 0, 0, 'http://flash.revver.com/player/1.0/player.swf?mediaId=%vcode%', '\\/video\\/([\\d_]*)'), 'rutube' => array('flash', 400, 353, 0, 0, 'http://video.rutube.ru/%vcode%', '\\.html\\?v=([\\w]*)'), 'sapo' => array('flash', 400, 322, 0, 0, 'http://rd3.videos.sapo.pt/play?file=http://rd3.videos.sapo.pt/%vcode%/mov/1', 'videos\\.sapo\\.pt\\/([\\w]*)', array(array(6, 'wmode', 'transparent'))), 'sevenload' => array('flash', 425, 350, 0, 0, 'http://sevenload.com/pl/%vcode%/425x350/swf', '\\/videos\\/([\\w]*)', array(array(6, 'flashvars', 'apiHost=api.sevenload.com&showFullScreen=1'))), 'sharkle' => array('flash', 340, 310, 0, 0, 'http://sharkle.com/sharkle.swf?rnd=%vcode%&buffer=3', '', array(array(6, 'wmode', 'transparent'))), 'spikedhumor' => array('flash', 400, 345, 0, 0, 'http://www.spikedhumor.com/player/vcplayer.swf?file=http://www.spikedhumor.com/videocodes/%vcode%/data.xml&auto_play=false', '\\/articles\\/([\\d]*)'), 'stickam' => array('flash', 400, 300, 0, 0, 'http://player.stickam.com/flashVarMediaPlayer/%vcode%', 'mId=([\\d]*)'), 'streetfire' => array('flash', 428, 352, 0, 0, 'http://videos.streetfire.net/vidiac.swf', '\\/([\\w-]*).htm', array(array(6, 'flashvars', 'video=%vcode%'))), 'stupidvideos' => array('flash', 451, 433, 0, 0, 'http://img.purevideo.com/images/player/player.swf?sa=1&sk=5&si=2&i=%vcode%', '\\/\\?m=new#([\\d_]*)'), 'toufee' => array('flash', 550, 270, 0, 0, 'http://toufee.com/movies/Movie.swf', 'u=[a-zA-Z]*(\\d*)', array(array(6, 'flashvars', 'movieID=%vcode%&domainName=toufee'))), 'tudou' => array('flash', 400, 300, 0, 0, 'http://www.tudou.com/v/%vcode%', '\\/view\\/([\\w-]*)', array(array(6, 'wmode', 'transparent'))), 'unf-unf' => array('flash', 425, 350, 0, 0, 'http://www.unf-unf.de/video/flvplayer.swf?file=http://www.unf-unf.de/video/clips/%vcode%.flv', '\\/([\\w-]*).html', array(array(6, 'wmode', 'transparent'))), 'uume' => array('flash', 400, 342, 0, 0, 'http://www.uume.com/v/%vcode%_UUME'), '\\/play_([\\w-]*)', 'veoh' => array('flash', 540, 438, 0, 0, 'http://www.veoh.com/videodetails2.swf?player=videodetailsembedded&type=v&permalinkId=%vcode%'), '\\/videos\\/([\\w-]*)', 'videoclipsdump' => array('flash', 480, 400, 0, 0, 'http://www.videoclipsdump.com/player/simple.swf', '', array(array(6, 'flashvars', 'url=http://www.videoclipsdump.com/files/%vcode%.flv&autoplay=0&watermark=http://www.videoclipsdump.com/flv_watermark.php&buffer=10&full=0&siteurl=http://www.videoclipsdump.com&interval=10000&totalrotate=3'))), 'videojug' => array('flash', 400, 345, 0, 0, 'http://www.videojug.com/film/player?id=%vcode%', ''), 'videotube' => array('flash', 480, 400, 0, 0, 'http://www.videotube.de/flash/player.swf', '\\/watch\\/(\\d*)', array(array(6, 'flashvars', 'baseURL=http://www.videotube.de/watch/%vcode%'), array(6, 'wmode', 'transparent'))), 'vidiac' => array('flash', 428, 352, 0, 0, 'http://www.vidiac.com/vidiac.swf', '\\/([\\w-]*).htm', array(array(6, 'flashvars', 'video=%vcode%'))), 'vidilife' => array('flash', 445, 369, 0, 0, 'http://www.vidiLife.com/flash/flvplayer.swf?autoStart=0&popup=1&video=http://www.vidiLife.com/media/flash_api.cfm?id=%vcode%&version=8', ''), 'vimeo' => array('flash', 400, 321, 0, 0, 'http://www.vimeo.com/moogaloop.swf?clip_id=%vcode%&server=www.vimeo.com&fullscreen=1&show_title=1&show_byline=1&show_portrait=0&color=', '\\.com\\/(\\d*)'), 'wangyou' => array('flash', 441, 384, 0, 0, 'http://v.wangyou.com/images/x_player.swf?id=%vcode%', '\\/p(\\d*).html', array(array(6, 'wmode', 'transparent'))), 'web.de' => array('flash', 425, 367, 0, 0, 'http://video.web.de/movie/%vcode%', '\\/watch\\/(\\d*)'), 'wideo.fr' => array('flash', 400, 368, 0, 0, 'http://www.wideo.fr/p/fr/%vcode%.html', '\\/([\\w-]*).html', array(array(6, 'wmode', 'transparent'))), 'youku' => array('flash', 480, 400, 0, 0, 'http://player.youku.com/player.php/sid/%vcode%/v.swf', '\\/v_show\\/id_c.00(.*)\\.html'), 'youtube' => array('flash', 425, 355, 0, 0, 'http://www.youtube.com/v/%vcode%&rel=1', '\\/watch\\?v=([\\w\\-]*)', array(array(6, 'wmode', 'transparent'))), '_default' => array($vid["type"], 480, 360, 0, 25, $between, '')); list($vid_type, $vid_width, $vid_height, $vid_addx, $vid_addy, $vid_source, $vid_match, $vid_par2) = isset($vid_providers[$vid["type"]]) ? $vid_providers[$vid["type"]] : $vid_providers["_default"]; unset($vid_providers); if (!empty($vid_auto)) { if ($vid_match and preg_match("/{$vid_match}/i", $between, $vid_regs) > 0) { $between = $vid_regs[1]; } else { return TAGPARSER_RET_NOTHING; } } $vid_source = preg_replace('/%vcode%/', $between, $vid_source); if (!is_array($vid_par2)) { $vid_par2 = array(); } $vid_size = isset($tag->options["size"]) ? intval($tag->options["size"]) : 0; if ($vid_size > 0 and $vid_size < $vid_sizemax) { $vid_width = (int) ($vid_width * $vid_size / 100); $vid_height = (int) ($vid_height * $vid_size / 100); } $vid_width += $vid_addx; $vid_height += $vid_addy; if (!isset($tag->options["size"])) { if (isset($tag->options["width"])) { $vid_width = intval($tag->options["width"]); } if (isset($tag->options["height"])) { $vid_height = intval($tag->options["height"]); } } if ($vid_width < $vid_minwidth) { $vid_width = $vid_minwidth; } if ($vid_width > $vid_maxwidth) { $vid_width = $vid_maxwidth; } if ($vid_height < $vid_minheight) { $vid_height = $vid_minheight; } if ($vid_height > $vid_maxheight) { $vid_height = $vid_maxheight; } switch ($vid_type) { case 'divx': $vid_par1 = array(array(1, 'classid', 'clsid:67DABFBF-D0AB-41fa-9C46-CC0F21721616'), array(1, 'codebase', 'http://go.divx.com/plugin/DivXBrowserPlugin.cab'), array(4, 'type', 'video/divx'), array(4, 'pluginspage', 'http://go.divx.com/plugin/download/'), array(6, 'src', $vid_source), array(6, 'autoplay', 'false'), array(5, 'width', $vid_width), array(5, 'height', $vid_height)); $vid_allowpar = array('previewimage'); break; case 'flash': $vid_par1 = array(array(1, 'classid', 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'), array(1, 'codebase', 'http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab'), array(2, 'movie', $vid_source), array(4, 'src', $vid_source), array(4, 'type', 'application/x-shockwave-flash'), array(4, 'pluginspage', 'http://www.macromedia.com/go/getflashplayer'), array(6, 'quality', 'high'), array(6, 'allowFullScreen', 'true'), array(6, 'allowScriptAccess', 'never'), array(5, 'width', $vid_width), array(5, 'height', $vid_height)); $vid_allowpar = array('flashvars', 'wmode', 'bgcolor', 'quality'); break; case 'mediaplayer': $vid_par1 = array(array(1, 'classid', 'clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95'), array(1, 'codebase', 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab'), array(4, 'type', 'application/x-mplayer2'), array(4, 'pluginspage', 'http://www.microsoft.com/Windows/MediaPlayer/'), array(6, 'src', $vid_source), array(6, 'autostart', 'false'), array(6, 'autosize', 'true'), array(5, 'width', $vid_width), array(5, 'height', $vid_height)); $vid_allowpar = array(); break; case 'quicktime': $vid_par1 = array(array(1, 'classid', 'clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B'), array(1, 'codebase', 'http://www.apple.com/qtactivex/qtplugin.cab'), array(4, 'type', 'video/quicktime'), array(4, 'pluginspage', 'http://www.apple.com/quicktime/download/'), array(6, 'src', $vid_source), array(6, 'autoplay', 'false'), array(6, 'scale', 'aspect'), array(5, 'width', $vid_width), array(5, 'height', $vid_height)); $vid_allowpar = array(); break; case 'realplayer': $vid_par1 = array(array(1, 'classid', 'clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA'), array(4, 'type', 'audio/x-pn-realaudio-plugin'), array(6, 'src', $vid_source), array(6, 'autostart', 'false'), array(6, 'controls', 'ImageWindow,ControlPanel'), array(5, 'width', $vid_width), array(5, 'height', $vid_height)); $vid_allowpar = array(); break; default: return TAGPARSER_RET_NOTHING; } $vid_par3 = array(); foreach ($tag->options as $vid_key => $vid_value) { if (in_array(strtolower($vid_key), $vid_allowpar)) { array_push($vid_par3, array(6, $vid_key, kunena_htmlspecialchars($vid_value))); } } $vid_object = $vid_param = $vid_embed = array(); foreach (array_merge($vid_par1, $vid_par2, $vid_par3) as $vid_data) { list($vid_key, $vid_name, $vid_value) = $vid_data; if ($vid_key & 1) { $vid_object[$vid_name] = ' ' . $vid_name . '="' . preg_replace('/%vcode%/', $between, $vid_value) . '"'; } if ($vid_key & 2) { $vid_param[$vid_name] = '<param name="' . $vid_name . '" value="' . preg_replace('/%vcode%/', $between, $vid_value) . '" />'; } if ($vid_key & 4) { $vid_embed[$vid_name] = ' ' . $vid_name . '="' . preg_replace('/%vcode%/', $between, $vid_value) . '"'; } } $tag_new = '<object'; foreach ($vid_object as $vid_data) { $tag_new .= $vid_data; } $tag_new .= '>'; foreach ($vid_param as $vid_data) { $tag_new .= $vid_data; } $tag_new .= '<embed'; foreach ($vid_embed as $vid_data) { $tag_new .= $vid_data; } $tag_new .= ' /></object>'; return TAGPARSER_RET_REPLACED; break; case 'ebay': if ($between) { $task->autolink_disable--; # continue autolink conversion $tage_new = ""; if (is_numeric($between)) { // Numeric: we have to assume this is an item id $tag_new .= '<object width="355" height="300"><param name="movie" value="http://togo.ebay.com/togo/togo.swf" /><param name="flashvars" value="base=http://togo.ebay.com/togo/&lang=' . $fbConfig->ebaylanguagecode . '&mode=normal&itemid=' . $between . '&campid=5336042350" /><embed src="http://togo.ebay.com/togo/togo.swf" type="application/x-shockwave-flash" width="355" height="300" flashvars="base=http://togo.ebay.com/togo/&lang=' . $fbConfig->ebaylanguagecode . '&mode=normal&itemid=' . $between . '&campid=5336042350"></embed></object>'; } else { // Non numeric: we have to assume this is a search $tag_new .= '<object width="355" height="300"><param name="movie" value="http://togo.ebay.com/togo/togo.swf?2008013100" /><param name="flashvars" value="base=http://togo.ebay.com/togo/&lang=' . $fbConfig->ebaylanguagecode . '&mode=search&query=' . $between . '&campid=5336042350" /><embed src="http://togo.ebay.com/togo/togo.swf?2008013100" type="application/x-shockwave-flash" width="355" height="300" flashvars="base=http://togo.ebay.com/togo/&lang=' . $fbConfig->ebaylanguagecode . '&mode=search&query=' . $between . '&campid=5336042350"></embed></object>'; } return TAGPARSER_RET_REPLACED; } return TAGPARSER_RET_NOTHING; break; case 'hide': if ($between) { if ($kunena_my->id == 0) { // Hide between content from non registered users $tag_new = _KUNENA_BBCODE_HIDDENTEXT; } else { // Display but highlight the fact that it is hidden from guests $tag_new = '<b>' . _KUNENA_BBCODE_HIDE . '</b>' . '<span class="fb_quote">' . $between . '</span>'; } return TAGPARSER_RET_REPLACED; } return TAGPARSER_RET_NOTHING; break; case 'spoiler': if ($between) { if ($this->spoilerid == 0) { // Only need the script for the first spoiler we find $app =& JFactory::getApplication(); $app->addCustomHeadTag('<script language = "JavaScript" type = "text/javascript">' . 'function fb_showDetail(srcElement) {' . 'var targetID, srcElement, targetElement, imgElementID, imgElement;' . 'targetID = srcElement.id + "_details";' . 'imgElementID = srcElement.id + "_img";' . 'targetElement = document.getElementById(targetID);' . 'imgElement = document.getElementById(imgElementID);' . 'if (targetElement.style.display == "none") {' . 'targetElement.style.display = "";' . 'imgElement.src = "' . KUNENA_JLIVEURL . '/components/com_kunena/template/default/images/english/emoticons/w00t.png";' . '} else {' . 'targetElement.style.display = "none";' . 'imgElement.src = "' . KUNENA_JLIVEURL . '/components/com_kunena/template/default/images/english/emoticons/pinch.png";' . '}} </script>'); } $this->spoilerid++; $randomid = rand(); $tag_new = '<div id="' . $randomid . '" onclick="javascript:fb_showDetail(this);" style="cursor:pointer;"><img id="' . $randomid . '_img"' . 'src="' . KUNENA_JLIVEURL . '/components/com_kunena/template/default/images/english/emoticons/pinch.png" border="0"> <strong>' . (isset($tag->options["title"]) ? $tag->options["title"] : _KUNENA_BBCODE_SPOILER) . '</strong></div><div id="' . $randomid . '_details" style="display:None;"><span class="fb_quote">' . $between . '</span></div>'; return TAGPARSER_RET_REPLACED; } return TAGPARSER_RET_NOTHING; break; default: break; } return TAGPARSER_RET_NOTHING; }
/** * Display results * @param string actionstring */ function show() { $fbConfig =& CKunenaConfig::getInstance(); extract($this->params); $q = implode(" ", $this->get_searchstrings()); $searchuser = $this->get_searchusername(); $limitstart = $this->get_limitstart(); $limit = $this->get_limit(); $selected = ' selected="selected"'; $checked = ' checked="checked"'; $fb_advsearch_hide = 1; if ($this->int_kunena_errornr) { $q = $this->searchword; $fb_advsearch_hide = 0; } if (file_exists(KUNENA_ABSTMPLTPATH . '/plugin/advancedsearch/advsearch.php')) { include KUNENA_ABSTMPLTPATH . '/plugin/advancedsearch/advsearch.php'; } else { include KUNENA_PATH_TEMPLATE_DEFAULT . DS . 'plugin/advancedsearch/advsearch.php'; } $results = $this->get_results(); $totalRows = $this->total; $pagination = KunenaSearchPagination($this->func, $q, $this->getUrlParams(), floor($limitstart / $limit) + 1, $limit, floor($totalRows / $limit) + 1, 7); if (defined('KUNENA_DEBUG')) { echo '<p style="background-color:#FFFFCC;border:1px solid red;">' . $this->str_kunena_errormsg . '</p>'; } ?> <?php if (empty($q) && empty($searchuser)) { return; } $boardclass = 'fb_'; ?> <div class="<?php echo $boardclass; ?> _bt_cvr1"> <div class="<?php echo $boardclass; ?> _bt_cvr2"> <div class="<?php echo $boardclass; ?> _bt_cvr3"> <div class="<?php echo $boardclass; ?> _bt_cvr4"> <div class="<?php echo $boardclass; ?> _bt_cvr5"> <table class = "fb_blocktable" id ="fb_forumsearch" border = "0" cellspacing = "0" cellpadding = "0" width="100%"> <thead> <tr> <th colspan = "3"> <div class = "fb_title_cover"> <span class="fb_title fbl"><?php echo _KUNENA_SEARCH_RESULTS; ?> </span> <b><?php printf(_FORUM_SEARCH, $q); ?> </b> </div> </th> </tr> </thead> <tbody> <tr class = "fb_sth"> <th class = "th-1 <?php echo $boardclass; ?> sectiontableheader"> <?php echo _GEN_SUBJECT; ?> </th> <th class = "th-2 <?php echo $boardclass; ?> sectiontableheader"> <?php echo _GEN_AUTHOR; ?> </th> <th class = "th-3 <?php echo $boardclass; ?> sectiontableheader"> <?php echo _GEN_DATE; ?> </th> </tr> <?php $tabclass = array("sectiontableentry1", "sectiontableentry2"); $k = 0; if ($totalRows == 0 && $this->int_kunena_errornr) { echo '<tr class="' . $boardclass . '' . $tabclass[$k] . '" ><td colspan="3" style="text-align:center;font-weight:bold">' . $this->str_kunena_errormsg . '</td></tr>'; } // Cleanup incoming searchword; international chars can cause garbage at the end // real problem might lie with search box form and how we post and receive the data // However, this works for now $q = trim($q); // JJ Add different color $searchlist = $this->get_searchstrings(); foreach ($results as $result) { $k = 1 - $k; $ressubject = $result->subject; // Clean up subject $ressubject = stripslashes(smile::purify($ressubject)); $resmessage = stripslashes($result->message); // Strip smiles and bbcode out of search results; they look ugly $resmessage = CKunenaTools::prepareContent($resmessage); $resmessage = smile::purify($resmessage); $resmessage = kn_mb_substr(kunena_htmlspecialchars($resmessage), 0, 300); $utf8 = KUNENA_CHARSET == 'UTF-8' ? "u" : ""; foreach ($searchlist as $searchword) { if (empty($searchword)) { continue; } $ressubject = preg_replace("/" . preg_quote($searchword, '/') . "/i" . $utf8, '<span class="searchword" >' . $searchword . '</span>', $ressubject); $resmessage = preg_replace("/" . preg_quote($searchword, '/') . "/i" . $utf8, '<span class="searchword" >' . $searchword . '</span>', $resmessage); } echo '<tr class="' . $boardclass . '' . $tabclass[$k] . '">'; echo '<td class = "td-1" ><a href="' . JRoute::_(KUNENA_LIVEURL . '&func=view&id=' . $result->id . '&catid=' . $result->catid) . '#' . $result->id . '" >' . $ressubject . '</a><br />' . $resmessage . '<br /><br /></td>'; echo '<td class = "td-2" >' . kunena_htmlspecialchars(stripslashes($result->name)) . '</td>'; echo '<td class = "td-3" >' . date(_DATETIME, $result->time) . '</td></tr>'; echo "\n"; } ?> <?php if ($totalRows > $limit) { ?> <tr class = "fb_sth" > <th colspan = "3" style = "text-align:center" class = "th-1 <?php echo $boardclass; ?> sectiontableheader"> <?php echo $pagination; ?> </th> </tr> <?php } ?> <tr class = "fb_sth" > <th colspan = "3" style = "text-align:center" class = "th-1 <?php echo $boardclass; ?> sectiontableheader"> <?php $resStart = $limitstart + 1; $resStop = $limitstart + count($results); if ($resStart < $resStop) { $resStartStop = (string) $resStart . ' - ' . (string) $resStop; } else { $resStartStop = '0'; } printf(_FORUM_SEARCHRESULTS, $resStartStop, $totalRows); ?> </th> </tr> </tbody> </table> </div> </div> </div> </div> </div> <?php }
/** * Checks if a user has postpermission in given thread * @param database object * @param int * @param int * @param boolean * @param boolean */ function hasPostPermission($kunena_db, $catid, $id, $userid, $pubwrite, $ismod) { $fbConfig =& CKunenaConfig::getInstance(); $app =& JFactory::getApplication(); $topicLock = 0; if ($id != 0) { $kunena_db->setQuery("SELECT thread FROM #__fb_messages WHERE id='{$id}'"); $topicID = $kunena_db->loadResult(); $lockedWhat = _GEN_TOPIC; if ($topicID != 0) { $sql = "SELECT locked FROM #__fb_messages WHERE id='{$topicID}'"; } else { $sql = "SELECT locked FROM #__fb_messages WHERE id='{$id}'"; } $kunena_db->setQuery($sql); $topicLock = $kunena_db->loadResult(); } if ($topicLock == 0) { //topic not locked; check if forum is locked $kunena_db->setQuery("SELECT locked FROM #__fb_categories WHERE id='{$catid}'"); $topicLock = $kunena_db->loadResult(); $lockedWhat = _GEN_FORUM; } if (($userid != 0 || $pubwrite) && ($topicLock == 0 || $ismod)) { return 1; } else { //user is not allowed to write a post if ($topicLock) { echo "<p align=\"center\">{$lockedWhat} " . _POST_LOCKED . "<br />"; echo _POST_NO_NEW . "<br /><br /></p>"; } else { $app->enqueueMessage(_POST_NO_PUBACCESS1, 'notice'); $app->enqueueMessage(_POST_NO_PUBACCESS2, 'notice'); $app->redirect(CKunenaLink::GetShowLatestURL()); } return 0; } }
/** * Triggers CB events * * Current events: profileIntegration=0/1, avatarIntegration=0/1 **/ function trigger($event, &$params) { global $_PLUGINS; $fbConfig =& CKunenaConfig::getInstance(); $params['config'] =& $fbConfig; $_PLUGINS->loadPluginGroup('user'); $_PLUGINS->trigger('kunenaIntegration', array($event, &$fbConfig, &$params)); }
/** * Function to print the pathway * @param object database object * @param object category object * @param int the post id * @param boolean set title */ function KUNENA_get_pathway(&$kunena_db, $obj_fb_cat, $bool_set_title, $obj_post = 0) { global $fbIcons; $document =& JFactory::getDocument(); $fbConfig =& CKunenaConfig::getInstance(); //Get the Category's parent category name for breadcrumb $kunena_db->setQuery("SELECT name, id FROM #__fb_categories WHERE id='" . $obj_fb_cat->getParent()) . "'"; $objCatParentInfo = $kunena_db->loadObject(); check_dberror("Unable to load categories."); //get the Moderator list for display $kunena_db->setQuery("SELECT * FROM #__fb_moderation AS m LEFT JOIN #__users AS u ON u.id=m.userid WHERE m.catid='" . $obj_fb_cat->getId() . "'"); $modslist = $kunena_db->loadObjectList(); check_dberror("Unable to load moderators."); // echo '<div class="fb_pathway">'; // List of Forums // show folder icon $return = '<img src="' . KUNENA_URLIMAGESPATH . 'folder.gif" border="0" alt="' . _GEN_FORUMLIST . '" style="vertical-align: middle;" /> '; // link to List of Forum Categories $return .= ' ' . fb_Link::GetKunenaLink(_GEN_FORUMLIST) . '<br />'; // List of Categories if ($objCatParentInfo) { if ($bool_set_title) { $document->setTitle(stripslashes($objCatParentInfo->name) . ' - ' . stripslashes($obj_fb_cat->getName()) . ' - ' . stripslashes($fbConfig->board_title)); } // show lines $return .= ' <img src="' . KUNENA_URLIMAGESPATH . 'tree-end.gif" alt="|-" border="0" style="vertical-align: middle;" />'; $return .= ' <img src="' . KUNENA_URLIMAGESPATH . 'folder.gif" alt="' . $objCatParentInfo->name . '" border="0" style="vertical-align: middle;" /> '; // link to Category $return .= ' ' . fblink::GetCategoryLink('listcat', $objCatParentInfo->id, $objCatParentInfo->name) . '<br />'; $return .= ' <img src="' . KUNENA_URLIMAGESPATH . 'tree-blank.gif" alt="| " border="0" style="vertical-align: middle;" />'; } else { if ($bool_set_title) { $document->setTitle(stripslashes($obj_fb_cat->getName()) . ' - ' . stripslashes($fbConfig->board_title)); } } // Forum // show lines $return .= ' <img src="' . KUNENA_URLIMAGESPATH . 'tree-end.gif" alt="|-" border="0" style="vertical-align: middle;" />'; $return .= ' <img src="' . KUNENA_URLIMAGESPATH . 'folder.gif" alt="+" border="0" style="vertical-align: middle;" /> '; // Link to forum $return .= ' ' . fbLink::GetCategoryLink('listcat', $obj_fb_cat->getId(), $obj_fb_cat->getName()); //check if this forum is locked if ($obj_fb_cat->getLocked()) { $return .= isset($fbIcons['forumlocked']) ? ' <img src="' . KUNENA_URLICONSPATH . $fbIcons['forumlocked'] . '" border="0" alt="' . _GEN_LOCKED_FORUM . '" title="' . _GEN_LOCKED_FORUM . '"/>' : ' <img src="' . KUNENA_URLIMAGESPATH . 'lock.gif" border="0" width="13" height="13" alt="' . _GEN_LOCKED_FORUM . '" title="' . _GEN_LOCKED_FORUM . '">'; } // check if this forum is reviewed if ($obj_fb_cat->getReview()) { $return .= isset($fbIcons['forumreviewed']) ? ' <img src="' . KUNENA_URLICONSPATH . $fbIcons['forumreviewed'] . '" border="0" alt="' . _GEN_REVIEWED . '" title="' . _GEN_REVIEWED . '"/>' : ' <img src="' . KUNENA_URLIMAGESPATH . 'review.gif" border="0" width="15" height="15" alt="' . _GEN_REVIEWED . '" title="' . _GEN_REVIEWED . '">'; } //check if this forum is moderated if ($obj_fb_cat->getModerated()) { $return .= isset($fbIcons['forummoderated']) ? ' <img src="' . KUNENA_URLICONSPATH . $fbIcons['forummoderated'] . '" border="0" alt="' . _GEN_MODERATED . '" title="' . _GEN_MODERATED . '"/>' : ' <img src="' . KUNENA_URLEMOTIONSPATH . 'moderate.gif" border="0" alt="' . _GEN_MODERATED . '" title="' . _GEN_MODERATED . '"/>'; $text = ''; if (count($modslist) > 0) { foreach ($modslist as $mod) { $text = $text . ', ' . $mod->username; } $return .= ' (' . _GEN_MODERATORS . ': ' . ltrim($text, ",") . ')'; } } if ($obj_post != 0) { if ($bool_set_title) { $document->setTitle(stripslashes($obj_post->subject) . ' - ' . stripslashes($fbConfig->board_title)); } // Topic // show lines $return .= '<br /> <img src="' . KUNENA_URLIMAGESPATH . 'tree-blank.gif" alt="| " border="0" style="vertical-align: middle;" />'; $return .= ' <img src="' . KUNENA_URLIMAGESPATH . 'tree-blank.gif" alt="| " border="0" style="vertical-align: middle;" />'; $return .= ' <img src="' . KUNENA_URLIMAGESPATH . 'tree-end.gif" alt="|-" border="0" style="vertical-align: middle;" />'; $return .= ' <img src="' . KUNENA_URLIMAGESPATH . 'folder.gif" alt="+" border="0" style="vertical-align: middle;" /> '; $return .= ' <b>' . $obj_post->subject . '</b>'; // Check if the Topic is locked? if ((int) $obj_post->locked != 0) { $return .= ' <img src="' . KUNENA_URLIMAGESPATH . 'lock.gif" border="0" width="13" height="13" alt="' . _GEN_LOCKED_TOPIC . '" title="' . _GEN_LOCKED_TOPIC . '"/>'; } } // echo '</div>'; return $return; }
function CKunenaUsers() { $fbConfig =& CKunenaConfig::getInstance(); if ($fbConfig->username == 1) { $this->mapping['name'] = $this->mapping['username']; } }
function smileypath() { $fbConfig =& CKunenaConfig::getInstance(); if (is_dir(KUNENA_PATH_TEMPLATE . DS . $fbConfig->template . '/images/' . KUNENA_LANGUAGE . '/emoticons')) { $smiley_live_path = JURI::root() . '/components/com_kunena/template/' . $fbConfig->template . '/images/' . KUNENA_LANGUAGE . '/emoticons'; $smiley_abs_path = KUNENA_PATH_TEMPLATE . DS . $fbConfig->template . '/images/' . KUNENA_LANGUAGE . '/emoticons'; } else { $smiley_live_path = KUNENA_PATH_TEMPLATE_DEFAULT . DS . 'images/' . KUNENA_LANGUAGE . '/emoticons'; $smiley_abs_path = KUNENA_PATH_TEMPLATE_DEFAULT . DS . 'images/' . KUNENA_LANGUAGE . '/emoticons'; } $smileypath['live'] = $smiley_live_path; $smileypath['abs'] = $smiley_abs_path; return $smileypath; }
function showlist($ulrows, $total_results, $pageNav, $limitstart, $query_ext, $search = "") { $app =& JFactory::getApplication(); $fbConfig =& CKunenaConfig::getInstance(); $kunena_db =& JFactory::getDBO(); if ($search == "") { $search = _KUNENA_USRL_SEARCH; } ?> <script type = "text/javascript"> <!-- function validate() { if ((document.usrlform.search == "") || (document.usrlform.search.value == "")) { alert('<?php echo _KUNENA_USRL_SEARCH_ALERT; ?> '); return false; } else { return true; } } //--> </script> <?php if ($fbConfig->joomlastyle < 1) { $boardclass = "fb_"; } ?> <div class="<?php echo $boardclass; ?> _bt_cvr1"> <div class="<?php echo $boardclass; ?> _bt_cvr2"> <div class="<?php echo $boardclass; ?> _bt_cvr3"> <div class="<?php echo $boardclass; ?> _bt_cvr4"> <div class="<?php echo $boardclass; ?> _bt_cvr5"> <table class = "fb_blocktable" id ="fb_userlist" border = "0" cellspacing = "0" cellpadding = "0" width="100%"> <thead> <tr> <th> <table width = "100%" border = "0" cellspacing = "0" cellpadding = "0"> <tr> <td align = "left"> <div class = "fb_title_cover fbm"> <span class="fb_title fbl"> <?php echo _KUNENA_USRL_USERLIST; ?> </span> <?php printf(_KUNENA_USRL_REGISTERED_USERS, $app->getCfg('sitename'), $total_results); ?> </div> </td> <td align = "right"> <form name = "usrlform" method = "post" action = "<?php echo CKunenaLink::GetUserlistURL(); ?> " onsubmit = "return validate()"> <input type = "text" name = "search" class = "inputbox" style = "width:150px" maxlength = "100" value = "<?php echo $search; ?> " onblur = "if(this.value=='') this.value='<?php echo $search; ?> ';" onfocus = "if(this.value=='<?php echo $search; ?> ') this.value='';" /> <input type = "image" src = "<?php echo KUNENA_TMPLTMAINIMGURL . '/images/usl_search_icon.gif'; ?> " alt = "<?php echo _KUNENA_USRL_SEARCH; ?> " align = "top" style = "border: 0px;"/> </form> </td> </tr> </table> </th> </tr> </thead> <tbody> <tr> <td class = "<?php echo $boardclass; ?> fb-userlistinfo"> <!-- Begin: Listing --> <table width = "100%" border = "0" cellspacing = "0" cellpadding = "0"> <tr class = "fb_sth fbs"> <th class = "th-1 frst <?php echo $boardclass; ?> sectiontableheader" align="center"> </th> <?php if ($fbConfig->userlist_online) { ?> <th class = "th-2 <?php echo $boardclass; ?> sectiontableheader" align="center"> <?php echo _KUNENA_USRL_ONLINE; ?> </th> <?php } ?> <?php if ($fbConfig->userlist_avatar) { ?> <th class = "th-3 <?php echo $boardclass; ?> sectiontableheader" align="center"> <?php echo _KUNENA_USRL_AVATAR; ?> </th> <?php } ?> <?php if ($fbConfig->userlist_name) { ?> <th class = "th-4 <?php echo $boardclass; ?> sectiontableheader" align="center"> <?php echo _KUNENA_USRL_NAME; echo CKunenaLink::GetUserlistLink('&orderby=name&direction=ASC', '<img src="' . KUNENA_TMPLTMAINIMGURL . '/images/down.gif" border="0" alt="' . _KUNENA_USRL_ASC . '" />'); echo CKunenaLink::GetUserlistLink('&orderby=name&direction=DESC', '<img src="' . KUNENA_TMPLTMAINIMGURL . '/images/up.gif" border="0" alt="' . _KUNENA_USRL_DESC . '" />'); ?> </th> <?php } ?> <?php if ($fbConfig->userlist_username) { ?> <th class = "th-5 <?php echo $boardclass; ?> sectiontableheader" align="center"> <?php echo _KUNENA_USRL_USERNAME; echo CKunenaLink::GetUserlistLink('&orderby=username&direction=ASC', '<img src="' . KUNENA_TMPLTMAINIMGURL . '/images/down.gif" border="0" alt="' . _KUNENA_USRL_ASC . '" />'); echo CKunenaLink::GetUserlistLink('&orderby=username&direction=DESC', '<img src="' . KUNENA_TMPLTMAINIMGURL . '/images/up.gif" border="0" alt="' . _KUNENA_USRL_DESC . '" />'); ?> </th> <?php } ?> <?php if ($fbConfig->userlist_group) { ?> <th class = "th-6 <?php echo $boardclass; ?> sectiontableheader" align="center"> <?php echo _KUNENA_USRL_GROUP; echo CKunenaLink::GetUserlistLink('&orderby=group_id&direction=ASC', '<img src="' . KUNENA_TMPLTMAINIMGURL . '/images/down.gif" border="0" alt="' . _KUNENA_USRL_ASC . '" />'); echo CKunenaLink::GetUserlistLink('&orderby=group_id&direction=DESC', '<img src="' . KUNENA_TMPLTMAINIMGURL . '/images/up.gif" border="0" alt="' . _KUNENA_USRL_DESC . '" />'); ?> </th> <?php } ?> <?php if ($fbConfig->userlist_posts) { ?> <th class = "th-7 <?php echo $boardclass; ?> sectiontableheader" align="center"> <?php echo _KUNENA_USRL_POSTS; echo CKunenaLink::GetUserlistLink('&orderby=posts&direction=ASC', '<img src="' . KUNENA_TMPLTMAINIMGURL . '/images/down.gif" border="0" alt="' . _KUNENA_USRL_ASC . '" />'); echo CKunenaLink::GetUserlistLink('&orderby=posts&direction=DESC', '<img src="' . KUNENA_TMPLTMAINIMGURL . '/images/up.gif" border="0" alt="' . _KUNENA_USRL_DESC . '" />'); ?> </th> <?php } ?> <?php if ($fbConfig->userlist_karma) { ?> <th class = "th-7 <?php echo $boardclass; ?> sectiontableheader" align="center"> <?php echo _KUNENA_USRL_KARMA; echo CKunenaLink::GetUserlistLink('&orderby=karma&direction=ASC', '<img src="' . KUNENA_TMPLTMAINIMGURL . '/images/down.gif" border="0" alt="' . _KUNENA_USRL_ASC . '" />'); echo CKunenaLink::GetUserlistLink('&orderby=karma&direction=DESC', '<img src="' . KUNENA_TMPLTMAINIMGURL . '/images/up.gif" border="0" alt="' . _KUNENA_USRL_DESC . '" />'); ?> </th> <?php } ?> <?php if ($fbConfig->userlist_email) { ?> <th class = "th-8 <?php echo $boardclass; ?> sectiontableheader" align="center"> <?php echo _KUNENA_USRL_EMAIL; echo CKunenaLink::GetUserlistLink('&orderby=email&direction=ASC', '<img src="' . KUNENA_TMPLTMAINIMGURL . '/images/down.gif" border="0" alt="' . _KUNENA_USRL_ASC . '" />'); echo CKunenaLink::GetUserlistLink('&orderby=email&direction=DESC', '<img src="' . KUNENA_TMPLTMAINIMGURL . '/images/up.gif" border="0" alt="' . _KUNENA_USRL_DESC . '" />'); ?> </th> <?php } ?> <?php if ($fbConfig->userlist_usertype) { ?> <th class = "th-9 <?php echo $boardclass; ?> sectiontableheader" align="center"> <?php echo _KUNENA_USRL_USERTYPE; echo CKunenaLink::GetUserlistLink('&orderby=usertype&direction=ASC', '<img src="' . KUNENA_TMPLTMAINIMGURL . '/images/down.gif" border="0" alt="' . _KUNENA_USRL_ASC . '" />'); echo CKunenaLink::GetUserlistLink('&orderby=usertype&direction=DESC', '<img src="' . KUNENA_TMPLTMAINIMGURL . '/images/up.gif" border="0" alt="' . _KUNENA_USRL_DESC . '" />'); ?> </th> <?php } ?> <?php if ($fbConfig->userlist_joindate) { ?> <th class = "th-10 <?php echo $boardclass; ?> sectiontableheader" align="center"> <?php echo _KUNENA_USRL_JOIN_DATE; echo CKunenaLink::GetUserlistLink('&orderby=registerDate&direction=ASC', '<img src="' . KUNENA_TMPLTMAINIMGURL . '/images/down.gif" border="0" alt="' . _KUNENA_USRL_ASC . '" />'); echo CKunenaLink::GetUserlistLink('&orderby=registerDate&direction=DESC', '<img src="' . KUNENA_TMPLTMAINIMGURL . '/images/up.gif" border="0" alt="' . _KUNENA_USRL_DESC . '" />'); ?> </th> <?php } ?> <?php if ($fbConfig->userlist_lastvisitdate) { ?> <th class = "th-11 <?php echo $boardclass; ?> sectiontableheader" align="center"> <?php echo _KUNENA_USRL_LAST_LOGIN; echo CKunenaLink::GetUserlistLink('&orderby=lastvisitDate&direction=ASC', '<img src="' . KUNENA_TMPLTMAINIMGURL . '/images/down.gif" border="0" alt="' . _KUNENA_USRL_ASC . '" />'); echo CKunenaLink::GetUserlistLink('&orderby=lastvisitDate&direction=DESC', '<img src="' . KUNENA_TMPLTMAINIMGURL . '/images/up.gif" border="0" alt="' . _KUNENA_USRL_DESC . '" />'); ?> </th> <?php } ?> <?php if ($fbConfig->userlist_userhits) { ?> <th class = "th-12 lst <?php echo $boardclass; ?> sectiontableheader" align="center"> <?php echo _KUNENA_USRL_HITS; echo CKunenaLink::GetUserlistLink('&orderby=uhits&direction=ASC', '<img src="' . KUNENA_TMPLTMAINIMGURL . '/images/down.gif" border="0" alt="' . _KUNENA_USRL_ASC . '" />'); echo CKunenaLink::GetUserlistLink('&orderby=uhits&direction=DESC', '<img src="' . KUNENA_TMPLTMAINIMGURL . '/images/up.gif" border="0" alt="' . _KUNENA_USRL_DESC . '" />'); ?> </th> <?php } ?> </tr> <?php $i = 1; foreach ($ulrows as $ulrow) { $evenodd = $i % 2; if ($evenodd == 0) { $usrl_class = "sectiontableentry1"; } else { $usrl_class = "sectiontableentry2"; } $nr = $i + $limitstart; // Avatar $uslavatar = ''; if ($fbConfig->avatar_src == "clexuspm") { $uslavatar = '<img border="0" class="usl_avatar" src="' . MyPMSTools::getAvatarLinkWithID($ulrow->id, "s") . '" alt="" />'; } else { if ($fbConfig->avatar_src == "cb") { $kunenaProfile =& CKunenaCBProfile::getInstance(); $uslavatar = $kunenaProfile->showAvatar($ulrow->id); } else { $kunena_db->setQuery("SELECT avatar FROM #__fb_users WHERE userid='{$ulrow->id}'"); $avatar = $kunena_db->loadResult(); if ($avatar != '') { if (!file_exists(KUNENA_PATH_UPLOADED . DS . 'avatars/s_' . $avatar)) { $uslavatar = '<img border="0" class="usl_avatar" src="' . KUNENA_LIVEUPLOADEDPATH . '/avatars/' . $avatar . '" alt="" />'; } else { $uslavatar = '<img border="0" class="usl_avatar" src="' . KUNENA_LIVEUPLOADEDPATH . '/avatars/s_' . $avatar . '" alt="" />'; } } else { $uslavatar = '<img border="0" class="usl_avatar" src="' . KUNENA_LIVEUPLOADEDPATH . '/avatars/s_nophoto.jpg" alt="" />'; } } } // ?> <tr class = "<?php echo $boardclass; echo $usrl_class; ?> fbm"> <td class = "td-1 frst fbs" align="center"> <?php echo $nr; ?> </td> <?php if ($fbConfig->userlist_online) { ?> <td class = "td-2"> <?php // online - ofline status $sql = "SELECT COUNT(userid) FROM #__session WHERE userid='{$ulrow->id}'"; $kunena_db->setQuery($sql); $isonline = $kunena_db->loadResult(); if ($isonline && $ulrow->showOnline == 1) { echo isset($fbIcons['onlineicon']) ? '<img src="' . KUNENA_URLICONSPATH . $fbIcons['onlineicon'] . '" border="0" alt="' . _MODLIST_ONLINE . '" />' : ' <img src="' . KUNENA_URLEMOTIONSPATH . 'onlineicon.gif" border="0" alt="' . _MODLIST_ONLINE . '" />'; } else { echo isset($fbIcons['offlineicon']) ? '<img src="' . KUNENA_URLICONSPATH . $fbIcons['offlineicon'] . '" border="0" alt="' . _MODLIST_OFFLINE . '" />' : ' <img src="' . KUNENA_URLEMOTIONSPATH . 'offlineicon.gif" border="0" alt="' . _MODLIST_OFFLINE . '" />'; } ?> </td> <?php } ?> <?php if ($fbConfig->userlist_avatar) { ?> <td class = "td-3" align="center"> <?php if (strlen($uslavatar)) { echo CKunenaLink::GetProfileLink($fbConfig, $ulrow->id, $uslavatar); } else { echo ' '; } ?> </td> <?php } ?> <?php if ($fbConfig->userlist_name) { ?> <td class = "td-4 fbm" align="center"> <?php echo CKunenaLink::GetProfileLink($fbConfig, $ulrow->id, $ulrow->name); ?> </td> <?php } ?> <?php if ($fbConfig->userlist_username) { ?> <td class = "td-5 fbm" align="center"> <?php echo CKunenaLink::GetProfileLink($fbConfig, $ulrow->id, $ulrow->username); ?> </td> <?php } ?> <?php if ($fbConfig->userlist_group) { ?> <td class = "td-6 fbs" align="center"> <span class = "view-group_<?php echo $ulrow->group_id; ?> "> <?php echo $ulrow->title; ?> </span> </td> <?php } ?> <?php if ($fbConfig->userlist_posts) { ?> <td class = "td-7 fbs" align="center"> <?php echo $ulrow->posts; ?> </td> <?php } ?> <?php if ($fbConfig->userlist_karma) { ?> <td class = "td-7 fbs" align="center"> <?php echo $ulrow->karma; ?> </td> <?php } ?> <?php if ($fbConfig->userlist_email) { echo "\t\t<td class=\"td-8 fbs\" align=\"center\"><a href=\"mailto:{$ulrow->email}\">{$ulrow->email}</a></td>\n"; } if ($fbConfig->userlist_usertype) { echo "\t\t<td class=\"td-9 fbs\" align=\"center\">{$ulrow->usertype}</td>\n"; } if ($fbConfig->userlist_joindate) { echo "\t\t<td class=\"td-10 fbs\" align=\"center\">" . convertDate($ulrow->registerDate) . "</td>\n"; } if ($fbConfig->userlist_lastvisitdate) { echo "\t\t<td class=\"td-11 fbs\" align=\"center\">" . convertDate($ulrow->lastvisitDate) . "</td>\n"; } ?> <td class = "td-12 lst fbs" align="center"> <?php if ($fbConfig->userlist_userhits) { ?> <?php echo $ulrow->uhits; ?> <?php } ?> </td> <?php echo "\t</tr>\n"; $i++; } ?> </table> <form name = "usrlform" method = "post" action = "<?php echo CKunenaLink::GetUserlistURL(); ?> " onsubmit = "return false;"> <table width = "100%" class="fb_userlist_pagenav" border = "0" cellspacing = "0" cellpadding = "0"> <tr class = "fb_sth fbs"> <th class = "th-1 fbm" align = "center" style = "text-align:center;"> <?php // TODO: fxstein - Need to perform SEO cleanup echo $pageNav->getPagesLinks(CKunenaLink::GetUserlistURL($query_ext)); ?> </th> </tr> </table> <table class = "fb_blocktable" id="fb_userlist_bottom" style="border-bottom:0px;margin:0;" border = "0" cellspacing = "0" cellpadding = "0" width="100%"> <tr> <th class = "th-right fbs" align="right" style="text-align:right"> <?php echo $pageNav->getPagesCounter(); ?> | <?php echo _KUNENA_USRL_DISPLAY_NR; ?> <?php echo $pageNav->getLimitBox(CKunenaLink::GetUserlistURL($query_ext)); ?> </th> </tr> </table> </form> </td> </tr> </tbody> </table> <!-- Finish: Listing --> </div> </div> </div> </div> </div> <?php //(JJ) BEGIN: WHOISONLINE if (file_exists(KUNENA_ABSTMPLTPATH . '/plugin/who/whoisonline.php')) { include KUNENA_ABSTMPLTPATH . '/plugin/who/whoisonline.php'; } else { include KUNENA_PATH_TEMPLATE_DEFAULT . DS . 'plugin/who/whoisonline.php'; } //(JJ) FINISH: WHOISONLINE ?> <!-- Begin: Forum Jump --> <div class="<?php echo $boardclass; ?> _bt_cvr1"> <div class="<?php echo $boardclass; ?> _bt_cvr2"> <div class="<?php echo $boardclass; ?> _bt_cvr3"> <div class="<?php echo $boardclass; ?> _bt_cvr4"> <div class="<?php echo $boardclass; ?> _bt_cvr5"> <table class = "fb_blocktable" id="fb_bottomarea" border = "0" cellspacing = "0" cellpadding = "0"> <thead> <tr> <th class = "th-right"> <?php //(JJ) FINISH: CAT LIST BOTTOM if ($fbConfig->enableforumjump) { require_once KUNENA_PATH_LIB . DS . 'kunena.forumjump.php'; } ?> </th> </tr> </thead> <tbody><tr><td></td></tr></tbody> </table> </div> </div> </div> </div> </div> <!-- Finish: Forum Jump --> <?php }
function __construct() { $this->_db = JFactory::getDBO(); $this->config = CKunenaConfig::getInstance(); $this->document =& JFactory::getDocument(); }
/** * Lists messages to be moderated * @param array allMes list of object * @param string fbs action string */ function jbListMessages($allMes, $catid) { $fbConfig =& CKunenaConfig::getInstance(); echo '<form action="' . JRoute::_(KUNENA_LIVEURLREL . '&func=review') . '" name="moderation" method="post">'; ?> <script> function ConfirmDelete() { if (confirm("<?php echo _MODERATION_DELETE_MESSAGE; ?> ")) document.moderation.submit(); else return false; } </script> <table width = "100%" border = 0 cellspacing = 1 cellpadding = 3> <tr height = "10" class = "fb_table_header"> <th align = "center"> <b><?php echo _GEN_DATE; ?> </b> </th> <th width = "8%" align = "center"> <b><?php echo _GEN_AUTHOR; ?> </b> </th> <th width = "13%" align = "center"> <b><?php echo _GEN_SUBJECT; ?> </b> </th> <th width = "55%" align = "center"> <b><?php echo _GEN_MESSAGE; ?> </b> </th> <th width = "13%" align = "center"> <b><?php echo _GEN_ACTION; ?> </b> </th> </tr> <?php $i = 1; //avoid calling it each time $smileyList = smile::getEmoticons(""); foreach ($allMes as $message) { $i = 1 - $i; echo '<tr class="fb_message' . $i . '">'; echo '<td valign="top">' . date(_DATETIME, $message->time) . '</td>'; echo '<td valign="top">' . $message->name . '</td>'; echo '<td valign="top"><b>' . $message->subject . '<b></td>'; $fb_message_txt = stripslashes($message->message); echo '<td valign="top">' . smile::smileReplace($fb_message_txt, 0, $fbConfig->disemoticons, $smileyList) . '</td>'; echo '<td valign="top"><input type="checkbox" name="cid[]" value="' . $message->id . '" /></td>'; echo '</tr>'; } ?> <tr> <td colspan = "5" align = "center" valign = "top" style = "text-align:center"> <input type = "hidden" name = "catid" value = "<?php echo $catid; ?> "/> <input type = "submit" align = "center" class = "button" name = "action" value = "<?php echo _MOD_APPROVE; ?> " border = "0"> <input type = "submit" align = "center" class = "button" name = "action" onclick = "ConfirmDelete()" value = "<?php echo _MOD_DELETE; ?> " border = "0"> </td> </tr> <tr height = "10" bgcolor = "#e2e2e2"> <td colspan = "5"> </td> </tr> </table> </form> <?php }
function getAvatarKunena($userID) { if (file_exists(JPATH_SITE . DS . "components" . DS . "com_kunena" . DS . "lib" . DS . "kunena.user.class.php")) { require_once JPATH_SITE . DS . "components" . DS . "com_kunena" . DS . "lib" . DS . "kunena.user.class.php"; $app = JFactory::getApplication(); $document = JFactory::getDocument(); $fbConfig = CKunenaConfig::getInstance(); //print_r($fbConfig);die(); if ($fbConfig->avatar_src == 'fb') { //get avatar image from database $db = JFactory::getDBO(); $sql = "SELECT `avatar` FROM #__fb_users WHERE `userid`='{$userID}'"; $db->setQuery($sql); //die($db->getQuery ()); $imgPath = $db->loadResult(); if ($imgPath) { $fireboardAvatar = ''; if (@(!is_null($fbConfig->version)) && @isset($fbConfig->version) && @$fbConfig->version == '1.0.1') { $fireboardAvatar = 'components/com_kunena/' . $imgPath; } else { $fireboardAvatar = 'images/fbfiles/avatars/' . $imgPath; } //check exist image of user if (file_exists(JPATH_SITE . DS . $fireboardAvatar)) { return JURI::root() . $fireboardAvatar; } else { // Return false if Image file doesn't exist. return false; } } else { // user don't use avatar. return false; } } } return false; }
/** * Get a Kunena configuration object * * Returns the global {@link CKunenaConfig} object, only creating it if it doesn't already exist. * * @return object CKunenaConfig */ public static function getConfig() { require_once(KPATH_SITE.'/lib/kunena.config.class.php'); return CKunenaConfig::getInstance(); }
function ReportForm($id, $catid) { $app =& JFactory::getApplication(); $fbConfig =& CKunenaConfig::getInstance(); $kunena_my =& JFactory::getUser(); $redirect = JRoute::_(KUNENA_LIVEURLREL . '&func=view&catid=' . $catid . '&id=' . $id . '&Itemid=' . KUNENA_COMPONENT_ITEMID) . '#' . $id; //$redirect = JRoute::_($redirect); if (!$kunena_my->id) { $app->redirect($redirect); return; } if ($fbConfig->reportmsg == 0) { $app->redirect($redirect); return; } ?> <div class = "<?php echo $boardclass; ?> _bt_cvr1"> <div class = "<?php echo $boardclass; ?> _bt_cvr2"> <div class = "<?php echo $boardclass; ?> _bt_cvr3"> <div class = "<?php echo $boardclass; ?> _bt_cvr4"> <div class = "<?php echo $boardclass; ?> _bt_cvr5"> <table class = "fb_blocktable" id = "fb_forumfaq" border = "0" cellspacing = "0" cellpadding = "0" width = "100%"> <thead> <tr> <th> <div class = "fb_title_cover"> <span class = "fb_title"><?php echo _KUNENA_COM_A_REPORT; ?> </span> </div> </tr> </thead> <tbody> <tr> <td class = "fb_faqdesc"> <form method = "post" action = "<?php echo JRoute::_(KUNENA_LIVEURLREL . '&func=report'); ?> "> <table width = "100%" border = "0"> <tr> <td width = "10%"> <?php echo _KUNENA_REPORT_REASON; ?> : </td> <td> <input type = "text" name = "reason" class = "inputbox" size = "30"/> </td> </tr> <tr> <td colspan = "2"> <?php echo _KUNENA_REPORT_MESSAGE; ?> : </td> </tr> <tr> <td colspan = "2"> <textarea id = "text" name = "text" cols = "40" rows = "10" class = "inputbox"></textarea> </td> </tr> </table> <input type = "hidden" name = "do" value = "report"/> <input type = "hidden" name = "id" value = "<?php echo $id; ?> "/> <input type = "hidden" name = "catid" value = "<?php echo $catid; ?> "/> <input type = "hidden" name = "reporter" value = "<?php echo $kunena_my->id; ?> "/> <input type = "submit" name = "Submit" value = "<?php echo _KUNENA_REPORT_SEND; ?> "/> </form> </td> </tr> </tbody> </table> </div> </div> </div> </div> </div> <?php }
function editUserProfile($user, $subslist, $selectRank, $selectPref, $selectMod, $selectOrder, $uid, $modCats) { $fbConfig =& CKunenaConfig::getInstance(); $kunena_db =& JFactory::getDBO(); //fill the variables needed later $signature = $user->signature; $username = $user->name; $avatar = $user->avatar; $ordering = $user->ordering; //that's what we got now; later the 'future_use' columns can be used.. $csubslist = count($subslist); // include_once ('components/com_kunena/bb_adm.js'); ?> <form action = "index2.php?option=<?php echo $option; ?> " method = "POST" name = "adminForm"> <table border = 0 cellspacing = 0 width = "100%" align = "center" class = "adminheading"> <tr> <th colspan = "3" class = "user"> <?php echo _KUNENA_PROFFOR; ?> <?php echo $username; ?> </th> </tr> </table> <table border = 0 cellspacing = 0 width = "100%" align = "center" class = "adminlist"> <tr> <th colspan = "3" class = "title"> <?php echo _KUNENA_GENPROF; ?> </tr> <tr> <td width = "150" class = "contentpane"><?php echo _KUNENA_PREFOR; ?> </td> <td align = "left" valign = "top" class = "contentpane"> <?php echo $selectOrder; ?> </td> <td> </td> </tr> <tr> <td width = "150" class = "contentpane"><?php echo _KUNENA_RANKS; ?> </td> <td align = "left" valign = "top" class = "contentpane"> <?php echo $selectRank; ?> </td> <td> </td> </tr> <td width = "150" valign = "top" class = "contentpane"> <?php echo _GEN_SIGNATURE; ?> : <?php /* // FIXME: bbcode broken <br/> <?php echo $fbConfig->maxsig; ?> <input readonly type = text name = rem size = 3 maxlength = 3 value = "" class = "inputbox"> <?php echo _CHARS; ?><br/> <?php echo _HTML_YES; ?> */ ?> </td> <td align = "left" valign = "top" class = "contentpane"> <textarea rows = "6" class = "inputbox" onMouseOver = "textCounter(this.form.message,this.form.rem,<?php echo $fbConfig->maxsig; ?> );" onClick = "textCounter(this.form.message,this.form.rem,<?php echo $fbConfig->maxsig; ?> );" onKeyDown = "textCounter(this.form.message,this.form.rem,<?php echo $fbConfig->maxsig; ?> );" onKeyUp = "textCounter(this.form.message,this.form.rem,<?php echo $fbConfig->maxsig; ?> );" cols = "50" type = "text" name = "message"><?php echo html_entity_decode_utf8(stripslashes($signature)); ?> </textarea> <?php /* // FIXME: bbcode broken <br/> <input type = "button" class = "button" accesskey = "b" name = "addbbcode0" value = " B " style = "font-weight:bold; width: 30px" onClick = "bbstyle(0)" onMouseOver = "helpline('b')"/> <input type = "button" class = "button" accesskey = "i" name = "addbbcode2" value = " i " style = "font-style:italic; width: 30px" onClick = "bbstyle(2)" onMouseOver = "helpline('i')"/> <input type = "button" class = "button" accesskey = "u" name = "addbbcode4" value = " u " style = "text-decoration: underline; width: 30px" onClick = "bbstyle(4)" onMouseOver = "helpline('u')"/> <input type = "button" class = "button" accesskey = "p" name = "addbbcode14" value = "Img" style = "width: 40px" onClick = "bbstyle(14)" onMouseOver = "helpline('p')"/> <input type = "button" class = "button" accesskey = "w" name = "addbbcode16" value = "URL" style = "text-decoration: underline; width: 40px" onClick = "bbstyle(16)" onMouseOver = "helpline('w')"/> <br/><?php echo _KUNENA_COLOR; ?>: <select name = "addbbcode20" onChange = "bbfontstyle('[color=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/color]');this.selectedIndex=0;" onMouseOver = "helpline('s')"> <option style = "color:black; background-color: #FAFAFA" value = ""><?php echo _COLOUR_DEFAULT; ?></option> <option style = "color:red; background-color: #FAFAFA" value = "#FF0000"><?php echo _COLOUR_RED; ?></option> <option style = "color:blue; background-color: #FAFAFA" value = "#0000FF"><?php echo _COLOUR_BLUE; ?></option> <option style = "color:green; background-color: #FAFAFA" value = "#008000"><?php echo _COLOUR_GREEN; ?></option> <option style = "color:yellow; background-color: #FAFAFA" value = "#FFFF00"><?php echo _COLOUR_YELLOW; ?></option> <option style = "color:orange; background-color: #FAFAFA" value = "#FF6600"><?php echo _COLOUR_ORANGE; ?></option> </select> <?php echo _SMILE_SIZE; ?>: <select name = "addbbcode22" onChange = "bbfontstyle('[size=' + this.form.addbbcode22.options[this.form.addbbcode22.selectedIndex].value + ']', '[/size]')" onMouseOver = "helpline('f')"> <option value = "1"><?php echo _SIZE_VSMALL; ?></option> <option value = "2"><?php echo _SIZE_SMALL; ?></option> <option value = "3" selected><?php echo _SIZE_NORMAL; ?></option> <option value = "4"><?php echo _SIZE_BIG; ?></option> <option value = "5"><?php echo _SIZE_VBIG; ?></option> </select> <a href = "javascript: bbstyle(-1)"onMouseOver = "helpline('a')"><small><?php echo _BBCODE_CLOSA; ?></small></a> <br/> <input type = "text" name = "helpbox" size = "45" maxlength = "100" style = "width:400px; font-size:8px" class = "options" value = "<?php echo _BBCODE_HINT;?>"/> */ ?> </td> <?php if ($fbConfig->allowavatar) { ?> <td class = "contentpane" align = "center"> <?php echo _KUNENA_UAVATAR; ?> <br/> <?php if ($avatar != '') { echo '<img src="' . KUNENA_LIVEUPLOADEDPATH . '/avatars/' . $avatar . '" ><br />'; echo '<input type="hidden" value="' . $avatar . '" name="avatar">'; } else { echo "<em>" . _KUNENA_NS . "</em><br />"; echo '<input type="hidden" value="$avatar" name="avatar">'; } ?> </td> <?php } else { echo "<td> </td>"; echo '<input type="hidden" value="" name="avatar">'; } ?> </tr> <tr> <td colspan = "2" class = "contentpane"> <input type = "checkbox" value = "1" name = "deleteSig"><i><?php echo _KUNENA_DELSIG; ?> </i> </td> <?php if ($fbConfig->allowavatar) { ?> <td class = "contentpane"> <input type = "checkbox" value = "1" name = "deleteAvatar"><i><?php echo _KUNENA_DELAV; ?> </i> </td> <?php } else { echo "<td> </td>"; } ?> </tr> <tr cellspacing = "3" colspan = "2"> </td> </tr> </table> <table border = 0 cellspacing = 0 width = "100%" align = "center" class = "adminform"> <tr> <th colspan = "2" class = "title"> <?php echo _KUNENA_MOD_NEW; ?> </td> </tr> </tr> <tr> <td width = "150" class = "contentpane"> <?php echo _KUNENA_ISMOD; ?> <?php //admins are always moderators if (CKunenaTools::isModOrAdmin($uid)) { echo _KUNENA_ISADM; ?> <input type = "hidden" name = "moderator" value = "1"> <?php } else { echo $selectMod; } ?> </td> <td> <?php echo $modCats; ?> </td> </tr> </table> <input type = "hidden" name = "uid" value = "<?php echo $uid; ?> "> <input type = "hidden" name = "task" value = ""/> <input type = "hidden" name = "option" value = "com_kunena"/> </form> <table border = 0 cellspacing = 0 width = "100%" align = "center" class = "adminform"> <tr> <th colspan = "2" class = "title"> <?php echo _KUNENA_SUBFOR; ?> <?php echo $username; ?> </td> </tr> <?php $enum = 1; //reset value $k = 0; //value for alternating rows if ($csubslist > 0) { foreach ($subslist as $subs) { //get all message details for each subscription $kunena_db->setQuery("select * from #__fb_messages where id={$subs->thread}"); $subdet = $kunena_db->loadObjectList(); check_dberror("Unable to load subscription messages."); foreach ($subdet as $sub) { $k = 1 - $k; echo "<tr class=\"row{$k}\">"; echo " <td>{$enum}: " . html_entity_decode_utf8(stripslashes($sub->subject)) . " by " . html_entity_decode_utf8(stripslashes($sub->name)); echo " <td> </td>"; echo "</tr>"; $enum++; } } } else { echo "<tr><td class=\"message\">" . _KUNENA_NOSUBS . "</td></tr>"; } echo "</table>"; }
function &prepareContent(&$content) { $fbConfig =& CKunenaConfig::getInstance(); // Joomla Mambot Support, Thanks hacksider if ($fbConfig->jmambot) { $row = new stdClass(); $row->text =& $content; $params = new JParameter(''); $dispatcher =& JDispatcher::getInstance(); JPluginHelper::importPlugin('content'); $results = $dispatcher->trigger('onPrepareContent', array(&$row, &$params, 0)); $content =& $row->text; } return $content; }
function getKunenaConfig() { static $kconfig = false; if ($kconfig === false) { // Run only one time $kconfig = null; // Make sure that Kunena API (if exists) has been loaded $api = JPATH_ADMINISTRATOR . '/components/com_kunena/api.php'; if (is_file($api)) { require_once $api; } if (class_exists('KunenaFactory')) { // Support for Kunena 1.6, 1.7 and 2.0 $kconfig = KunenaFactory::getConfig(); } elseif (is_file(JPATH_ROOT . '/components/com_kunena/lib/kunena.config.class.php')) { // Support for Kunena 1.0 and 1.5 require_once JPATH_ROOT . '/components/com_kunena/lib/kunena.config.class.php'; // Next 4 lines are needed to make <1.0.9 and <1.5.2 to work if (is_file(JPATH_ROOT . '/components/com_kunena/lib/kunena.debug.php')) { require_once JPATH_ROOT . '/components/com_kunena/lib/kunena.debug.php'; } if (is_file(JPATH_ROOT . '/components/com_kunena/lib/kunena.user.class.php')) { require_once JPATH_ROOT . '/components/com_kunena/lib/kunena.user.class.php'; } if (method_exists('CKunenaConfig', 'getInstance')) { // Support for Kunena 1.0.9+ and 1.5 $kconfig = CKunenaConfig::getInstance(); } elseif (class_exists('CKunenaConfig')) { // Support for Kunena 1.0.8 $kconfig = new CKunenaConfig(); $kconfig->load(); } elseif (class_exists('fb_Config')) { // Support for Kunena 1.0.6RC2 and 1.0.7b $kconfig = new fb_Config(); $kconfig->load(); } } } return $kconfig; }
function ParseRoute($segments) { $funcitems = array(array('func' => 'showcat', 'var' => 'catid'), array('func' => 'view', 'var' => 'id')); $doitems = array('func', 'do'); $funcpos = $dopos = 0; $fbConfig =& CKunenaConfig::getInstance(); $vars = array(); while (($segment = array_shift($segments)) !== null) { $seg = explode(':', $segment); $var = array_shift($seg); $value = array_shift($seg); // If SEF categories are allowed: Translate category name to catid if ($fbConfig->sefcats && $funcpos == 0 && $dopos == 0 && ($value !== null || !in_array($var, self::$functions))) { self::loadCategories(); $catname = strtr($segment, ':', '-'); foreach (self::$catidcache as $cat) { if ($catname == self::filterOutput($cat['name']) || $catname == JFilterOutput::stringURLSafe($cat['name'])) { $var = $cat['id']; break; } } } if (empty($var)) { continue; } // Empty parameter if (is_numeric($var)) { if ($funcpos > count($funcitems)) { continue; } // Unknown parameter $vars['func'] = $funcitems[$funcpos]['func']; $value = $var; $var = $funcitems[$funcpos++]['var']; } else { if ($value === null) { if ($dopos > count($doitems)) { continue; } // Unknown parameter $value = $var; $var = $doitems[$dopos++]; } } $vars[$var] = $value; } // Check if we should use listcat instead of showcat if (isset($vars['func']) && $vars['func'] == 'showcat') { if (empty($vars['catid'])) { $parent = 0; } else { $db =& JFactory::getDBO(); $quesql = 'SELECT parent FROM #__fb_categories WHERE id=' . (int) $vars['catid']; $db->setQuery($quesql); $parent = $db->loadResult(); } if (!$parent) { $vars['func'] = 'listcat'; } } return $vars; }
/** * Checks if a user has postpermission in given thread * @param database object * @param int * @param int * @param boolean * @param boolean */ function hasPostPermission($kunena_db, $catid, $id, $userid, $pubwrite, $ismod) { $fbConfig =& CKunenaConfig::getInstance(); $topicLock = 0; if ($id != 0) { $kunena_db->setQuery("SELECT thread FROM #__fb_messages WHERE id='{$id}'"); $topicID = $kunena_db->loadResult(); $lockedWhat = _GEN_TOPIC; if ($topicID != 0) { $sql = "SELECT locked FROM #__fb_messages WHERE id='{$topicID}'"; } else { $sql = "SELECT locked FROM #__fb_messages WHERE id='{$id}'"; } $kunena_db->setQuery($sql); $topicLock = $kunena_db->loadResult(); } if ($topicLock == 0) { //topic not locked; check if forum is locked $kunena_db->setQuery("SELECT locked FROM #__fb_categories WHERE id='{$catid}'"); $topicLock = $kunena_db->loadResult(); $lockedWhat = _GEN_FORUM; } if (($userid != 0 || $pubwrite) && ($topicLock == 0 || $ismod)) { return 1; } else { //user is not allowed to write a post if ($topicLock) { echo "<p align=\"center\">{$lockedWhat} " . _POST_LOCKED . "<br />"; echo _POST_NO_NEW . "<br /><br /></p>"; } else { echo "<p align=\"center\">"; echo _POST_NO_PUBACCESS1 . "<br />"; echo _POST_NO_PUBACCESS2 . "<br /><br />"; if ($fbConfig->fb_profile == 'cb') { echo '<a href="' . CKunenaCBProfile::getRegisterURL() . '">' . _POST_NO_PUBACCESS3 . '</a><br /></p>'; } else { echo '<a href="' . JRoute::_('index.php?option=com_registration&task=register') . '">' . _POST_NO_PUBACCESS3 . '</a><br /></p>'; } } return 0; } }
function GetSearchLink($fbConfig, $func, $searchword, $limitstart, $limit, $name, $params = '', $rel = 'nofollow') { $fbConfig =& CKunenaConfig::getInstance(); $limitstr = ""; if ($limitstart > 0) { $limitstr .= "&limitstart={$limitstart}"; } if ($limit > 0 && $limit != $fbConfig->messages_per_page_search) { $limitstr .= "&limit={$limit}"; } if ($searchword) { $searchword = '&q=' . urlencode($searchword); } return CKunenaLink::GetSefHrefLink(KUNENA_LIVEURLREL . "&func={$func}{$searchword}{$params}{$limitstr}", $name, '', $rel); }
function defaultConfig($option) { $kunena_app = JFactory::getApplication(); $kunena_config = KunenaFactory::getConfig(); $kunena_config->backup(); $kunena_config->remove(); $kunena_config = new CKunenaConfig(); $kunena_config->create(); $kunena_db =& JFactory::getDBO(); $kunena_db->setQuery("UPDATE #__kunena_sessions SET allowed='na'"); $kunena_db->query(); KunenaError::checkDatabaseError(); while (@ob_end_clean()) { } $kunena_app->redirect(JURI::base() . "index.php?option={$option}&task=showconfig", JText::_('COM_KUNENA_CONFIG_DEFAULT')); }
function updateSessionInfo() { $fbConfig =& CKunenaConfig::getInstance(); // perform session timeout check $this->_sessiontimeout = $this->currvisit + $fbConfig->fbsessiontimeout < time() + $fbConfig->board_ofset * KUNENA_SECONDS_IN_HOUR; // If this is a new session, reset the lasttime colum with the timestamp // of the last saved currvisit - only after that can we reset currvisit to now before the store if ($this->isNewSession()) { $this->lasttime = $this->currvisit; $this->readtopics = ''; } }
function dofreePDF($kunena_db) { global $aro_group; $app =& JFactory::getApplication(); $kunena_acl =& JFactory::getACL(); $kunena_my =& JFactory::getUser(); $fbConfig =& CKunenaConfig::getInstance(); require_once KUNENA_PATH_LIB . DS . 'kunena.authentication.php'; $is_Mod = 0; $catid = JRequest::getInt('catid', 2); if (!$is_admin) { $kunena_db->setQuery("SELECT userid FROM #__fb_moderation WHERE catid='{$catid}' AND userid='{$kunena_my->id}'"); if ($kunena_db->loadResult()) { $is_Mod = 1; } } else { $is_Mod = 1; } //superadmins always are if (!$is_Mod) { //get all the info on this forum: $kunena_db->setQuery("SELECT id, pub_access, pub_recurse, admin_access, admin_recurse FROM #__fb_categories WHERE id='{$catid}'"); $row = $kunena_db->loadObjectList(); check_dberror("Unable to load category detail."); $allow_forum = explode(',', CKunenaTools::getAllowedForums($kunena_my->id, $aro_group->id, $kunena_acl)); } if ($is_Mod || in_array($catid, $allow_forum)) { $id = JRequest::getInt('id', 1); $catid = JRequest::getInt('catid', 2); //first get the thread id for the current post to later on determine the parent post $kunena_db->setQuery("SELECT thread FROM #__fb_messages WHERE id='{$id}' AND catid='{$catid}'"); $threadid = $kunena_db->loadResult(); //load topic post and details $kunena_db->setQuery("SELECT a.*, b.* FROM #__fb_messages AS a, #__fb_messages_text AS b WHERE a.thread='{$threadid}' AND a.catid='{$catid}' AND a.parent='0' AND a.id=b.mesid"); $row = $kunena_db->loadObjectList(); check_dberror("Unable to load message details."); if (file_exists(KUNENA_ROOT_PATH . DS . 'includes/class.ezpdf.php')) { include KUNENA_ROOT_PATH . DS . 'includes/class.ezpdf.php'; $pdf = new Cezpdf('a4', 'P'); //A4 Portrait } elseif (class_exists('JDocument')) { $pdf = new fbpdfwrapper(); } else { echo 'No supported pdf class found!'; exit; } if (empty($row)) { //if the messages doesn't exist don't need to continue //Doesn't work Fatal error: Call to undefined method CKunenaLink::GetKunenaURL() //$app->redirect ( CKunenaLink::GetKunenaURL(true), _KUNENA_PDF_NOT_GENERATED_MESSAGE_DELETED ); } else { $mes_text = $row[0]->message; filterHTML($mes_text); $pdf->ezSetCmMargins(2, 1.5, 1, 1); $pdf->selectFont('./fonts/Helvetica.afm'); //choose font $all = $pdf->openObject(); $pdf->saveState(); $pdf->setStrokeColor(0, 0, 0, 1); // footer $pdf->line(10, 40, 578, 40); $pdf->line(10, 822, 578, 822); $pdf->addText(30, 34, 6, $fbConfig->board_title . ' - ' . $app->getCfg('sitename')); $strtmp = _KUNENA_PDF_VERSION; $strtmp = str_replace('%version%', "NEW VERSION GOES HERE", $strtmp); // TODO: fxstein - Need to change version handling $pdf->addText(250, 34, 6, $strtmp); $strtmp = _KUNENA_PDF_DATE; $strtmp = str_replace('%date%', date('j F, Y, H:i', CKunenaTools::fbGetShowTime()), $strtmp); $pdf->addText(450, 34, 6, $strtmp); $pdf->restoreState(); $pdf->closeObject(); $pdf->addObject($all, 'all'); $pdf->ezSetDy(30); $txt0 = $row[0]->subject; $pdf->ezText($txt0, 14); $pdf->ezText(_VIEW_POSTED . " " . $row[0]->name . " - " . date(_DATETIME, $row[0]->time), 8); $pdf->ezText("_____________________________________", 8); //$pdf->line( 10, 780, 578, 780 ); $txt3 = "\n"; $txt3 .= stripslashes($mes_text); $pdf->ezText($txt3, 10); $pdf->ezText("\n============================================================================\n\n", 8); //now let's try to see if there's more... $kunena_db->setQuery("SELECT a.*, b.* FROM #__fb_messages AS a, #__fb_messages_text AS b WHERE a.catid='{$catid}' AND a.thread='{$threadid}' AND a.id=b.mesid AND a.parent!='0' ORDER BY a.time ASC"); $replies = $kunena_db->loadObjectList(); check_dberror("Unable to load messages & detail."); $countReplies = count($replies); if ($countReplies > 0) { foreach ($replies as $reply) { $mes_text = $reply->message; filterHTML($mes_text); $txt0 = $reply->subject; $pdf->ezText($txt0, 14); $pdf->ezText(_VIEW_POSTED . " " . $reply->name . " - " . date(_DATETIME, $reply->time), 8); $pdf->ezText("_____________________________________", 8); $txt3 = "\n"; $txt3 .= stripslashes($mes_text); $pdf->ezText($txt3, 10); $pdf->ezText("\n============================================================================\n\n", 8); } } $pdf->ezStream(); } } else { echo "You don't have access to this resource."; } }
/** * This function will write the TextArea */ function fbWriteTextarea($areaname, $html, $width, $height, $useRte, $emoticons) { // well $html is the $message to edit, generally it means in PLAINTEXT @Kunena! global $editmode; // ERROR: mixed global $editmode $fbConfig =& CKunenaConfig::getInstance(); // (JJ) JOOMLA STYLE CHECK if ($fbConfig->joomlastyle < 1) { $boardclass = "fb_"; } ?> <tr class = "<?php echo $boardclass; ?> sectiontableentry1"> <td class = "fb_leftcolumn" valign = "top"> <strong><a href = "<?php echo JRoute::_(KUNENA_LIVEURLREL . '&func=faq') . '#boardcode'; ?> " target="_new"><?php @(print _COM_BOARDCODE); ?> </a></strong>: </td> <td> <table border = "0" cellspacing = "0" cellpadding = "0" class = "fb-postbuttonset"> <tr> <td class = "fb-postbuttons"> <input name="speicher" type="hidden" size="30" maxlength="100" /> <input name="previewspeicher" type="hidden" size="30" maxlength="100" /> <img class = "fb-bbcode" title = "Bold" accesskey = "b" name = "addbbcode0" src="<?php echo KUNENA_LIVEUPLOADEDPATH . '/editor/'; ?> text_bold.png" alt="B" onclick = "bbfontstyle('[b]', '[/b]');" onmouseover = "javascript:kunenaShowHelp('<?php @(print _KUNENA_EDITOR_HELPLINE_BOLD); ?> ')" /> <img class = "fb-bbcode" accesskey = "i" name = "addbbcode2" src="<?php echo KUNENA_LIVEUPLOADEDPATH . '/editor/'; ?> text_italic.png" alt="I" onclick = "bbfontstyle('[i]', '[/i]');" onmouseover = "javascript:kunenaShowHelp('<?php @(print _KUNENA_EDITOR_HELPLINE_ITALIC); ?> ')" /> <img class = "fb-bbcode" accesskey = "u" name = "addbbcode4" src="<?php echo KUNENA_LIVEUPLOADEDPATH . '/editor/'; ?> text_underline.png" alt="U" onclick = "bbfontstyle('[u]', '[/u]');" onmouseover = "javascript:kunenaShowHelp('<?php @(print _KUNENA_EDITOR_HELPLINE_UNDERL); ?> ')" /> <img class = "fb-bbcode" accesskey = "st" name = "addbbcode4" src="<?php echo KUNENA_LIVEUPLOADEDPATH . '/editor/'; ?> text_strike.png" alt="S" onclick = "bbfontstyle('[strike]', '[/strike]');" onmouseover = "javascript:kunenaShowHelp('<?php @(print _KUNENA_EDITOR_HELPLINE_STRIKE); ?> ')" /> <img class = "fb-bbcode" accesskey = "sub" name = "addbbcode4" src="<?php echo KUNENA_LIVEUPLOADEDPATH . '/editor/'; ?> text_sub.png" alt="Sub" onclick = "bbfontstyle('[sub]', '[/sub]');" onmouseover = "javascript:kunenaShowHelp('<?php @(print _KUNENA_EDITOR_HELPLINE_SUB); ?> ')" /> <img class = "fb-bbcode" accesskey = "sup" name = "addbbcode4" src="<?php echo KUNENA_LIVEUPLOADEDPATH . '/editor/'; ?> text_sup.png" alt="Sup" onclick = "bbfontstyle('[sup]', '[/sup]');" onmouseover = "javascript:kunenaShowHelp('<?php @(print _KUNENA_EDITOR_HELPLINE_SUP); ?> ')" /> <img class = "fb-bbcode" name = "addbbcode62" src="<?php echo KUNENA_LIVEUPLOADEDPATH . '/editor/'; ?> text_smallcaps.png" alt="<?php @(print _SMILE_SIZE); ?> " onclick = "bbfontstyle('[size=' + document.postform.addbbcode22.options[document.postform.addbbcode22.selectedIndex].value + ']', '[/size]');" onmouseover = "javascript:kunenaShowHelp('<?php @(print _KUNENA_EDITOR_HELPLINE_FONTSIZE); ?> ')" /> <select id = "fb-bbcode_size" class = "<?php echo $boardclass; ?> slcbox" name = "addbbcode22" onmouseover = "javascript:kunenaShowHelp('<?php @(print _KUNENA_EDITOR_HELPLINE_FONTSIZESELECTION); ?> ')"> <option value = "1"><?php @(print _SIZE_VSMALL); ?> </option> <option value = "2"><?php @(print _SIZE_SMALL); ?> </option> <option value = "3" selected = "selected"><?php @(print _SIZE_NORMAL); ?> </option> <option value = "4"><?php @(print _SIZE_BIG); ?> </option> <option value = "5"><?php @(print _SIZE_VBIG); ?> </option> </select> <img id="ueberschrift" class = "fb-bbcode" name = "addbbcode20" src="<?php echo KUNENA_LIVEUPLOADEDPATH . '/editor/'; ?> color_swatch.png" alt="<?php @(print _SMILE_COLOUR); ?> " onclick = "javascript:change_palette();" onmouseover = "javascript:kunenaShowHelp('<?php @(print _KUNENA_EDITOR_HELPLINE_COLOR); ?> ')" /> <?php if ($fbConfig->showspoilertag) { ?> <img class = "fb-bbcode" accesskey = "s" name = "addbbcode40" src="<?php echo KUNENA_LIVEUPLOADEDPATH . '/editor/'; ?> spoiler.png" alt="Spoiler" onclick = "bbfontstyle('[spoiler]', '[/spoiler]')" onmouseover = "javascript:kunenaShowHelp('<?php @(print _KUNENA_EDITOR_HELPLINE_SPOILER); ?> ')" /> <?php } ?> <img class = "fb-bbcode" accesskey = "h" name = "addbbcode24" src="<?php echo KUNENA_LIVEUPLOADEDPATH . '/editor/'; ?> group_key.png" alt="Hide" onclick = "bbfontstyle('[hide]', '[/hide]');" onmouseover = "javascript:kunenaShowHelp('<?php @(print _KUNENA_EDITOR_HELPLINE_HIDE); ?> ')" /> <img class = "fb-bbcode" alt="" src="<?php echo KUNENA_LIVEUPLOADEDPATH . '/editor/'; ?> spacer.png" style="cursor: auto;" /> <img class = "fb-bbcode" accesskey = "k" name = "addbbcode10" src="<?php echo KUNENA_LIVEUPLOADEDPATH . '/editor/'; ?> text_list_bullets.png" alt="ul" onclick = "bbfontstyle('[ul]', '[/ul]');" onmouseover = "javascript:kunenaShowHelp('<?php @(print _KUNENA_EDITOR_HELPLINE_UL); ?> ')" /> <img class = "fb-bbcode" accesskey = "o" name = "addbbcode12" src="<?php echo KUNENA_LIVEUPLOADEDPATH . '/editor/'; ?> text_list_numbers.png" alt="ol" onclick = "bbfontstyle('[ol]', '[/ol]');" onmouseover = "javascript:kunenaShowHelp('<?php @(print _KUNENA_EDITOR_HELPLINE_OL); ?> ')" /> <img class = "fb-bbcode" accesskey = "l" name = "addbbcode18" src="<?php echo KUNENA_LIVEUPLOADEDPATH . '/editor/'; ?> text_list_none.png" alt="li" onclick = "bbfontstyle('[li]', '[/li]');" onmouseover = "javascript:kunenaShowHelp('<?php @(print _KUNENA_EDITOR_HELPLINE_LI); ?> ')" /> <img class = "fb-bbcode" accesskey = "left" name = "addbbcode4" src="<?php echo KUNENA_LIVEUPLOADEDPATH . '/editor/'; ?> text_align_left.png" alt="left" onclick = "bbfontstyle('[left]', '[/left]');" onmouseover = "javascript:kunenaShowHelp('<?php @(print _KUNENA_EDITOR_HELPLINE_ALIGN_LEFT); ?> ')" /> <img class = "fb-bbcode" accesskey = "center" name = "addbbcode4" src="<?php echo KUNENA_LIVEUPLOADEDPATH . '/editor/'; ?> text_align_center.png" alt="center" onclick = "bbfontstyle('[center]', '[/center]');" onmouseover = "javascript:kunenaShowHelp('<?php @(print _KUNENA_EDITOR_HELPLINE_ALIGN_CENTER); ?> ')" /> <img class = "fb-bbcode" accesskey = "right" name = "addbbcode4" src="<?php echo KUNENA_LIVEUPLOADEDPATH . '/editor/'; ?> text_align_right.png" alt="right" onclick = "bbfontstyle('[right]', '[/right]');" onmouseover = "javascript:kunenaShowHelp('<?php @(print _KUNENA_EDITOR_HELPLINE_ALIGN_RIGHT); ?> ')" /> <img class = "fb-bbcode" alt="" src="<?php echo KUNENA_LIVEUPLOADEDPATH . '/editor/'; ?> spacer.png" style="cursor: auto;" /> <img class = "fb-bbcode" accesskey = "q" name = "addbbcode6" src="<?php echo KUNENA_LIVEUPLOADEDPATH . '/editor/'; ?> comment.png" alt="Quote" onclick = "bbfontstyle('[quote]', '[/quote]');" onmouseover = "javascript:kunenaShowHelp('<?php @(print _KUNENA_EDITOR_HELPLINE_QUOTE); ?> ')" /> <img class = "fb-bbcode" accesskey = "c" name = "addbbcode8" src="<?php echo KUNENA_LIVEUPLOADEDPATH . '/editor/'; ?> code.png" alt="Code" onclick = "bbfontstyle('[code]', '[/code]');" onmouseover = "javascript:kunenaShowHelp('<?php @(print _KUNENA_EDITOR_HELPLINE_CODE); ?> ')" /> <img class = "fb-bbcode" alt="" src="<?php echo KUNENA_LIVEUPLOADEDPATH . '/editor/'; ?> spacer.png" style="cursor: auto;" /> <img class = "fb-bbcode" accesskey = "p" name = "addbbcode14" src="<?php echo KUNENA_LIVEUPLOADEDPATH . '/editor/'; ?> picture_link.png" alt="Img" onclick = "javascript:dE('image');" onmouseover = "javascript:kunenaShowHelp('<?php @(print _KUNENA_EDITOR_HELPLINE_IMAGELINK); ?> ')" /> <img class = "fb-bbcode" accesskey = "w" name = "addbbcode16" src="<?php echo KUNENA_LIVEUPLOADEDPATH . '/editor/'; ?> link_url.png" alt="URL" onclick = "javascript:dE('link');" onmouseover = "javascript:kunenaShowHelp('<?php @(print _KUNENA_EDITOR_HELPLINE_LINK); ?> ')" /> <?php if ($fbConfig->showebaytag) { ?> <img class = "fb-bbcode" accesskey = "e" name = "addbbcode20" src="<?php echo KUNENA_LIVEUPLOADEDPATH . '/editor/'; ?> ebay.png" alt="Ebay" onclick = "bbfontstyle('[ebay]', '[/ebay]')" onmouseover = "javascript:kunenaShowHelp('<?php @(print _KUNENA_EDITOR_HELPLINE_EBAY); ?> ')" /> <?php } ?> <?php if ($fbConfig->showvideotag) { ?> <span style="white-space:nowrap;"> <a href = "javascript:dE('video');" onmouseover = "javascript:kunenaShowHelp('<?php @(print _KUNENA_EDITOR_HELPLINE_VIDEO); ?> ')"><img src="<?php echo KUNENA_LIVEUPLOADEDPATH . '/editor/'; ?> film.png" alt="video" /></a> </span> <?php } ?> </td> </tr> <!-- start of extendable fiels --> <tr><td class = "fb-postbuttons"> <div id="fb-color_palette" style="display: none;"> <script type="text/javascript"> function change_palette() {dE('fb-color_palette');} colorPalette('h', '4%', '15px'); </script> </div> <div id="link" style="display: none;"> <?php @(print _KUNENA_EDITOR_LINK_URL); ?> <input name="url" type="text" size="40" maxlength="100" value="http://" onmouseover = "javascript:kunenaShowHelp('<?php @(print _KUNENA_EDITOR_HELPLINE_LINKURL); ?> ')" /> <?php @(print _KUNENA_EDITOR_LINK_TEXT); ?> <input name="text2" type="text" size="30" maxlength="100" onmouseover = "javascript:kunenaShowHelp('<?php @(print _KUNENA_EDITOR_HELPLINE_LINKTEXT); ?> ')" /> <input type="button" name="Link" accesskey = "w" value="<?php @(print _KUNENA_EDITOR_LINK_INSERT); ?> "" onclick="bbfontstyle('[url=' + this.form.url.value + ']'+ this.form.text2.value,'[/url]')" onmouseover = "javascript:kunenaShowHelp('<?php @(print _KUNENA_EDITOR_HELPLINE_LINKAPPLY); ?> ')" /> </div> <div id="image" style="display: none;"> <?php @(print _KUNENA_EDITOR_IMAGE_SIZE); ?> <input name="size" type="text" size="10" maxlength="10" onmouseover = "javascript:kunenaShowHelp('<?php @(print _KUNENA_EDITOR_HELPLINE_IMAGELINKSIZE); ?> ')" /> <?php @(print _KUNENA_EDITOR_IMAGE_URL); ?> <input name="url2" type="text" size="40" maxlength="250" value="http://" onmouseover = "javascript:kunenaShowHelp('<?php @(print _KUNENA_EDITOR_HELPLINE_IMAGELINKURL); ?> ')" /> <input type="button" name="Link" accesskey = "p" value="<?php @(print _KUNENA_EDITOR_IMAGE_INSERT); ?> " onclick="check_image()" onmouseover = "javascript:kunenaShowHelp('<?php @(print _KUNENA_EDITOR_HELPLINE_IMAGELINKAPPLY); ?> ')" /> <script type="text/javascript"> function check_image() { if (document.postform.size.value == "") { bbfontstyle('[img]'+ document.postform.url2.value,'[/img]'); } else { bbfontstyle('[img size=' + document.postform.size.value + ']'+ document.postform.url2.value,'[/img]'); } } </script> </div> <div id="video" style="display: none;"> <?php @(print _KUNENA_EDITOR_VIDEO_SIZE); ?> <input name="videosize" type="text" size="5" maxlength="5" onmouseover = "javascript:kunenaShowHelp('<?php @(print _KUNENA_EDITOR_HELPLINE_VIDEOSIZE); ?> ')" /> <?php @(print _KUNENA_EDITOR_VIDEO_WIDTH); ?> <input name="videowidth" type="text" size="5" maxlength="5" onmouseover = "javascript:kunenaShowHelp('<?php @(print _KUNENA_EDITOR_HELPLINE_VIDEOWIDTH); ?> ')" /> <?php @(print _KUNENA_EDITOR_VIDEO_HEIGHT); ?> <input name="videoheight" type="text" size="5" maxlength="5" onmouseover = "javascript:kunenaShowHelp('<?php @(print _KUNENA_EDITOR_HELPLINE_VIDEOHEIGHT); ?> ')" /> <br /> <?php @(print _KUNENA_EDITOR_VIDEO_PROVIDER); ?> <select name = "fb_vid_code1" class = "<?php echo $boardclass; ?> button" onmouseover = "javascript:kunenaShowHelp('<?php @(print _KUNENA_EDITOR_HELPLINE_VIDEOPROVIDER); ?> ')"> <?php $vid_provider = array('', 'AnimeEpisodes', 'Biku', 'Bofunk', 'Break', 'Clip.vn', 'Clipfish', 'Clipshack', 'Collegehumor', 'Current', 'DailyMotion', 'DivX,divx]http://', 'DownloadFestival', 'Flash,flash]http://', 'FlashVars,flashvars param=]http://', 'Fliptrack', 'Fliqz', 'Gametrailers', 'Gamevideos', 'Glumbert', 'GMX', 'Google', 'GooglyFoogly', 'iFilm', 'Jumpcut', 'Kewego', 'LiveLeak', 'LiveVideo', 'MediaPlayer,mediaplayer]http://', 'MegaVideo', 'Metacafe', 'Mofile', 'Multiply', 'MySpace', 'MyVideo', 'QuickTime,quicktime]http://', 'Quxiu', 'RealPlayer,realplayer]http://', 'Revver', 'RuTube', 'Sapo', 'Sevenload', 'Sharkle', 'Spikedhumor', 'Stickam', 'Streetfire', 'StupidVideos', 'Toufee', 'Tudou', 'Unf-Unf', 'Uume', 'Veoh', 'VideoclipsDump', 'Videojug', 'VideoTube', 'Vidiac', 'VidiLife', 'Vimeo', 'WangYou', 'WEB.DE', 'Wideo.fr', 'YouKu', 'YouTube'); foreach ($vid_provider as $vid_type) { $vid_type = explode(',', $vid_type); echo '<option value = "' . (!empty($vid_type[1]) ? $vid_type[1] : strtolower($vid_type[0]) . '') . '">' . $vid_type[0] . '</option>'; } ?> </select> <?php @(print _KUNENA_EDITOR_VIDEO_ID); ?> <input name="videoid" type="text" size="11" maxlength="11" onmouseover = "javascript:kunenaShowHelp('<?php @(print _KUNENA_EDITOR_HELPLINE_VIDEOID); ?> ')" /> <input type="button" name="Video" accesskey = "p" value="<?php @(print _KUNENA_EDITOR_IMAGE_INSERT); ?> " onclick="check_video('video1')" onmouseover = "javascript:kunenaShowHelp('<?php @(print _KUNENA_EDITOR_HELPLINE_VIDEOAPPLY1); ?> ')" /><br /> <?php @(print _KUNENA_EDITOR_VIDEO_URL); ?> <input name="videourl" type="text" size="30" maxlength="250" value="http://" onmouseover = "javascript:kunenaShowHelp('<?php @(print _KUNENA_EDITOR_HELPLINE_VIDEOURL); ?> ')" /> <input type="button" name="Video" accesskey = "p" value="<?php @(print _KUNENA_EDITOR_IMAGE_INSERT); ?> " onclick="check_video('video2')" onmouseover = "javascript:kunenaShowHelp('<?php @(print _KUNENA_EDITOR_HELPLINE_VIDEOAPPLY2); ?> ')" /> <script type="text/javascript"> function check_video(art) { var video; if (document.postform.videosize.value != "") {video = " size=" + document.postform.videosize.value;} else {video=""} if (document.postform.videowidth.value != "") {video = video + " width=" + document.postform.videowidth.value;} if (document.postform.videoheight.value != "") {video = video + " height=" + document.postform.videoheight.value;} if (art=='video1'){ if (document.postform.fb_vid_code1.value != "") {video = video + " type=" + document.postform.fb_vid_code1.options[document.postform.fb_vid_code1.selectedIndex].value;} bbfontstyle('[video' + video + ']'+ document.postform.videoid.value,'[/video]');} else {bbfontstyle('[video' + video + ']'+ document.postform.videourl.value,'[/video]');} } </script> </div> <div id="smilie" style="display: none;"> <?php $kunena_db =& JFactory::getDBO(); $kunena_db->setQuery("SELECT code, location, emoticonbar FROM #__fb_smileys ORDER BY id"); if ($kunena_db->query()) { $rowset = array(); $set = $kunena_db->loadAssocList(); foreach ($set as $smilies) { $key_exists = false; foreach ($rowset as $check) { //checks if the smiley (location) already exists with another code if ($check['location'] == $smilies['location']) { $key_exists = true; } } if ($key_exists == false) { $rowset[] = array('code' => $smilies['code'], 'location' => $smilies['location'], 'emoticonbar' => $smilies['emoticonbar']); } } reset($rowset); foreach ($rowset as $data) { echo '<img class="btnImage" src="' . KUNENA_URLEMOTIONSPATH . $data['location'] . '" border="0" alt="' . $data['code'] . ' " title="' . $data['code'] . ' " onclick="bbfontstyle(\' ' . $data['code'] . ' \',\'\')" style="cursor:pointer"/>' . "\n"; } } ?> </div> </td></tr> <!-- end of extendable fiels --> <tr> <td class = "<?php echo $boardclass; ?> posthint"> <input type = "text" name = "helpbox" size = "45" class = "<?php echo $boardclass; ?> inputbox" maxlength = "100" value = "<?php @(print _KUNENA_EDITOR_HELPLINE_HINT); ?> " /> </td> </tr> </table> </td> </tr> <tr class = "<?php echo $boardclass; ?> sectiontableentry2"> <td valign = "top" class = "fb_leftcolumn"> <strong><?php @(print _MESSAGE); ?> </strong>:<br /> <b onclick = "size_messagebox(100);" style="cursor:pointer">(+)</b><b> / </b><b onclick = "size_messagebox(-100);" style="cursor:pointer">(-)</b> <?php if ($emoticons != 1) { ?> <br/> <br/> <div align = "right"> <table border = "0" cellspacing = "3" cellpadding = "0"> <tr> <td colspan = "4" style = "text-align: center;"> <strong><?php @(print _GEN_EMOTICONS); ?> </strong> </td> </tr> <?php generate_smilies(); //the new function Smiley mod ?> </table> </div> <?php } ?> </td> <td valign = "top"> <textarea cols="60" rows="6" class = "<?php echo $boardclass; ?> txtarea" name = "<?php echo $areaname; ?> " id = "<?php echo $areaname; ?> "><?php echo kunena_htmlspecialchars($html, ENT_QUOTES); ?> </textarea> <?php if ($editmode) { // Moderator edit area ?> <fieldset> <legend><?php @(print _KUNENA_EDITING_REASON); ?> </legend> <input name="modified_reason" size="40" maxlength="200" type="text" /><br /> </fieldset> <?php } ?> </td> </tr> <?php }
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL * @link http://www.kunena.com * * Based on FireBoard Component * @Copyright (C) 2006 - 2007 Best Of Joomla All rights reserved * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL * @link http://www.bestofjoomla.com * * Based on Joomlaboard Component * @copyright (C) 2000 - 2004 TSMF / Jan de Graaff / All Rights Reserved * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL * @author TSMF & Jan de Graaff **/ // Dont allow direct linking defined('_JEXEC') or die('Restricted access'); $fbConfig =& CKunenaConfig::getInstance(); $fbSession =& CKunenaSession::getInstance(); global $is_Moderator; $kunena_db =& JFactory::getDBO(); require_once KUNENA_PATH_LIB . DS . 'kunena.authentication.php'; //Security basics begin //Securing passed form elements: $catid = (int) $catid; // redundant //resetting some things: $moderatedForum = 0; $forumLocked = 0; $topicLocked = 0; $topicSticky = 0; unset($allow_forum); //get the allowed forums and turn it into an array
function showprf($userid, $page) { $fbConfig =& CKunenaConfig::getInstance(); $kunena_acl =& JFactory::getACL(); $kunena_my =& JFactory::getUser(); $kunena_db =& JFactory::getDBO(); // ERROR: mixed global $fbIcons global $fbIcons; //Get userinfo needed later on, this limits the amount of queries unset($userinfo); $kunena_db->setQuery("SELECT a.*, b.* FROM #__fb_users AS a LEFT JOIN #__users AS b ON b.id=a.userid WHERE a.userid='{$userid}'"); $userinfo = $kunena_db->loadObject(); check_dberror('Unable to get user profile info.'); if (!$userinfo) { $kunena_db->setQuery("SELECT * FROM #__users WHERE id='{$userid}'"); $userinfo = $kunena_db->loadObject(); check_dberror('Unable to get user profile info.'); if (!$userinfo) { echo '<h3>' . _KUNENA_PROFILE_NO_USER . '</h3>'; return; } else { // Check moderator status (admin is moderator) $aro_group = $kunena_acl->getAroGroup($userid); $is_admin = strtolower($aro_group->name) == 'super administrator' || strtolower($aro_group->name) == 'administrator'; // there's no profile; set userid and moderator status. $kunena_db->setQuery("INSERT INTO #__fb_users (userid,moderator) VALUES ('{$userid}','{$is_admin}')"); $kunena_db->query(); check_dberror('Unable to create user profile.'); $kunena_db->setQuery("SELECT a.*, b.* FROM #__fb_users AS a LEFT JOIN #__users AS b ON b.id=a.userid WHERE a.userid='{$userid}'"); $userinfo = $kunena_db->loadObject(); check_dberror('Unable to get user profile info.'); // TODO: For future use // echo '<h3>' . _KUNENA_PROFILE_NOT_FOUND . '</h3>'; // return; } } // User Hits $kunena_db->setQuery('UPDATE #__fb_users SET uhits=uhits+1 WHERE userid=' . $userid); $kunena_db->query() or trigger_dberror("Unable to update user hits."); // get userprofile hits $msg_userhits = $userinfo->uhits; //get the username: $fb_username = ""; if ($fbConfig->username) { $fb_queryName = "username"; } else { $fb_queryName = "name"; } $fb_username = $userinfo->{$fb_queryName}; $lists["userid"] = $userid; $msg_username = $fb_username; // $msg_username = ($fmessage->email != "" && $kunena_my->id > 0 && $fbConfig->showemail == '1') ? "<a href=\"mailto:" . $fmessage->email . "\">" . $fb_username . "</a>" : $fb_username; if ($fbConfig->allowavatar) { $Avatarname = $userinfo->username; if ($fbConfig->avatar_src == "jomsocial") { // Get CUser object $user =& CFactory::getUser($userid); $msg_avatar = '<span class="fb_avatar"><img src="' . $user->getAvatar() . '" alt="" /></span>'; } else { if ($fbConfig->avatar_src == "clexuspm") { $msg_avatar = '<span class="fb_avatar"><img src="' . MyPMSTools::getAvatarLinkWithID($userid, "b") . '" alt="" /></span>'; } else { if ($fbConfig->avatar_src == "cb") { $kunenaProfile = CKunenaCBProfile::getInstance(); $msg_avatar = '<span class="fb_avatar">' . $kunenaProfile->showAvatar($userid, '', 0) . '</span>'; } else { $avatar = $userinfo->avatar; if ($avatar != '') { if (!file_exists(KUNENA_PATH_UPLOADED . DS . 'avatars/l_' . $avatar)) { $msg_avatar = '<span class="fb_avatar"><img border="0" src="' . KUNENA_LIVEUPLOADEDPATH . '/avatars/' . $avatar . '" alt="" style="max-width: ' . $fbConfig->avatarwidth . 'px; max-height: ' . $fbConfig->avatarheight . 'px;" /></span>'; } else { $msg_avatar = '<span class="fb_avatar"><img border="0" src="' . KUNENA_LIVEUPLOADEDPATH . '/avatars/' . $avatar . '" alt="" /></span>'; } } else { $msg_avatar = '<span class="fb_avatar"><img border="0" src="' . KUNENA_LIVEUPLOADEDPATH . '/avatars/nophoto.jpg" alt="" /></span>'; } } } } } if ($fbConfig->showuserstats) { //user type determination $ugid = $userinfo->gid; $uIsMod = 0; $uIsAdm = 0; if ($ugid > 0) { //only get the groupname from the ACL if we're sure there is one $agrp = strtolower($kunena_acl->get_group_name($ugid, 'ARO')); } if ($ugid == 0) { $msg_usertype = _VIEW_VISITOR; } else { if (strtolower($agrp) == "administrator" || strtolower($agrp) == "superadministrator" || strtolower($agrp) == "super administrator") { $msg_usertype = _VIEW_ADMIN; $uIsAdm = 1; } elseif ($uIsMod) { $msg_usertype = _VIEW_MODERATOR; } else { $msg_usertype = _VIEW_USER; } } //done usertype determination, phew... //Get the max# of posts for any one user $kunena_db->setQuery("SELECT MAX(posts) FROM #__fb_users"); $maxPosts = $kunena_db->loadResult(); //# of post for this user and ranking $numPosts = (int) $userinfo->posts; //ranking if ($fbConfig->showranking) { if ($userinfo->rank != '0') { //special rank $kunena_db->setQuery("SELECT * FROM #__fb_ranks WHERE rank_id='{$userinfo->rank}'"); $getRank = $kunena_db->loadObjectList(); check_dberror("Unable to load ranks."); $rank = $getRank[0]; $rText = $rank->rank_title; $rImg = KUNENA_URLRANKSPATH . $rank->rank_image; } if ($userinfo->rank == '0') { //post count rank $kunena_db->setQuery("SELECT * FROM #__fb_ranks WHERE ((rank_min <= '{$numPosts}') AND (rank_special = '0')) ORDER BY rank_min DESC", 0, 1); $getRank = $kunena_db->loadObjectList(); check_dberror("Unable to load ranks."); $rank = $getRank[0]; $rText = $rank->rank_title; $rImg = KUNENA_URLRANKSPATH . $rank->rank_image; } if ($uIsMod) { $rText = _RANK_MODERATOR; $rImg = KUNENA_URLRANKSPATH . 'rankmod.gif'; } if ($uIsAdm) { $rText = _RANK_ADMINISTRATOR; $rImg = KUNENA_URLRANKSPATH . 'rankadmin.gif'; } if ($fbConfig->rankimages) { $msg_userrankimg = '<img src="' . $rImg . '" alt="" />'; } $msg_userrank = $rText; $useGraph = 0; //initialization if (!$fbConfig->poststats) { $msg_posts = '<div class="viewcover">' . "<strong>" . _POSTS . " {$numPosts}" . "</strong>" . "</div>"; $useGraph = 0; } else { $myGraph = new phpGraph(); //$myGraph->SetGraphTitle(_POSTS); $myGraph->AddValue(_POSTS, $numPosts); $myGraph->SetRowSortMode(0); $myGraph->SetBarImg(KUNENA_URLGRAPHPATH . "col" . $fbConfig->statscolor . "m.png"); $myGraph->SetBarImg2(KUNENA_URLEMOTIONSPATH . "graph.gif"); $myGraph->SetMaxVal($maxPosts); $myGraph->SetShowCountsMode(2); $myGraph->SetBarWidth(4); //height of the bar $myGraph->SetBorderColor("#333333"); $myGraph->SetBarBorderWidth(0); $myGraph->SetGraphWidth(120); //should match column width in the <TD> above -5 pixels //$myGraph->BarGraphHoriz(); $useGraph = 1; } } } //karma points and buttons if ($fbConfig->showkarma && $userid != '0') { $karmaPoints = $userinfo->karma; $karmaPoints = (int) $karmaPoints; $msg_karma = "<strong>" . _KARMA . ":</strong> {$karmaPoints}"; $msg_karmaminus = ''; $msg_karmaplus = ''; if ($kunena_my->id != '0' && $kunena_my->id != $userid) { $msg_karmaminus .= "<a href=\"" . JRoute::_(KUNENA_LIVEURLREL . '&func=karma&do=decrease&userid=' . $userid) . "\"><img src=\""; if (isset($fbIcons['karmaminus'])) { $msg_karmaminus .= KUNENA_URLICONSPATH . $fbIcons['karmaminus']; } else { $msg_karmaminus .= KUNENA_URLEMOTIONSPATH . "karmaminus.gif"; } $msg_karmaminus .= "\" alt=\"Karma-\" border=\"0\" title=\"" . _KARMA_SMITE . "\" align=\"middle\" /></a>"; $msg_karmaplus .= "<a href=\"" . JRoute::_(KUNENA_LIVEURLREL . '&func=karma&do=increase&userid=' . $userid) . "\"><img src=\""; if (isset($fbIcons['karmaplus'])) { $msg_karmaplus .= KUNENA_URLICONSPATH . $fbIcons['karmaplus']; } else { $msg_karmaplus .= KUNENA_URLEMOTIONSPATH . "karmaplus.gif"; } $msg_karmaplus .= "\" alt=\"Karma+\" border=\"0\" title=\"" . _KARMA_APPLAUD . "\" align=\"middle\" /></a>"; } } /*let's see if we should use uddeIM integration */ if ($fbConfig->pm_component == "uddeim" && $userid && $kunena_my->id) { //we should offer the user a PMS link //first get the username of the user to contact $PMSName = $userinfo->username; $msg_pms = "<a href=\"" . JRoute::_('index.php?option=com_uddeim&task=new&recip=' . $userid) . "\"><img src=\""; if ($fbIcons['pms']) { $msg_pms .= KUNENA_URLICONSPATH . $fbIcons['pms']; } else { $msg_pms .= KUNENA_URLEMOTIONSPATH . "sendpm.gif"; } $msg_pms .= "\" alt=\"" . _VIEW_PMS . "\" border=\"0\" title=\"" . _VIEW_PMS . "\" /></a>"; } /*let's see if we should use myPMS2 integration */ if ($fbConfig->pm_component == "pms" && $userid && $kunena_my->id) { //we should offer the user a PMS link //first get the username of the user to contact $PMSName = $userinfo->username; $msg_pms = "<a href=\"" . JRoute::_('index.php?option=com_pms&page=new&id=' . $PMSName . '&title=' . $fmessage->subject) . "\"><img src=\""; if ($fbIcons['pms']) { $msg_pms .= KUNENA_URLICONSPATH . $fbIcons['pms']; } else { $msg_pms .= KUNENA_URLEMOTIONSPATH . "sendpm.gif"; } $msg_pms .= "\" alt=\"" . _VIEW_PMS . "\" border=\"0\" title=\"" . _VIEW_PMS . "\" /></a>"; } // online - ofline status if ($userid > 0) { $sql = "SELECT COUNT(userid) FROM #__session WHERE userid='{$userid}'"; $kunena_db->setQuery($sql); $isonline = $kunena_db->loadResult(); if ($isonline && $userinfo->showOnline == 1) { $msg_online = isset($fbIcons['onlineicon']) ? '<img src="' . KUNENA_URLICONSPATH . $fbIcons['onlineicon'] . '" border="0" alt="' . _MODLIST_ONLINE . '" />' : ' <img src="' . KUNENA_URLEMOTIONSPATH . 'onlineicon.gif" border="0" alt="' . _MODLIST_ONLINE . '" />'; } else { $msg_online = isset($fbIcons['offlineicon']) ? '<img src="' . KUNENA_URLICONSPATH . $fbIcons['offlineicon'] . '" border="0" alt="' . _MODLIST_OFFLINE . '" />' : ' <img src="' . KUNENA_URLEMOTIONSPATH . 'offlineicon.gif" border="0" alt="' . _MODLIST_OFFLINE . '" />'; } } /* ClexusPM integration */ if ($fbConfig->pm_component == "clexuspm") { //we should offer the user a PMS link //first get the username of the user to contact $PMSName = $userinfo->aid; $msg_pms = "<a href=\"" . JRoute::_('index.php?option=com_mypms&task=new&to=' . $userid . '' . $fmessage->subject) . "\"><img src=\""; if ($fbIcons['pms']) { $msg_pms .= KUNENA_URLICONSPATH . $fbIcons['pms']; } else { $msg_pms .= KUNENA_JLIVEURL . "/components/com_mypms/images/icons/message_12px.gif"; } $msg_pms .= "\" alt=\"" . _VIEW_PMS . "\" border=\"0\" title=\"" . _VIEW_PMS . "\" /></a>"; //mypms pro profile link $msg_profile = "<a href=\"" . MyPMSTools::getProfileLink($userid) . "\"><img src=\""; if ($fbIcons['userprofile']) { $msg_profile .= KUNENA_URLICONSPATH . $fbIcons['userprofile']; } else { $msg_profile .= KUNENA_JLIVEURL . "/components/com_mypms/images/managecontact_icon.gif"; } $msg_profile .= "\" alt=\"" . _VIEW_PROFILE . "\" border=\"0\" title=\"" . _VIEW_PROFILE . "\" /></a>"; //mypms add buddy link $msg_buddy = "<a href=\"" . JRoute::_('index.php?option=com_mypms&user='******'&task=addbuddy') . "\"><img src=\""; if ($fbIcons['pms2buddy']) { $msg_buddy .= KUNENA_URLICONSPATH . $fbIcons['pms2buddy']; } else { $msg_buddy .= KUNENA_JLIVEURL . "/components/com_mypms/images/messages/addbuddy.gif"; } $msg_buddy .= "\" alt=\"" . _VIEW_ADDBUDDY . "\" border=\"0\" title=\"" . _VIEW_ADDBUDDY . "\" /></a>"; $kunena_db->setQuery("SELECT icq, ym, msn, aim, website, location FROM #__mypms_profiles WHERE user='******'"); $profileitems = $kunena_db->loadObjectList(); check_dberror("Unable to load mypms_profiles."); foreach ($profileitems as $profileitems) { if ($profileitems->aim) { $msg_aim = "<a href=\"aim:goim?screenname=" . str_replace(" ", "+", $profileitems->aim) . "\"><img src=\"" . KUNENA_URLEMOTIONSPATH . "aim.png\" border=0 alt=\"\" /></a>"; } if ($profileitems->icq) { $msg_icq = "<a href=\"http://www.icq.com/whitepages/wwp.php?uin=" . $profileitems->icq . "\"><img src=\"" . KUNENA_URLEMOTIONSPATH . "icq.png\" border=0 alt=\"\" /></a>"; } if ($profileitems->msn) { $msg_msn = "<a href=\"" . JRoute::_('index.php?option=com_mypms&task=showprofile&user='******'/plugin/fbprofile/userinfos.php')) { include KUNENA_ABSTMPLTPATH . '/plugin/fbprofile/userinfos.php'; } else { include KUNENA_PATH_TEMPLATE_DEFAULT . DS . 'plugin/fbprofile/userinfos.php'; } ?> <!-- /Kunena Profile --> </td> <td class = "<?php echo $boardclass; ?> profile-right" valign="top" width="74%"> <!-- User Messages --> <?php if (file_exists(KUNENA_ABSTMPLTPATH . '/plugin/fbprofile/summary.php')) { include KUNENA_ABSTMPLTPATH . '/plugin/fbprofile/summary.php'; } else { include KUNENA_PATH_TEMPLATE_DEFAULT . DS . 'plugin/fbprofile/summary.php'; } ?> <?php if (file_exists(KUNENA_ABSTMPLTPATH . '/plugin/fbprofile/forummsg.php')) { include KUNENA_ABSTMPLTPATH . '/plugin/fbprofile/forummsg.php'; } else { include KUNENA_PATH_TEMPLATE_DEFAULT . DS . 'plugin/fbprofile/forummsg.php'; } ?> </td> </tr> </table> <?php /* end of function */ }