Ejemplo n.º 1
0
 foreach ($reports as $report) {
     $post_link = "<a href=\"" . XOOPS_URL . "/modules/" . $xoopsModule->getVar('dirname') . "/viewtopic.php?post_id=" . $report['post_id'] . "&amp;topic_id=" . $report['topic_id'] . "&amp;forum=" . $report['forum_id'] . "&amp;viewmode=thread\" target=\"checkreport\">" . $myts->htmlSpecialChars($report['subject']) . "</a>";
     $checkbox = '<input type="checkbox" name="report_id[' . $report['report_id'] . ']" value="1" checked="checked" />';
     if ($item == 'process') {
         $memo = '<input type="text" name="report_memo[' . $report['report_id'] . ']" maxlength="255" size="80" />';
     } else {
         $memo = $myts->htmlSpecialChars($report['report_memo']);
     }
     echo "<tr class='odd' align='left'>";
     echo "<td>" . _AM_XFORUM_REPORTPOST . ': ' . $post_link . "</td>";
     echo "<td align='center'>" . $report['report_id'] . "</td>";
     echo "</tr>";
     echo "<tr class='odd' align='left'>";
     echo "<td>" . _AM_XFORUM_REPORTTEXT . ': ' . $myts->htmlSpecialChars($report['report_text']) . "</td>";
     $uid = intval($report['reporter_uid']);
     $reporter_name = forum_getUnameFromId($uid, $xoopsModuleConfig['show_realname']);
     $reporter = !empty($uid) ? "<a href='" . XOOPS_URL . "/userinfo.php?uid=" . $uid . "'>" . $reporter_name . "</a><br />" : "";
     echo "<td align='center'>" . $reporter . long2ip($report['reporter_ip']) . "</td>";
     echo "</tr>";
     echo "<tr class='odd' align='left'>";
     echo "<td>" . _AM_XFORUM_REPORTMEMO . ': ' . $memo . "</td>";
     echo "<td align='center' >" . $checkbox . "</td>";
     echo "</tr>";
     echo "<tr colspan='2'><td height='2'></td></tr>";
 }
 $submit = new XoopsFormButton('', 'submit', _SUBMIT, 'submit');
 echo "<tr colspan='2'><td align='center'>" . $submit->render() . "</td></tr>";
 $hidden =& new XoopsFormHidden('op', 'save');
 echo $hidden->render();
 $hidden =& new XoopsFormHidden('item', $item);
 echo $hidden->render() . "</form>";
Ejemplo n.º 2
0
        	forum_message("poll adding to topic error: ".$sql);
        }
		include_once XOOPS_ROOT_PATH.'/class/template.php';
		xoops_template_clear_module_cache($xoopsModule->getVar('mid'));
	} else {
		forum_message($poll->getHtmlErrors());
		//exit();
	}
	redirect_header("viewtopic.php?topic_id=$topic_id&forum=".$viewtopic_forum->getVar('forum_id'),1,_MD_POLL_DBUPDATED);
	//exit();
}

