Esempio n. 1
0
function showPollOptions($options, $alreadyVoted, $totalVoted, $polid)
{
    if ($alreadyVoted) {
        $maxVoted = $totalVoted;
        foreach ($options as $optData) {
            $maxVoted = $optData["polOVotes"];
            break;
        }
        foreach ($options as $optData) {
            ?>
			<table cellspacing="0" cellpadding="0" border="0"><tr>
				<td class="wide">
					<?php 
            echo formatText($optData["polOOption"]);
            ?>
				</td>
				<td class="smalltext disable_wrapping" style="vertical-align: bottom">
					(<?php 
            echo fuzzy_number($optData["polOVotes"]);
            ?>
)
				</td>
			</tr></table>
			<?php 
            showPollBar($optData["polOVotes"], $maxVoted, $totalVoted);
        }
    } else {
        $options = array();
        $result2 = sql_query("SELECT * FROM `pollOptions` " . "WHERE `polOPoll` = '" . $polid . "' ORDER BY `polOid` LIMIT 20");
        while ($optData = mysql_fetch_assoc($result2)) {
            $options[$optData["polOid"]] = $optData;
        }
        foreach ($options as $optData) {
            ?>
			<div>
				<input class="checkbox" type="checkbox" id="<?php 
            echo $chkid = generateId();
            ?>
" name="option<?php 
            echo $optData["polOid"];
            ?>
" />
				<label for="<?php 
            echo $chkid;
            ?>
">
					<?php 
            echo formatText($optData["polOOption"]);
            ?>
				</label>
			</div>
			<?php 
        }
    }
}
Esempio n. 2
0
function updateJSStrings($lang)
{
    include INCLUDES . "emoticons.inc";
    // local $_emoticons
    include_once INCLUDES . "files.php";
    forceFolders("scripts/strings");
    $neededStrings = array("_ARE_YOU_SURE" => "_ARE_YOU_SURE", "_BB_ALIGN_CENTER" => "_BB_ALIGN_CENTER", "_BB_ALIGN_JUSTIFY" => "_BB_ALIGN_JUSTIFY", "_BB_ALIGN_LEFT" => "_BB_ALIGN_LEFT", "_BB_ALIGN_RIGHT" => "_BB_ALIGN_RIGHT", "_BB_BOLD" => "_BB_BOLD", "_BB_CLUBICON" => "_BB_CLUBICON", "_BB_EMOTICON" => "_BB_EMOTICON", "_BB_ITALIC" => "_BB_ITALIC", "_BB_STRIKED" => "_BB_STRIKED", "_BB_UNDERLINE" => "_BB_UNDERLINE", "_BB_SUBSCRIPT" => "_BB_SUBSCRIPT", "_BB_SUPERSCRIPT" => "_BB_SUPERSCRIPT", "_BB_THUMB" => "_BB_THUMB", "_BB_URL" => "_BB_URL", "_BB_USERICON" => "_BB_USERICON", "_BLANK_COMMENT" => "_BLANK_COMMENT", "_EMOTICONS" => "_EMOTICONS", "_EMOTICON_EXPLAIN" => "_EMOTICON_EXPLAIN", "_ENTER_CLUBNAME" => "_ENTER_CLUBNAME", "_ENTER_LINK_TEXT" => "_ENTER_LINK_TEXT", "_ENTER_LINK_URL" => "_ENTER_LINK_URL", "_ENTER_THUMBID" => "_ENTER_THUMBID", "_ENTER_USERNAME" => "_ENTER_USERNAME", "_FUZZY_0" => "_FUZZY_0", "_FUZZY_1" => "_FUZZY_1", "_FUZZY_2" => "_FUZZY_2", "_FUZZY_3" => "_FUZZY_3", "_FUZZY_7" => "_FUZZY_7", "_FUZZY_11" => "_FUZZY_11", "_FUZZY_24" => "_FUZZY_24", "_FUZZY_48" => "_FUZZY_48", "_FUZZY_99" => "_FUZZY_99", "_FUZZY_234" => "_FUZZY_234", "_FUZZY_456" => "_FUZZY_456", "_FUZZY_987" => "_FUZZY_987", "_HIDE" => "_HIDE", "_INVALID_FILE_TYPE" => "_JS_INVALID_FILE_TYPE", "_MORE" => "_MORE", "_NO_BBCODE" => "_NO_BBCODE", "_NO_EMOTICONS" => "_NO_EMOTICONS", "_NO_SIG" => "_NO_SIG", "_OEKAKI_NO_EDITOR" => "_JS_OEKAKI_NO_EDITOR", "_PLEASE_WAIT" => "_JS_PLEASE_WAIT", "_PREVIEW" => "_PREVIEW", "_PREV_FLASH_MOVIE" => "_JS_PREV_FLASH_MOVIE", "_PREV_TEXT_FILE" => "_JS_PREV_TEXT_FILE", "_READONLY" => "_READONLY", "_REQUIRE_LOGIN" => "_REQUIRE_LOGIN", "_SEND_COMMENT" => "_SEND_COMMENT", "_UPDATES" => "_UPDATES", "_MESSAGES" => "_MESSAGES", "_FAVOURITES" => "_FAVOURITES", "_COMMENTS" => "_COMMENTS", "_JOURNALS" => "_JOURNALS", "_SUBMISSIONS" => "_SUBMISSIONS", "_SUBMIT_TYPE_EXTRA" => "_SUBMIT_TYPE_EXTRA");
    $filename = "scripts/strings/" . $lang . ".js";
    $fp = fopen($filename . "_tmp", "w");
    foreach ($neededStrings as $key => $value) {
        $result = sql_query("SELECT `strText` FROM `strings` " . "WHERE `strLanguage` = '{$lang}' AND `strName` = '" . $value . "' LIMIT 1");
        if ($data = mysql_fetch_assoc($result)) {
            $text = formatText($data["strText"], true);
        } else {
            $result = sql_query("SELECT `strText` FROM `strings` " . "WHERE `strLanguage` = 'en' AND `strName` = '" . $value . "' LIMIT 1");
            if ($data = mysql_fetch_assoc($result)) {
                $text = formatText($data["strText"], true);
            } else {
                $text = "???";
            }
        }
        fwrite($fp, "var {$key} = '" . str_replace("\n", "", addslashes($text)) . "';\n");
    }
    fwrite($fp, "var Emoticons = new Array( ");
    $emots = array();
    foreach ($_emoticons as $emo1) {
        if (!$emo1["emoExtra"]) {
            $emots[$emo1["emoExpr"]] = $emo1;
        }
    }
    ksort($emots);
    $first = true;
    foreach ($emots as $emo1) {
        if ($first) {
            $first = false;
        } else {
            fwrite($fp, ",");
        }
        fwrite($fp, "{ expr: '" . $emo1["emoExpr"] . "', icon: '" . $emo1["emoFilename"] . "' }");
    }
    unset($emots);
    fwrite($fp, " );\n");
    fclose($fp);
    if (file_exists($filename)) {
        unlink($filename);
    }
    rename($filename . "_tmp", $filename);
}
Esempio n. 3
0
$tabs = array("requirements" => "Requirements", "subprojects" => "Bugs/Subprojects", "sponsors" => "Sponsors", "news" => "Activity", "submissions" => "Submissions", "start" => "Get Started");
list($rc, $disputes) = ff_getprojectdisputes($id);
if (!$rc && sizeof($disputes)) {
    $tabs["disputes"] = "Disputes";
}
tab_header($tabs, projurl($id), $tab, "requirements");
include_once "forum.php";
if ($tab == 'requirements') {
    print '<div style="font-size:small;color:#9c9d9d;text-align:center;padding-bottom:0.2em;font-style:italic">';
    print "Note: You can propose changes " . "using the forum below.</div>\n";
    print '<div class="spec">';
    //check if post has attachments
    if ($projinfo['numattachments'] > 0) {
        list($rc, $body) = ff_attachtoproject($projinfo['id'], formatText($projinfo["reqmts"]));
    } else {
        $body = formatText($projinfo["reqmts"]);
    }
    print $body;
    print '</div>';
    if ($projinfo['numattachments'] > 0) {
        print "<br>\n";
        print "<b>attachments:</b><br>\n";
        list($rc, $err) = ff_listprojectattachments($projinfo['id']);
    }
    //display the list of history changes
    list($rc, $history) = ff_getreqmtshistory($id);
    if (!$rc && sizeof($history) > 0) {
        print "<br><b>Change History:</b><br>\n";
        print "<ul>\n";
        $historysize = sizeof($history);
        for ($i = $historysize - 1; $i >= 0; $i--) {
Esempio n. 4
0
$modResult = sql_query("SELECT * FROM `adminChat` ORDER BY `adcSubmitdate` DESC {$modLimit}");
while ($modData = mysql_fetch_assoc($modResult)) {
    ?>
				<div class="sep mar_left mar_right">
					#<?php 
    echo $modData["adcId"];
    ?>
 - <?php 
    echo gmdate($_auth["useDateFormat"], applyTimezone(strtotime($modData["adcSubmitDate"])));
    ?>
					- <?php 
    echo getUserLink($modData["adcCreator"]);
    ?>
:
					<?php 
    echo formatText($modData["adcText"]);
    ?>
				</div>
				<?php 
}
mysql_free_result($modResult);
?>
			<div class="sep a_center">
				<?php 
iefixStart();
$commentName = "modMessage";
$commentNoOptions = true;
$commentRows = 8;
include INCLUDES . "mod_comment.php";
iefixEnd();
?>
Esempio n. 5
0
                redirect(url("view/" . $objid));
            }
        }
        ?>
		<form action="<?php 
        echo url(".", array("edit" => "keywords"));
        ?>
" method="post">
		<div class="header">
			<div class="header_title">
				<?php 
        echo _EDIT_SUBMISSION;
        ?>
				<div class="subheader">
					<?php 
        echo formatText($objData["objTitle"]);
        ?>
				</div>
			</div>
			<?php 
        if (isset($_POST["keywordList"])) {
            $defaultKeywords = $_POST["keywordList"];
        } else {
            $sql = "SELECT * FROM `objKeywords`" . dbWhere(array("objKobject" => $objid));
            $result = sql_query($sql);
            $idList = array();
            while ($rowData = mysql_fetch_assoc($result)) {
                $idList[] = $rowData["objKkeyword"];
            }
            $defaultKeywords = implode(" ", $idList);
        }
Esempio n. 6
0
function makeFloatingThumb($title, $src, $width, $height, $isMature, $isThumb, &$onmouseover, &$onmouseout)
{
    global $_addToFooter;
    $floaterId = generateId("thumbFloat");
    $title = strip_tags(formatText($title));
    $_addToFooter .= '<div id="' . $floaterId . '" class="floating_thumb" ' . 'style="width: ' . ($width + ($isThumb ? 6 : 0)) . 'px; height: ' . ($height + ($isThumb ? 6 : 0)) . 'px">' . getIMG($src, 'alt="' . $title . '" class="' . ($isThumb ? "thumb " : "") . ($isMature ? " mature" : "") . '" title="' . $title . '"') . '</div>' . "\n";
    $onmouseover = "current_floater = get_by_id('{$floaterId}'); this.onmousemove = move_to_element;";
    $onmouseout = "el=get_by_id('{$floaterId}'); if(el) { make_invisible('{$floaterId}'); current_floater = 0; }";
}
Esempio n. 7
0
					<div class="container2 notsowide" style="margin-bottom : 12px; padding : 0; overflow : hidden;">
						<div class="f_right a_center normaltext" style="margin : 8px;">
							<?php 
    echo $avatar;
    ?>
						</div>
						<div class="largetext" style="padding : 8px;">
							<b><?php 
    echo formatText($title, false, true);
    ?>
</b>
						</div>
						<div style="padding : 0 8px; min-height : 9em; max-height : 11em; position : relative;">
							<div>
								<?php 
    echo formatText($body);
    ?>
							</div>
							<div class="container" style="padding : 4px 8px; position : absolute; <?php 
    ?>
left : 0; bottom : 0; right : 0;">
								<a style="float : right;" href="<?php 
    echo $url;
    ?>
">
									<span class="button smalltext">
										<?php 
    echo _REPLY;
    ?>
									</span>
								</a>
Esempio n. 8
0
            $body = formatText($submission["reqmts"]);
            if ($projectinfo["numattachments"] > 0) {
                list($rc, $body) = ff_attachtoproject($projectinfo['id'], $body);
            }
            ?>
<div class=spec><?php 
            echo $body;
            ?>
</div>
<br>
<?php 
        }
        ?>
<b>Submission notes:</b><br>
<?php 
        echo formatText($submission['comments']);
        ?>
<table cellpadding=0 cellspacing=0>
<?php 
        foreach ($submission['files'] as $filekey => $file) {
            ?>
        <tr>
            <td><?php 
            echo htmlentities($file['filename']);
            ?>
</td>
            <td align=right>&nbsp;&nbsp;&nbsp;(<?php 
            echo htmlentities($file['filesize']);
            ?>
 bytes)</td>
            <td>&nbsp;&nbsp;&nbsp;<nobr><a href="displaysubmission.php/<?php 
Esempio n. 9
0
:</div>
							<?php 
    $script = "make_invisible('signature_current'); " . "make_invisible('signature_edit'); " . "make_visible('signature_change'); " . "return false;";
    $signatureEdit = '<div id="signature_edit">' . '(<a href="" onclick="' . $script . '">' . _EDIT . '</a>)</div>';
    if (trim($useData["useSignature"]) != "") {
        echo $signatureEdit;
    }
    ?>
						</td>
						<td>
							<div id="signature_current">
								<?php 
    if (trim($useData["useSignature"]) != "") {
        ?>
									<div class="container2"><?php 
        echo formatText($useData["useSignature"]);
        ?>
</div>
									<?php 
    } else {
        echo $signatureEdit;
    }
    ?>
							</div>
							<div id="signature_change" style="display: none">
								<div>
									<?php 
    iefixStart();
    $commentName = "useSignature";
    $commentDefault = $useData["useSignature"];
    $commentNoOptions = true;
Esempio n. 10
0
function showKeywordSubcat($keywords, $parentId = 0, $parentKeyName = "", $parentLastKeyName = "")
{
    global $requiredTabs, $firstKeywordId, $isInHeader, $previousFullname;
    $noSubcats = true;
    foreach ($keywords as $keyData) {
        if (isset($keyData["subcats"])) {
            $noSubcats = false;
            break;
        }
    }
    if ($parentLastKeyName != "") {
        writeKeywordData(KWD_APP_HEADER, array("caption" => getKeywordCaption($parentLastKeyName)));
    }
    foreach ($keywords as $keyData) {
        $tabid = generateId("");
        $nonSelectable = preg_match('/\\@$/', $keyData["keyWord"]);
        $keyData["keyWord"] = preg_replace('/\\@$/', "", $keyData["keyWord"]);
        $keyWord = htmlspecialchars($keyData["keyWord"]);
        if (!$firstKeywordId && $isInHeader) {
            $firstKeywordId = "kwcache_tab" . $tabid;
        }
        $nameArr = preg_split('/\\"/', $parentKeyName . $keyWord, -1, PREG_SPLIT_NO_EMPTY);
        $fullname = "'";
        $first = true;
        foreach ($nameArr as $name1) {
            if ($name1 == $keyWord) {
                continue;
            }
            $fullname .= ($first ? "" : ",") . getKeywordCaption($name1);
            $first = false;
        }
        $fullname .= "'";
        /*
        if($fullname == $previousFullname)
        	$fullname = "";
        else
        	$previousFullname = $fullname;
        */
        $keywordSpace = $parentId != 0 && !$noSubcats ? 1 : 0;
        // If it contains sub-keywords, display as tab.
        if (isset($keyData["subcats"])) {
            $params = array("keyword_space" => $keywordSpace, "id" => $tabid, "group" => $parentId, "target" => $keyData["keyid"], "caption" => getKeywordCaption($keyWord, formatText($keyData["keyDesc"])));
            if (!($parentId != 0 && !$nonSelectable)) {
                // If it's a root keyword or it's set as non-selectable, display as
                // simple tab.
                writeKeywordData(KWD_APP_TAB, $params);
            } else {
                // Otherwise, display as tab with a selectable keyword inside.
                writeKeywordData(KWD_APP_KEYWORD_TAB, array_merge($params, array("fullname" => $fullname)));
            }
        } else {
            // Otherwise, display as simple selectable keyword.
            writeKeywordData(KWD_APP_KEYWORD, array("keyword_space" => $keywordSpace, "id" => $keyData["keyid"], "caption" => getKeywordCaption($keyWord, formatText($keyData["keyDesc"])), "fullname" => $fullname));
        }
    }
    writeKeywordData(KWD_APP_CLEAR);
    if ($isInHeader) {
        writeKeywordData(KWD_APP_SWITCH);
        $isInHeader = false;
    }
    foreach ($keywords as $keyData) {
        $keyData["keyWord"] = preg_replace('/\\@$/', "", $keyData["keyWord"]);
        unset($requiredTabs[$keyData["keyid"]]);
        if (isset($keyData["subcats"])) {
            writeKeywordData(KWD_APP_OPEN, array("id" => $keyData["keyid"]));
            if ($keyData["keySubcat"] != 0) {
                writeKeywordData(KWD_APP_HLINE);
            }
            showKeywordSubcat($keyData["subcats"], $keyData["keyid"], $parentKeyName . htmlspecialchars($keyData["keyWord"]) . '"', $parentId != 0 ? htmlspecialchars($keyData["keyWord"]) : "");
            writeKeywordData(KWD_APP_CLOSE);
        }
    }
}
Esempio n. 11
0
" method="post">
                <input type="hidden" name="deleteSentMessage" value="1" />
				<div class="f_left mar_bottom">
                	<input type="checkbox" name="pmsid_<?php 
    echo $rowData["pmsid"];
    ?>
" />
					<a href="<?php 
    echo url("pm/read/" . $rowData["pmsid"]);
    ?>
">
						<?php 
    echo getIMG(url() . "images/emoticons/pmout.png");
    ?>
						<?php 
    echo formatText($rowData["pmsTitle"], false, true);
    ?>
					</a>
					<?php 
    echo _PM_FOR;
    ?>
					<?php 
    echo getUserLink($rowData["pmsPmUser"]);
    ?>
				</div>
				<div class="f_right mar_bottom a_right">
					<?php 
    echo date($_auth['useDateFormat'], applyTimezone(strtotime($rowData["pmsSubmitDate"])));
    ?>
				</div>
				<div class="clear">&nbsp;</div>
Esempio n. 12
0
:</div>
				<?php 
$script = "make_invisible('profile_current'); " . "make_invisible('profile_edit'); " . "make_visible('profile_change'); " . "return false;";
$profileEdit = '<div id="profile_edit">' . '(<a href="" onclick="' . $script . '">' . _EDIT . '</a>)</div>';
if (trim($_auth["useProfile"]) != "") {
    echo $profileEdit;
}
?>
			</td>
			<td>
				<div id="profile_current">
					<?php 
if (trim($_auth["useProfile"]) != "") {
    ?>
						<div class="container2"><?php 
    echo formatText($_auth["useProfile"]);
    ?>
</div>
						<?php 
} else {
    echo $profileEdit;
}
?>
				</div>
				<div id="profile_change" style="display: none">
					<div>
						<?php 
iefixStart();
$commentName = "useProfile";
$commentDefault = $_auth["useProfile"];
$commentNoOptions = true;
Esempio n. 13
0
 //normally we could use a write-only lock 'c', but on Windows you can't read the file when write-locked!
 $f = fopen("{$FILE}.rss", 'r+');
 flock($f, LOCK_EX);
 //we have to read the XML using the file handle that's locked because in Windows, functions like
 //`get_file_contents`, or even `simplexml_load_file`, won't work due to the lock
 $xml = simplexml_load_string(fread($f, filesize("{$FILE}.rss"))) or (require FORUM_LIB . 'error_xml.php');
 if (!(NAME == $xml->channel->item[0]->author && formatText(TEXT, $xml) == $xml->channel->item[0]->description && !$xml->channel->xpath('category[.="locked"]'))) {
     //where to?
     $page = (count($thread) + 1) % FORUM_POSTS == 1 ? floor((count($thread) + 1) / FORUM_POSTS) : ceil((count($thread) + 1) / FORUM_POSTS);
     $url = FORUM_URL . url('thread', PATH_URL, $FILE, $page) . '#' . base_convert(microtime(), 10, 36);
     //re-template the whole thread:
     $rss = new DOMTemplate(file_get_contents(FORUM_LIB . 'rss-template.xml'));
     $rss->set(array('/rss/channel/title' => $xml->channel->title, '/rss/channel/link' => FORUM_URL . url('thread', PATH_URL, $FILE)))->remove(array('/rss/channel/category' => !$xml->channel->xpath('category[.="locked"]')));
     //template the new reply first
     $items = $rss->repeat('/rss/channel/item');
     $items->set(array('./title' => sprintf(THEME_RE, count($xml->channel->item), $xml->channel->title), './link' => $url, './author' => NAME, './pubDate' => gmdate('r'), './description' => formatText(TEXT, $xml)))->remove('./category')->next();
     //copy the remaining replies across
     foreach ($xml->channel->item as $item) {
         $items->set(array('./title' => $item->title, './link' => $item->link, './author' => $item->author, './pubDate' => $item->pubDate, './description' => $item->description))->remove(array('./category' => !$item->xpath('./category')))->next();
     }
     //write the file: first move the write-head to 0, remove the file's contents, and then write new one
     rewind($f);
     ftruncate($f, 0);
     fwrite($f, $rss->html());
 } else {
     //if a double-post, link back to the previous post
     $url = $xml->channel->item[0]->link;
 }
 //close the lock / file
 flock($f, LOCK_UN);
 fclose($f);
Esempio n. 14
0
<?php

set_time_limit(0);
error_reporting(E_ALL);
define('NO_SESSION', true);
require_once '../../global.php';
// French
$data_fr = loadDescription('D:/Games/data/french/idnum2itemdesctable.txt');
// English (not yet done by fRO? Oo)
//$data_en = loadDescription('D:/Games/data/english/idnum2itemdesctable.txt');
// Import French
foreach ($data_fr as $ID => $lines) {
    echo '[FR] update #' . $ID . '<br />';
    $text = formatText($lines);
    Framework::getDb()->query("UPDATE item_db SET description_fr = '" . esc($text) . "' WHERE id = '" . esc($ID) . "'");
}
// Import english
/*
foreach ($data_en as $ID => $lines) {
	echo '[EN] update #' . $ID . '<br />';
	$text = implode("\n", $lines);
	Framework::getDb()->query("UPDATE item_db SET description_en = '" . esc($text) . "' WHERE id = '" . esc($ID) . "'");
}
*/
exit('done');
function loadDescription($filepath)
{
    $data = array();
    $lines = file($filepath);
    $currentID = null;
    foreach ($lines as $line) {
Esempio n. 15
0
        $entries[] = $jouData;
    }
    $togo = 8;
    foreach ($entries as $entry) {
        iefixStart();
        ?>
				<div class="f_left mar_bottom">
					<a href="<?php 
        echo url("announcement/" . $cluid . "/" . $entry["jouid"]);
        ?>
">
					<?php 
        echo getIMG(url() . "images/emoticons/journal.png");
        ?>
					<?php 
        echo formatText($entry["jouTitle"]);
        ?>
					</a>
				</div>
				<div class="f_right mar_bottom">
					<?php 
        echo gmdate($_auth["useDateFormat"], applyTimezone(strtotime($entry["jouSubmitDate"])));
        ?>
				</div>
				<div class="clear">&nbsp;</div>
				<?php 
        iefixEnd();
        $togo--;
        if ($togo == 0) {
            break;
        }
Esempio n. 16
0
function builtMessage($allData, $sent = false)
{
    $output = '';
    foreach ($allData as $message) {
        $name = $message->sender_screen_name;
        $imgurl = $message->sender->profile_image_url;
        $date = formatDate($message->created_at);
        $text = formatText($message->text);
        $output .= '<li><span class="st_author">';
        $output .= '<a href="javascript:void(0)"><img src="' . $imgurl . '" title="' . $name . '" /></a></span>';
        $output .= '<span class="st_body"><span class="status_id">' . $message->id . '</span>';
        $output .= '<span class="status_word"><a class="user_name" href="javascript:void(0)">' . $name . '</a>' . $text . '</span><span class="status_info">';
        if (!$sent) {
            $output .= '<a class="msg_replie_btn" href="javascript:void(0)">回复</a>';
        } else {
            $output .= '<a class="delete_btn" href="javascript:void(0)">删除</a>';
        }
        $output .= '<span class="date">' . $date . '</span></span></span></li>';
    }
    return $output;
}
Esempio n. 17
0
    header('location: error.php');
}
$empty = count($messages) == 0 ? true : false;
$error = $messages->errors;
if ($error) {
    echo "<div id=\"error\">应用权限不够,请访问<a href=\"https://dev.twitter.com/apps\">https://dev.twitter.com/apps</a>,将应用的权限设置为\"Read, Write and Direct Messages\"。</div>";
} else {
    if ($empty) {
        echo "<div id=\"empty\">此页无消息</div>";
    } else {
        $output = '<ol class="timeline" id="allTimeline">';
        foreach ($messages as $message) {
            $name = $message->sender_screen_name;
            $imgurl = $message->sender->profile_image_url;
            $date = formatDate($message->created_at);
            $text = formatText($message->text);
            $output .= "\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<span class=\"status_author\">\n\t\t\t\t\t\t\t<a href=\"user.php?id={$name}\" target=\"_blank\"><img src=\"{$imgurl}\" title=\"{$name}\" /></a>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span class=\"status_body\">\n\t\t\t\t\t\t\t<span class=\"status_id\">{$message->id} </span>\n\t\t\t\t\t\t\t<span class=\"status_word\"><a class=\"user_name\" href=\"user.php?id={$name}\">{$name} </a> {$text} </span>\n\t\t\t\t\t\t\t<span class=\"status_info\">\n\t\t\t\t";
            if (!$isSentPage) {
                $output .= "<a class=\"msg_replie_btn\" href=\"message.php?id={$name}\">回复</a>";
            } else {
                $output .= "<a class=\"delete_btn\" href=\"a_del.php?id={$message->id}&t=m\">删除</a>";
            }
            $output .= "\t\t<span class=\"date\">{$date}</span>\n\t\t\t\t\t\t    </span>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</li>\n\t\t\t\t";
        }
        $output .= "</ol><div id=\"pagination\">";
        if ($isSentPage) {
            if ($p > 1) {
                $output .= "<a href=\"message.php?t=sent&p=" . ($p - 1) . "\">上一页</a>";
            }
            if (!$empty) {
                $output .= "<a href=\"message.php?t=sent&p=" . ($p + 1) . "\">下一页</a>";
Esempio n. 18
0
                <nobr><b onClick="folder('browse-<?php 
        echo $project["id"];
        ?>
')"><?php 
        echo htmlentities($project['name']);
        ?>
</b> <a href="<?php 
        echo projurl($project["id"]);
        ?>
">[go]</a></nobr>
                <div id="browse-<?php 
        echo $project["id"];
        ?>
-div" class=folded>
                    <?php 
        echo formatText(ereg_replace("\n.*", "", $project["reqmts"]));
        ?>
                    <p>
                    <b>Bounty:</b> <nobr><?php 
        echo htmlentities(format_money($project["bounty"]));
        ?>
</nobr>
                    <?php 
        if (ereg("[1-9]", $project["bounty"]) && !ereg("^[0-9]*{$GLOBALS['pref_currency']}\$", $project["bounty"])) {
            ?>
<nobr>(Approx. <?php 
            echo htmlentities(convert_money($project["bounty"]));
            ?>
)</nobr><?php 
        }
        ?>
Esempio n. 19
0
								<td class="a_right"><b><?php 
        echo _ABUSE_RULE;
        ?>
</b>:</td>
								<td><?php 
        echo formatText($abuData["abuRule"]);
        ?>
</td>
							</tr>
							<tr class="v_top">
								<td class="a_right"><b><?php 
        echo _ABUSE_REASON;
        ?>
</b>:</td>
								<td><?php 
        echo formatText($abuData["abuReason"]);
        ?>
</td>
							</tr>
							<?php 
    }
    ?>
					</table>
					<div class="a_right">
						<a href="<?php 
    echo url("abuse/" . $abuData["abuid"]);
    ?>
">
							<?php 
    echo _ABUSE_STATUS;
    ?>
Esempio n. 20
0
    $ignoreList .= "[u=" . $twtData["useUsername"] . "] ";
    $first = false;
}
mysql_free_result($twtResult);
if ($ignoreList != "") {
    echo $ignoreEdit;
}
?>
			</td>
			<td width="100%">
				<div id="ignore_current">
					<?php 
if ($ignoreList != "") {
    ?>
						<div class="container2"><?php 
    echo formatText($ignoreList);
    ?>
</div>
						<?php 
} else {
    echo $ignoreEdit;
}
?>
					<div class="sep">
						<?php 
echo _SET_TWIT_EXPLAIN;
?>
					</div>
				</div>
				<div id="ignore_change" style="display: none">
					<div>
Esempio n. 21
0
    }
}
if ($_COOKIE['autoscroll'] == 'false' || $p == 1) {
    $t = getTwitter();
    $user = $t->veverify();
    if ($user === false) {
        header('location: error.php?code=' . $t->http_code);
        exit;
    }
    $empty = count($user) == 0 || !isset($user->status) || $user->status->text == '';
    if ($empty) {
        echo "<div id=\"currently\">\n\t\t\t\t<span id=\"full_status\"><strong >Latest:</strong></span>\n\t\t\t\t<span id=\"latest_status\">\n\t\t\t\t<span id=\"latest_text\">\n\t\t\t\t<span class=\"status-text\">What's happening?</span>\n\t\t\t\t<span class=\"full-text\" style=\"display:none\">What's happening?</span>\n\t\t\t\t<span class=\"entry-meta\" id=\"latest_meta\"></span>\n\t\t\t\t<span class=\"entry-meta\" id=\"full_meta\"></span>\n\t\t\t\t</span>\n\t\t\t\t</span>\n\t\t\t\t</div>";
    } else {
        $status = $user->status;
        $date = format_time($status->created_at);
        $text = formatText($status->text);
        $output = "\n\t\t\t\t\t<div id=\"currently\">\n\t\t\t\t\t<span id=\"full_status\" title=\"Click to view the full tweet\"><strong>Latest:</strong></span>\n\t\t\t\t\t<span id=\"latest_status\">\n\t\t\t\t\t<span id=\"latest_text\">\n\t\t\t\t\t<span class=\"status-text\">" . $text . "</span>\n\t\t\t\t\t<span class=\"full-text\" style=\"display:none\">" . $text . "</span>\n\t\t\t\t\t<span class=\"entry-meta\" id=\"latest_meta\"><a href=\"status.php?id={$status->id_str}\" id=\"{$date}\" target=\"_blank\">" . date('Y-m-d H:i:s', $date) . "</a></span>\n\t\t\t\t\t<span class=\"entry-meta\" id=\"full_meta\" style=\"display:none\"><a href=\"status.php?id={$status->id_str}\" id=\"{$date}\" target=\"_blank\">" . date('Y-m-d H:i:s', $date) . "</a></span>\n\t\t\t\t\t</span>\n\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t";
        echo $output;
    }
}
?>
<div id="tweeting_controls">
	<a class="a-btn btn-disabled" id="tweeting_button" tabindex="2" href="#" title="Ctrl/⌘+Enter also works!"><span class="fa fa-send-o"></span></a>
</div>
	
	<div id="func_set" style="left:<?php 
echo $title == 'Updates' || $title == 'Home' ? '271' : '298';
?>
px">
	
	<a class="func_btn fa fa-link" href="javascript:shortUrlDisplay();" title="Shorten URL"></a>
Esempio n. 22
0
function tpTimeline($statuses, $argsArr = false)
{
    $output = '';
    if (isset($argsArr['id'])) {
        $output .= '<div id="' . $argsArr['id'] . '">';
    }
    $output .= '<ol class="timeline">';
    foreach ($statuses as $status) {
        $is_rt = isset($status->retweeted_status) && isset($_COOKIE['rt_style']) && $_COOKIE['rt_style'] == 1;
        $username = getEncryptCookie('twitese_name');
        if ($is_rt) {
            if (isset($argsArr['show_rtid'])) {
                $status_id = $status->id_str;
            } else {
                $status_id = $status->retweeted_status->id_str;
            }
            $rtsign = 'rt_sign';
            $user = $status->retweeted_status->user;
            $rtuser = $status->user;
            $date = formatDate($status->created_at);
            $rawdate = formatDate($status->created_at, true);
            $text = formatText($status->retweeted_status->text);
            $rawtext = $status->retweeted_status->text;
        } else {
            $user = $status->user;
            $date = formatDate($status->created_at);
            $rawdate = formatDate($status->created_at, true);
            $text = formatText($status->text);
            $rawtext = $status->text;
            $status_id = $status->id_str;
            $rtsign = '';
        }
        if (!isset($argsArr['is_mention']) && strpos($rawtext, "@{$username}") > -1) {
            $output .= "<li class=\"mention\">";
        } else {
            $output .= "<li>";
        }
        $output .= "\r\n\t\t\t\t\t<span class=\"status_author\">\r\n\t\t\t\t\t\t<a href=\"user.php?id={$user->screen_name}\" target=\"_blank\"><img src=\"{$user->profile_image_url}\" title=\"{$user->screen_name}\" /></a>\r\n\t\t\t\t\t</span>\r\n\t\t\t\t\t<span class=\"status_body\">\r\n\t\t\t\t\t\t<span class=\"status_id\">{$status_id}</span>\r\n\t\t\t\t\t\t<span class=\"status_word\"><a class=\"user_name {$rtsign}\" href=\"user.php?id={$user->screen_name}\" target=\"_blank\">{$user->screen_name}</a> {$text} </span>\r\n\t\t\t\t\t\t";
        if ($shorturl = unshortUrl($status->text)) {
            $output .= "<span class=\"unshorturl\">{$shorturl}</span>";
        }
        $output .= "<span class=\"status_info\">";
        if (!isset($argsArr['hide_replie'])) {
            $output .= "<a class=\"replie_btn\" href=\"a_reply.php?id={$status->id_str}\">回复</a>";
        }
        if (!isset($argsArr['hide_rt'])) {
            $output .= "<a class=\"rt_btn\" href=\"a_rt.php?id={$status->id_str}\">回推</a>";
        }
        if (!isset($argsArr['hide_ort']) && $user->screen_name != $username) {
            $output .= "<a class=\"ort_btn\" href=\"a_ort.php?id={$status->id_str}\">官方RT</a>";
        }
        if (!isset($argsArr['hide_favor'])) {
            $output .= "<a class=\"favor_btn\" href=\"a_favor.php?id={$status->id_str}\">收藏</a>";
        }
        if ($user->screen_name == $username || isset($argsArr['show_del'])) {
            $output .= "<a class=\"delete_btn\" href=\"a_del.php?id={$status->id_str}&t=s\">删除</a>";
        }
        if ($status->in_reply_to_status_id_str) {
            $output .= "<span class=\"in_reply_to\"> <a href=\"status.php?id={$status->in_reply_to_status_id_str} \">对 {$status->in_reply_to_screen_name} 的回复</a></span>";
        }
        if ($is_rt) {
            $output .= "RT by <a href=\"user.php?id={$rtuser->screen_name}\">{$rtuser->screen_name}</a>";
        } else {
            if (isset($status->retweeted_status)) {
                $output .= "RT from <a href=\"user.php?id=" . $status->retweeted_status->user->screen_name . "\">" . $status->retweeted_status->user->screen_name . "</a>";
            }
        }
        $output .= "\t\t\r\n\t\t\t \t\t\t\t<span class=\"source\">通过 {$status->source}</span>\r\n\t\t\t\t\t\t\t<span class=\"date\" title=\"{$rawdate}\"><a href=\"status.php?id={$status->id_str}\" target=\"_blank\">{$date}</a></span>\r\n\t\t\t\t\t    </span>\r\n\t\t\t\t\t</span>\r\n\t\t\t\t</li>\r\n\t\t\t";
    }
    $output .= "</ol>";
    if (isset($argsArr['id'])) {
        if ($argsArr['id'] == 'allTimeline') {
            $output .= '<input type="button" value="更多" id="more_home" class="more_btn" />';
        } else {
            if ($argsArr['id'] == 'allReplies') {
                $output .= '<input type="button" value="更多" id="more_replie" class="more_btn" />';
            }
        }
        $output .= '</div>';
    }
    echo $output;
}
Esempio n. 23
0
$modResult = sql_query("SELECT * FROM `adminNotes` ORDER BY `admSubmitDate` DESC {$modLimit}");
while ($modData = mysql_fetch_assoc($modResult)) {
    ?>
				<div class="sep mar_left mar_right">
					#<?php 
    echo $modData["admid"];
    ?>
 - <?php 
    echo gmdate($_auth["useDateFormat"], applyTimezone(strtotime($modData["admSubmitDate"])));
    ?>
					- <?php 
    echo getUserLink($modData["admCreator"]);
    ?>
:
					<?php 
    echo formatText($modData["admNote"]);
    ?>
				</div>
				<?php 
}
mysql_free_result($modResult);
?>
			<div class="sep a_center">
				<?php 
iefixStart();
$commentName = "modMessage";
$commentNoOptions = true;
$commentRows = 8;
include INCLUDES . "mod_comment.php";
iefixEnd();
?>
Esempio n. 24
0
   ====================================================================================================================== */
//has the user submitted a new thread?
//(`AUTH` will be true if username and password submitted and correct, `TITLE` and `TEXT` are checked to not be blank)
if (CAN_POST && AUTH && TITLE && TEXT) {
    //the file on disk is a simplified version of the title; see 'lib/functions.php' for `safeTransliterate`
    $translit = safeTransliterate(TITLE);
    //if a thread already exsits with that name, append a number until an available filename is found.
    //we also check for directories with the same name so as to avoid problematic Apache behaviour
    $c = 0;
    do {
        $file = $translit . ($c++ ? '_' . ($c - 1) : '');
    } while (file_exists("{$file}") || file_exists("{$file}.rss"));
    //write out the new thread as an RSS file:
    $post_id = base_convert(microtime(), 10, 36);
    $rss = new DOMTemplate(file_get_contents(FORUM_LIB . 'rss-template.xml'));
    $rss->set(array('/rss/channel/title' => TITLE, '/rss/channel/link' => FORUM_URL . url(PATH_URL, $file), '/rss/channel/item/title' => TITLE, '/rss/channel/item/link' => FORUM_URL . url(PATH_URL, $file) . '#' . $post_id, '/rss/channel/item/author' => NAME, '/rss/channel/item/pubDate' => gmdate('r'), '/rss/channel/item/description' => formatText(TEXT, FORUM_URL . url(PATH_URL, $file, 1), $post_id)))->remove('//category');
    file_put_contents("{$file}.rss", $rss) or (require FORUM_LIB . 'error_permissions.php');
    //regenerate the folder's RSS file
    indexRSS();
    //redirect to newley created thread
    header('Location: ' . FORUM_URL . url(PATH_URL, $file), true, 303);
    exit;
}
/* ======================================================================================================================
   template the page
   ====================================================================================================================== */
//first load the list of threads in the forum so that we can determine the number of pages and validate the page number,
//the thread list won't be used until further down after templating begins
if ($threads = preg_grep('/\\.rss$/', scandir('.'))) {
    //sort the list of threads in the forum
    array_multisort(array_map(FORUM_LOCK == 'news' ? 'filectime' : 'filemtime', $threads), SORT_DESC, $threads);
Esempio n. 25
0
    ?>
		<div class="container2 mar_bottom">
		<?php 
    iefixStart();
    ?>
			<div class="f_right mar_left mar_bottom">
				<?php 
    echo getClubIcon($rowData["cluid"]);
    ?>
			</div>
			<div class="largetext mar_bottom">
				<b><a href="<?php 
    echo url("club/" . $rowData["cluid"]);
    ?>
"><?php 
    echo $rowData["cluName"];
    ?>
</a></b>
			</div>
			<div>
				<?php 
    echo formatText($rowData["cluDesc"]);
    ?>
			</div>
			<div class="clear">&nbsp;</div>
		<?php 
    iefixEnd();
    ?>
		</div>
		<?php 
}
Esempio n. 26
0
    if ($user->location) {
        echo "<li><span>Location</span> {$user->location}</li>";
    }
    ?>
		<?php 
    if ($expanded_url and strlen($expanded_url) > 20) {
        echo '<li><span>Web</span> <a href="' . $expanded_url . '" target="_blank">' . substr($expanded_url, 0, 20) . '...</a></li>';
    } else {
        if ($expanded_url and strlen($expanded_url) <= 20) {
            echo '<li><span>Web</span> <a href="' . $expanded_url . '" target="_blank">' . $expanded_url . '</a></li>';
        }
    }
    ?>
		<?php 
    if ($user->description) {
        echo "<li><span>Bio</span> " . formatText($user->description) . "</li>";
    }
    ?>
		</ul>
	<?php 
}
?>
	<ul id="user_stats">
		<li>
			<a href="friends.php">
				<span class="count"><?php 
echo getCookie('friends_count');
?>
</span>
				<span class="label">following</span>
			</a>
Esempio n. 27
0
//(`AUTH` will be true if username and password submitted and correct, `TITLE` and `TEXT` are checked to not be blank)
if (CAN_POST && AUTH && TITLE && TEXT) {
    //the file on disk is a simplified version of the title:
    $translit = preg_replace(array('/[^_a-z0-9-]/i', '/_{2,}/'), '_', str_replace(array("'", "`", "^", "~", "'", '"'), '', strtolower(iconv('UTF-8', 'US-ASCII//IGNORE//TRANSLIT', TITLE))));
    //old iconv versions and certain inputs may cause a nullstring. don't allow a blank filename
    if (!$translit) {
        $translit = '_';
    }
    //if a thread already exsits with that name, append a number until an available filename is found
    $c = 0;
    do {
        $file = $translit . ($c++ ? '_' . ($c - 1) : '');
    } while (file_exists("{$file}.rss"));
    //write out the new thread as an RSS file:
    $rss = new DOMTemplate(FORUM_ROOT . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'rss-template.xml');
    $rss->set(array('/rss/channel/title' => TITLE, '/rss/channel/link' => FORUM_URL . PATH_URL . $file, '/rss/channel/item/title' => TITLE, '/rss/channel/item/link' => FORUM_URL . PATH_URL . "{$file}#" . base_convert(microtime(), 10, 36), '/rss/channel/item/author' => NAME, '/rss/channel/item/pubDate' => gmdate('r'), '/rss/channel/item/description' => formatText(TEXT)))->remove('//category');
    file_put_contents("{$file}.rss", $rss->html()) or die("Failed to save thread. Folder permissions may be incorrect.");
    //regenerate the folder's RSS file
    indexRSS();
    //redirect to newley created thread
    header('Location: ' . FORUM_URL . PATH_URL . $file, true, 303);
    exit;
}
/* ======================================================================================================================
   template the page
   ====================================================================================================================== */
//first load the list of threads in the forum so that we can determine the number of pages and validate the page number,
//the thread list won't be used until further down after templating begins
if ($threads = preg_grep('/\\.rss$/', scandir('.'))) {
    //order by last modified date
    array_multisort(array_map('filemtime', $threads), SORT_DESC, $threads);
Esempio n. 28
0
<?php

if (!isLoggedIn()) {
    echo _REQUIRE_LOGIN;
    return;
}
if (!atLeastSModerator()) {
    echo formatText("Sorry, the Helpdesk is currently in development. If you have a request, please send it to [c=1].");
    return;
}
if (isset($_POST["summary"])) {
    sql_values(array("hlpSummary" => $_POST["summary"], "hlpCategory" => $_POST["category"], "hlpSubmitDate!" => "NOW()", "hlpSubmitter" => $_auth["useid"], "hlpReferenceType" => $_POST["referenceType"], "hlpReferenceId" => $_POST["referenceID"], "hlpOwner" => getRequestRefOwner($_POST["referenceType"], $_POST["referenceID"])));
    $helpdeskItem = sql_insert("helpdesk");
    addRequestDetail($helpdeskItem, "publicDetail", "publicFile", "all");
    addRequestDetail($helpdeskItem, "privateDetail", "privateFile", "submitter");
    redirect(url("helpdesk"));
}
$requestCat = strtolower($_cmd[2]);
$requestRef = strtolower($_cmd[3]);
$requestRefId = intval($_cmd[4]);
$cats = array();
$catsResult = sql_rowset("helpdeskCats");
while ($catsData = sql_next($catsResult)) {
    $cats[$catsData["hdcid"]] = array("name" => $catsData["hdcName"], "type" => $catsData["hdcType"]);
}
sql_free($catsResult);
?>
<div class="header">
	Add a Request
</div>
<form action="<?php 
Esempio n. 29
0
	<div class="ui2-layout-bg ui2-section-closed"><?php 
    echo _MOST_RECENT;
    ?>
</div>
	<?php 
    putSidebarMostRecent();
}
if (isLoggedIn() && trim($_auth["useSidebar"]) != "") {
    ?>
	<div class="ui2-layout-bg ui2-section-closed"><?php 
    echo _PERSONAL_NOTES;
    ?>
</div>
	<div class="ui2-section-body">
		<?php 
    echo formatText($_auth["useSidebar"]);
    ?>
	</div>
	<?php 
}
if (!isset($_auth["useSidebarThumbs"]) || $_auth["useSidebarThumbs"]) {
    ?>
	<div class="ui2-layout-bg ui2-section-closed" style="margin-bottom : 8px;"><?php 
    echo _RANDOM;
    ?>
</div>
	<?php 
    putSidebarRandom();
}
putSidebarPoll();
?>
Esempio n. 30
0
$result = sql_query("SELECT `useid`,`useUsername` FROM `users`, `useExtData` " . "WHERE `useUsername` = '" . addslashes($_cmd[1]) . "' AND `useid` = `useEid` {$whereGuest} LIMIT 1");
if (!($useData = mysql_fetch_assoc($result))) {
    include INCLUDES . "p_notfound.php";
    return;
}
$useUsername = strtolower($useData["useUsername"]);
$_pollUser = $useData["useid"];
$_documentTitle = $useData["useUsername"] . ": " . _SUBMISSIONS;
$title = _SUBMISSIONS;
$folid = 0;
if ($_cmd[2] != "") {
    $folResult = sql_query("SELECT * FROM `folders`" . dbWhere(array("folCreator" => $useData["useid"], "folIdent" => $_cmd[2])));
    if ($folData = mysql_fetch_assoc($folResult)) {
        $folid = $folData["folid"];
        $_documentTitle .= ": " . strip_tags(formatText($folData["folName"]));
        $title .= ": " . formatText($folData["folName"]);
    } else {
        redirect(url("gallery/" . strtolower($useData["useUsername"])));
    }
}
?>
<div class="header">
	<div class="f_right mar_left a_center normaltext">
		<?php 
echo getUserAvatar("", $useData["useid"], true);
?>
	</div>
	<div class="f_left header_title">
		<?php 
echo $useData["useUsername"];
?>