if ( $op == "edit" ) {
	$poll = new XoopsPoll($_GET['poll_id']);
	$poll_form = new XoopsThemeForm(_MD_POLL_EDITPOLL, "poll_form", "polls.php");
	$author_label = new XoopsFormLabel(_MD_POLL_AUTHOR, "<a href='".XOOPS_URL."/userinfo.php?uid=".$poll->getVar("user_id")."'>".forum_getUnameFromId($poll->getVar("user_id"), $xoopsModuleConfig['show_realname'])."</a>");
	$poll_form->addElement($author_label);
	$question_text = new XoopsFormText(_MD_POLL_POLLQUESTION, "question", 50, 255, $poll->getVar("question", "E"));
	$poll_form->addElement($question_text);
	$desc_tarea = new XoopsFormTextarea(_MD_POLL_POLLDESC, "description", $poll->getVar("description", "E"));
	$poll_form->addElement($desc_tarea);
	$date = formatTimestamp($poll->getVar("end_time"), "Y-m-d H:i:s");
	if ( !$poll->hasExpired() ) {
		$expire_text = new XoopsFormText(_MD_POLL_EXPIRATION."<br /><small>"._MD_POLL_FORMAT."<br />".sprintf(_MD_POLL_CURRENTTIME, formatTimestamp(time(), "Y-m-d H:i:s"))."</small>", "end_time", 20, 19, $date);
		$poll_form->addElement($expire_text);
	} else {
		$restart_label = new XoopsFormLabel(_MD_POLL_EXPIRATION, sprintf(_MD_POLL_EXPIREDAT, $date)."<br /><a href='polls.php?op=restart&amp;poll_id=".$poll->getVar("poll_id")."'>"._MD_POLL_RESTART."</a>");
		$poll_form->addElement($restart_label);
	}
	$weight_text = new XoopsFormText(_MD_POLL_DISPLAYORDER, "weight", 6, 5, $poll->getVar("weight"));
	$poll_form->addElement($weight_text);
Ejemplo n.º 3
0
    $poster_name=$forumpost->getVar('poster_name', "E");
    $attachments=$forumpost->getAttachment();
    $post_karma=$forumpost->getVar('post_karma');
    $require_reply=$forumpost->getVar('require_reply');
    $tags=$forumpost->getVar('tags', "E");
    $hidden = "";

    include 'include/forumform.inc.php';
    if (!$istopic) {
        $forumpost2 =& $post_handler->get($post_id2);

	    $r_message = $forumpost2->getVar('post_text');

    	$isadmin = 0;
    	if($forumpost2->getVar('uid')) {
	    	$r_name = forum_getUnameFromId( $forumpost2->getVar('uid'), $xoopsModuleConfig['show_realname']);
			if (forum_isAdmin($forum_obj, $forumpost2->getVar('uid'))) $isadmin = 1;
    	}else{
	    	$poster_name = $forumpost2->getVar('poster_name');
    		$r_name = (empty($poster_name))?$xoopsConfig['anonymous']:$poster_name;
		}
		$r_date = formatTimestamp($forumpost2->getVar('post_time'));
	    $r_subject = $forumpost2->getVar('subject');

        $r_content = _MD_BY." ".$r_name." "._MD_ON." ".$r_date."<br /><br />";
        $r_content .= $r_message;
        $r_subject=$forumpost2->getVar('subject');
        echo "<table cellpadding='4' cellspacing='1' width='98%' class='outer'><tr><td class='head'>".$r_subject."</td></tr>";
        echo "<tr><td><br />".$r_content."<br /></td></tr></table>";
    }
Ejemplo n.º 4
0
	$karma_handler =& xoops_getmodulehandler('karma', 'xforum');
	$user_karma = $karma_handler->getUserKarma();

    foreach ($forumpostshow as $eachpost) {
    	// Sorry, in order to save queries, we have to hide the non-open post_text even if you have replied or have adequate karma, even an admin.
	    if( $xoopsModuleConfig['enable_karma'] && $eachpost->getVar('post_karma') > 0 ) {
	        $p_message = sprintf(_MD_KARMA_REQUIREMENT, "***", $eachpost->getVar('post_karma'))."</div>";
	    }elseif( $xoopsModuleConfig['allow_require_reply'] && $eachpost->getVar('require_reply') ) {
	        $p_message = _MD_REPLY_REQUIREMENT;
	    }else{
		    $p_message = $eachpost->getVar('post_text');
	    }

    	$isadmin = 0;
    	if($eachpost->getVar('uid')) {
	    	$p_name =forum_getUnameFromId( $eachpost->getVar('uid'), $xoopsModuleConfig['show_realname'] );
			if (forum_isAdmin($forum_obj, $eachpost->getVar('uid'))) $isadmin = 1;
    	}else{
	    	$poster_name = $eachpost->getVar('poster_name');
    		$p_name = (empty($poster_name))?$xoopsConfig['anonymous']:$myts->htmlSpecialChars($poster_name);
		}
		$p_date = formatTimestamp($eachpost->getVar('post_time'));
		/*
	    if( $isadmin && $xoopsModuleConfig['allow_moderator_html']){
	    	$p_subject = $myts->undoHtmlSpecialChars($eachpost->getVar('subject'));
		}else{
	    	$p_subject = $eachpost->getVar('subject');
		}
		*/
	    $p_subject = $eachpost->getVar('subject');
    	$p_content = _MD_BY." <strong> ".$p_name." </strong> "._MD_ON." <strong> ".$p_date."</strong><br /><br />";
Ejemplo n.º 5
0
        $useravgrating = 0;
        while (list($rating2) = $xoopsDB->fetchRow($result2)) {
            $useravgrating = $useravgrating + $rating2;
        }
        if ($useravgrating > 0) {
            $useravgrating = $useravgrating / $uservotes;
            $useravgrating = number_format($useravgrating, 2);
        }
        xoops_cp_header();
        loadModuleAdminMenu(10, _AM_XFORUM_VOTE_RATINGINFOMATION);
        echo "\n\t\t<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_XFORUM_VOTE_DISPLAYVOTES . "</legend>\n\n\t\t<div style='padding: 8px;'>\n\n\t\t<div><strong>" . _AM_XFORUM_VOTE_USERAVG . ": </strong>{$useravgrating}</div>\n\n\t\t<div><strong>" . _AM_XFORUM_VOTE_TOTALRATE . ": </strong>{$uservotes}</div>\n\n\t\t<div style='padding: 8px;'>\n\n\t\t<ul><li>" . forum_displayImage($xforumImage['delete'], _DELETE) . " " . _AM_XFORUM_VOTE_DELETEDSC . "</li></ul>\n\t\t<div>\n\n\t\t</fieldset>\n\n\t\t<br />\n\n\n\t\t<table width='100%' cellspacing='1' cellpadding='2' class='outer'>\n\n\t\t<tr>\n\n\t\t<th align='center'>" . _AM_XFORUM_VOTE_ID . "</th>\n\n\t\t<th align='center'>" . _AM_XFORUM_VOTE_USER . "</th>\n\n\t\t<th align='center'>" . _AM_XFORUM_VOTE_IP . "</th>\n\n\t\t<th align='center'>" . _AM_XFORUM_VOTE_FILETITLE . "</th>\n\n\t\t<th align='center'>" . _AM_XFORUM_VOTE_RATING . "</th>\n\n\t\t<th align='center'>" . _AM_XFORUM_VOTE_DATE . "</th>\n\n\t\t<th align='center'>" . _AM_XFORUM_ACTION . "</th></tr>\n";
        if ($votes == 0) {
            echo "<tr><td align='center' colspan='7' class='head'>" . _AM_XFORUM_VOTE_NOVOTES . "</td></tr>";
        }
        while (list($ratingid, $topic_id, $ratinguser, $rating, $ratinghostname, $ratingtimestamp) = $xoopsDB->fetchRow($results)) {
            $sql = "SELECT topic_title FROM " . $xoopsDB->prefix('xf_topics') . " WHERE topic_id=" . $topic_id . "";
            $down_array = $xoopsDB->fetchArray($xoopsDB->query($sql));
            $formatted_date = formatTimestamp($ratingtimestamp, _DATESTRING);
            $ratinguname = forum_getUnameFromId($ratinguser, $xoopsModuleConfig['show_realname']);
            echo "\n\t\t<tr>\n\n\t\t<td class='head' align='center'>{$ratingid}</td>\n\n\t\t<td class='even' align='center'>{$ratinguname}</td>\n\n\t\t<td class='even' align='center' >{$ratinghostname}</td>\n\n\t\t<td class='even' align='left'><a href='" . XOOPS_URL . "/modules/xforum/viewtopic.php?topic_id=" . $topic_id . "' target='topic'>" . $myts->htmlSpecialChars($down_array['topic_title']) . "</a></td>\n\n\t\t<td class='even' align='center'>{$rating}</td>\n\n\t\t<td class='even' align='center'>{$formatted_date}</td>\n\n\t\t<td class='even' align='center'><strong><a href='admin_votedata.php?op=delvotes&amp;topic_id={$topic_id}&amp;rid={$ratingid}'>" . forum_displayImage($xforumImage['delete'], _DELETE) . "</a></strong></td>\n\n\t\t</tr>\n";
        }
        echo "</table>";
        //Include page navigation
        include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
        $page = $votes > 20 ? _AM_XFORUM_MINDEX_PAGE : '';
        $pagenav = new XoopsPageNav($page, 20, $start, 'start');
        echo '<div align="right" style="padding: 8px;">' . $page . '' . $pagenav->renderImageNav(4) . '</div>';
        break;
}
echo chronolabs_inline(false);
xoops_cp_footer();