本文整理汇总了PHP中sqlcache函数的典型用法代码示例。如果您正苦于以下问题:PHP sqlcache函数的具体用法?PHP sqlcache怎么用?PHP sqlcache使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sqlcache函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: writebody
function writebody()
{
global $db, $domain, $sitename, $domain, $template, $gamesfolder, $thumbsfolder, $limitboxgames, $seo_on, $blogentriesshown, $enabledcode_on, $comments_on, $directorypath, $autoapprovecomments, $gamesonpage, $abovegames, $belowgames, $showwebsitelimit, $supportemail, $showblog, $blogentriesshown, $blogcharactersshown, $blogcommentpermissions, $blogcommentsshown, $blogfollowtags, $blogcharactersrss, $usrdata, $userid;
$count = 0;
$baser2 = "SELECT * FROM fas_categories where active='1'";
$baser1 = sqlcache('mainpagecats', $cachelife, $baser2);
echo '<table width=\'720\' border=\'0\' cellpadding=\'0\' cellspacing=\'0\' align=\'center\'>';
foreach ($baser1 as $row) {
$categorynamev = $row['name'];
$categorynameu = preg_replace('#\\W#', '-', $categorynamev);
if ($seo_on == 1) {
$categoryurl = '' . $domain . '/browse/' . $row['ID'] . '-' . $categorynameu . '.html';
} else {
$categoryurl = '' . $domain . '/index.php?action=browse&ID=' . $row['ID'] . '';
}
echo '<tr>
<td width=\'720\' valign=\'top\'>
<table width=\'720\' border=\'0\'><div align=\'center\'>
<tr>
<td class=\'header\'><a href=\'' . $categoryurl . '\'>' . $categorynamev . ' Games</a></td>
</tr>
<tr>
<td>';
echo '<table><tr> <td width=\'720\' align=\'center\' class=\'content\'><div align=\'center\'>
';
$ir = $db->query(sprintf('SELECT * FROM fas_games WHERE category=\'%u\' ORDER BY rand() LIMIT 0,' . $limitboxgames . '', $row['ID']));
while ($row = $db->fetch_row($ir)) {
$gamename = preg_replace('#\\W#', '-', $row['name']);
if ($seo_on == 1) {
$playlink = '' . $domain . '/play/' . $row['ID'] . '-' . $gamename . '.html';
} else {
$playlink = '' . $domain . '/index.php?action=play&ID=' . $row['ID'] . '';
}
echo '
<a href=\'' . $playlink . '\' title=\'' . $row['name'] . '\'>
';
if ($row['type'] == 1) {
echo ' <img src=\'' . $domain . '/' . $thumbsfolder . '/' . $row['thumb'] . '\' title=\'' . $row['name'] . '\' alt=\'' . $row['name'] . '\' width=\'80\' height=\'80\' border=\'0\' alt=\'' . $row['name'] . '\'>';
} else {
echo ' <img src=\'' . $row['thumburl'] . '\' title=\'' . $row['name'] . '\' alt=\'' . $row['name'] . '\' width=\'80\' height=\'80\' border=\'0\' alt=\'' . $row['name'] . '\'>';
}
echo '
</a>
';
}
echo '</div>';
echo ' </table>';
echo ' </td>
</tr>
</table>
</td>
</tr>';
}
echo "</table>";
$pgname = 'Your resource for fantastic games!';
}
示例2: writebody
function writebody()
{
global $db, $domain, $suserid, $cachelife, $ir, $ir2, $r, $cname, $sponsor, $ads1, $ads2, $ads3, $bannersleft, $headerspace, $footerspace, $ID, $sitename, $domain, $template, $gamesfolder, $thumbsfolder, $limitboxgames, $seo_on, $blogentriesshown, $enabledcode_on, $comments_on, $fbcomments_on, $taf_on, $directorypath, $autoapprovecomments, $gamesonpage, $abovegames, $belowgames, $showwebsitelimit, $supportemail, $showblog, $blogentriesshown, $blogcharactersshown, $blogcommentpermissions, $blogcommentsshown, $blogfollowtags, $blogcharactersrss, $usrdata, $userid, $avatar_on, $gender_on, $aimg, $fimg, $mimg, $seoheading, $seotext, $showpages, $slogan;
echo '<div id="container">
<div id="content-container">
<div id="side">';
include "includes/blocks.php";
echo '</div>
<div id="content">
<div class="content_nav">Latest Games</div>';
$max = $gamesonpage;
if (!isset($_GET['page'])) {
$show = '1';
} else {
$show = clean($_GET['page']);
}
$limits = ($show - 1) * $max;
$sqltitle = 'homepage';
$baseir2 = "SELECT * FROM fas_games WHERE active='1' ORDER BY ID DESC LIMIT " . $limits . "," . $max;
$baseir1 = sqlcache($sqltitle, $cachelife, $baseir2);
if (isset($baseir1)) {
foreach ($baseir1 as $row1) {
$gamename = preg_replace('#\\W#', '-', $row1['name']);
if ($seo_on == 1) {
$playlink = '/play/' . $row1['ID'] . '-' . $gamename . '.html';
} else {
$playlink = '/index.php?action=play&ID=' . $row1['ID'] . '';
}
echo '<div id="game_holder"><a href=\'' . $playlink . '\'>';
if ($row1['type'] == 1) {
echo '<div align="center"><img src=\'/' . $thumbsfolder . '/' . $row1['thumb'] . '\' width=\'90\' height=\'90\' alt= \'' . $row1['name'] . '\' title= \'' . $row1['name'] . '\' border=\'0px\' class=\'game_img\' /></a><br />';
} else {
echo '<div align="center"><img src=\'' . $row1['thumburl'] . '\' width=\'90\' height=\'90\' alt= \'' . $row1['name'] . '\' title= \'' . $row1['name'] . '\' border=\'0px\' class=\'game_img\' /></a><br />';
}
echo '</div></div>';
}
} else {
echo '<div align="center">
No games have been added yet!
</div>';
}
echo '</div></div></div>';
$pgname = 'Your resource for fantastic games!';
}
示例3: writebody
function writebody()
{
global $db, $domain, $sitename, $cachelife, $template, $gamesfolder, $thumbsfolder, $limitboxgames, $seo_on, $blogentriesshown, $enabledcode_on, $comments_on, $directorypath, $autoapprovecomments, $gamesonpage, $abovegames, $belowgames, $showwebsitelimit, $supportemail, $showblog, $blogentriesshown, $blogcharactersshown, $blogcommentpermissions, $blogcommentsshown, $blogfollowtags, $blogcharactersrss, $usrdata, $userid;
$name = clean($_GET['name']);
$show = clean($_GET['page']);
$show = abs((int) $show);
if (empty($show)) {
$show = 1;
}
$limits = ($show - 1) * $max;
$r2 = "SELECT * FROM fas_pageentries WHERE visible='1' order by title asc";
$sqltitle = "pagesmain";
$r1 = sqlcache($sqltitle, $cachelife, $r2);
echo '<table width=\'100%\' border=\'0\' align=\'center\'>
<tr>
<td colspan=\'2\' class=\'header\'>Pages</td>
</tr>';
//if(!$db->num_rows($r)){
//echo ' <tr>
// <td colspan=\'2\' class=\'content\'>There currently are no pages.</td>
// </tr>';
//}
echo '<tr>
<td valig=\'top\' class=\'content\' colspan=\'2\' class=\'content\'>';
foreach ($r1 as $in) {
$title = $in['title'];
$urltitle = str_replace(" ", "", $title);
$category = $in['category'];
$entryid = abs((int) $in['entryid']);
if ($seo_on == 1) {
$rburl = '' . $domain . '/pages/' . $entryid . '-' . $urltitle . '.html';
} else {
$rburl = '' . $domain . '/index.php?action=page&entryid=' . $entryid;
}
$body = $in['body'];
echo ' <a href=\'' . $rburl . '\' >' . $title . '</a><br>
';
}
echo "<p></td>\n\t\t\t</tr>\n</table>";
echo '<br /><br />';
}
示例4: writebody
function writebody()
{
global $db, $suserid, $pagetitle, $metatags, $metatitle, $metadescription, $entryid, $domain, $sitename, $cachelife, $template, $gamesfolder, $thumbsfolder, $limitboxgames, $seo_on, $blogentriesshown, $enabledcode_on, $comments_on, $directorypath, $autoapprovecomments, $gamesonpage, $abovegames, $belowgames, $showwebsitelimit, $supportemail, $showblog, $blogentriesshown, $blogcharactersshown, $blogcommentpermissions, $blogcommentsshown, $blogfollowtags, $blogcharactersrss, $usrdata, $userid;
$entryid = clean($_GET['entryid']);
$r3 = "SELECT * FROM fas_pageentries WHERE entryid='{$entryid}'";
$sqltitle = "pageenrty-" . $entryid;
$r1 = sqlcache($sqltitle, $cachelife, $r3);
foreach ($r1 as $r4) {
$title = $r4['title'];
$body = $r4['body'];
$author = $r4['author'];
$entrydate = $r4['entrydate'];
$displaydate = date('d-m-Y', $entrydate);
$visible = $r4['visible'];
$category = $r4['category'];
$tags = $r4['tags'];
}
// $chr_limit = 120;
// $bodystring = preg_replace("!(http:/{2}[\w\.]{2,}[/\w\-\.\?\&\=\#]*)!e", "'<a href=\"\\1\" title=\"\\1\" target=\"_blank\">'.(strlen('\\1')>=$chr_limit ? substr('\\1',0,$chr_limit).'$add':'\\1').'</a>'", $bodystring);
$bodystring = str_replace("[urlhead]", "<a href='http://", $body);
$bodystring = str_replace("[urlmid]", "'>", $bodystring);
$bodystring = str_replace("[urlend]", "</a>", $bodystring);
$bodystring = str_replace("[imghead]", "<img src='http://", $bodystring);
$bodystring = str_replace("[imgend]", "'>", $bodystring);
$bodystring = str_replace("[bhead]", "<b>", $bodystring);
$bodystring = str_replace("[bend]", "</b>", $bodystring);
$bodystring = str_replace("[p]", "<p>", $bodystring);
$bodystring = str_replace("\n\n", "<p>", $bodystring);
$bodystring = str_replace("\n", "<br />", $bodystring);
$body = str_replace("[br]", "<br>", $bodystring);
echo '<table width=\'100%\' border=\'0\' align=\'center\'>
<tr>
<td colspan=\'2\' class=\'header\'>' . $title . ' </td>
</tr>
<tr>
<td colspan=\'2\' class=\'content\'>' . $body . '</td>
</tr>
';
echo "</table>";
}
示例5: writebody
function writebody()
{
global $db, $cachelife, $domain, $sitename, $cachelife, $template, $gamesfolder, $thumbsfolder, $limitboxgames, $seo_on, $blogentriesshown, $enabledcode_on, $comments_on, $directorypath, $autoapprovecomments, $gamesonpage, $abovegames, $belowgames, $showwebsitelimit, $supportemail, $showblog, $blogentriesshown, $blogcharactersshown, $blogcommentpermissions, $blogcommentsshown, $blogfollowtags, $blogcharactersrss, $usrdata, $userid;
$ID = clean($_GET['ID']);
$ID = abs((int) $ID);
$name = clean($_GET['name']);
$max = $gamesonpage;
$show = clean($_GET['page']);
$show = abs((int) $show);
if (empty($show)) {
$show = 1;
}
$limits = ($show - 1) * $max;
$r = "SELECT * FROM fas_comments WHERE gameid='{$ID}' and approved ='1' order by date desc LIMIT " . $limits . ", " . $max;
$sqltitle = "gamecomments" . $show . "-" . $ID;
$totalres = mysql_result($db->query('SELECT COUNT(ID) AS total FROM fas_comments WHERE gameid=\'' . $ID . '\' and approved=\'1\' '), 0);
$totalpages = ceil($totalres / $max);
echo '<table width=\'100%\' border=\'0\' align=\'center\'>
<tr>
<td colspan=\'2\' class=\'header\'> Comments Left For ' . $name . ' </td>
</tr>';
$nr = mysql_query($r);
if (!$db->num_rows($nr)) {
echo ' <tr>
<td colspan=\'2\' class=\'content\'>There currently are no comments left for this game.</td>
</tr>';
} else {
$r4 = sqlcache($sqltitle, $cachelife, $r);
foreach ($r4 as $in) {
$comment = $in['comment'];
$commenter = abs((int) $in['commenter']);
$date = date('d-m-Y', $in['date']);
$nv1 = "SELECT * FROM fas_users WHERE userid='{$commenter}' limit 1 ";
$sqltitle = "userprofile-" . $commenter;
$nv3 = sqlcache($sqltitle, $cachelife, $nv1);
foreach ($nv3 as $nv2) {
$useridl = $nv2['userid'];
if (!$username) {
$username = "No longer a member";
}
if ($commenter == '0') {
$username = 'Guest';
} else {
$username = $nv2['username'];
}
if ($seo_on == 1) {
$urlp = '' . $domain . '/showprofile/' . $useridl . '.html';
} else {
$urlp = '' . $domain . '/index.php?action=showprofile&profile=' . $useridl;
}
if ($nv2['avatar'] == '1') {
$avatarfileurl = '<p><img src=\'' . $domain . '/avatars/' . $nv2['avatarfile'] . '\' height=\'100\' width=\'100\' border=\'0\'>';
} else {
$avatarfileurl = '';
}
echo ' <tr>
<td width=\'30%\' class=\'content\' style=\'padding:4px;\' valign=\'top\'><b>Posted By:</b> <a href="' . $urlp . '">' . $username . $avatarfileurl . '</a><p>
<small><i><b>Posted On:</b> ' . $date . '</i></small>
</td>
<td valig=\'top\' class=\'content\' valign=\'top\'>' . $in['comment'] . '</td>
</tr>
<tr>
<td width=\'100%\' colspan=\'2\' class=\'content\'> </td>
</tr>
';
}
}
}
echo "</table>";
echo 'Pages: ';
for ($i = 1; $i <= $totalpages; $i++) {
if ($seo_on == 1) {
$urk = '' . $domain . '/showcomments/' . $name . '/' . $ID . '/' . $i . '.html';
} else {
$urk = '' . $domain . '/index.php?action=showcomments&name=' . $name . '&ID=' . $ID . '&page=' . $i . '';
}
echo '<a href=\'' . $urk . '\' class=\'pagenat\'>' . $i . '</a> ';
}
echo '<br /><br />';
}
示例6: sqlcache
<?php
echo '<div class="header">
Top Games
</div>
<div class="content">';
$minViews = 1;
$count1 = 0;
$newest2 = "SELECT * FROM fas_games WHERE `active`='1' AND Views>{$minViews} ORDER BY Views DESC";
$newest1 = sqlcache('newest', $cachelife, $newest2);
if (isset($newest1)) {
foreach ($newest1 as $row1) {
$newestname = preg_replace('#\\W#', '-', $row1['name']);
if ($row1['type'] == 1) {
$img = "<img src='" . $domain . "/" . $thumbsfolder . "/" . $row1["thumb"] . "' alt='" . $newestname . "' class='minithumb' />";
} else {
$img = "<img src='" . $row1["thumburl"] . "' alt='" . $newestname . "' class='minithumb' />";
}
if ($count1 <= 4) {
echo '<ul class=\'catmenu\'>
<li>';
if ($seo_on == 1) {
echo "<a href='" . $domain . "/play/" . $row1["ID"] . "-" . $newestname . ".html'>" . $img . titlelimit($row1["name"]) . " - (" . $row1["views"] . ")</a>";
} else {
echo "<a href='" . $domain . "/index.php?action=play&ID=" . $row1["ID"] . "'>" . $img . titlelimit($row1["name"]) . " - (" . $row1["views"] . ")</a>";
}
echo '</li>
</ul>';
}
$count1++;
}
示例7: sqlcache
<?php
echo '<div class="side_nav">Links</div>
<div id="side_holder">';
$rlinkx2 = "SELECT * FROM fas_links where activate = '2' ";
$rlinkx1 = sqlcache('sitewidelinks', $cachelife, $rlinkx2);
echo '<ul class=\'catmenu\'>';
if (isset($rlinkx1)) {
foreach ($rlinkx1 as $rlinkx) {
echo '<li><a href=\'' . $rlinkx['url'] . '\' target="_blank">' . $rlinkx['title'] . '</a></li>';
}
} else {
echo '<li>No links have been added yet!</li>';
}
echo '</ul>';
echo '<br />';
if ($seo_on == 1) {
echo '<a href=\'' . $domain . '/links/\' title=\'Links\'> Add links >>></a>';
} else {
echo '<a href=\'' . $domain . '/index.php?action=links\' title=\'Links\'> Add links >>></a>';
}
echo '</div>';
示例8: clean
$ID = clean($_GET['ID']);
$ID = abs((int) $ID);
$query = "SELECT Name FROM fas_categories WHERE ID={$ID}";
$result = mysql_query($query);
$title = mysql_result($result, 0, "Name");
$max = $gamesonpage;
if (!isset($_GET['page'])) {
$show = '1';
} else {
$show = clean($_GET['page']);
}
$limits = ($show - 1) * $max;
$r2 = "SELECT * FROM fas_games WHERE category='{$ID}' && active='1' ORDER BY ID DESC LIMIT " . $limits . "," . $max;
$sqltitle = "browse-cat" . $ID . "page " . $show;
$r1 = sqlcache($sqltitle, $cachelife, $r2);
$totalres = mysql_result($db->query('SELECT COUNT(ID) AS total FROM fas_games WHERE active=\'1\' and category=\'' . $ID . '\''), 0);
$totalpages = ceil($totalres / $max);
echo '<div class="header2">' . $title . '</div>';
$count = 0;
if (!isset($r1)) {
echo '<div class="content2">There currently are no games in this category.</div>';
} else {
echo '<div class="content2">';
foreach ($r1 as $in) {
$gamename = preg_replace('#\\W#', '-', $in['name']);
if ($seo_on == 1) {
$playlink = '' . $domain . '/play/' . $in['ID'] . '-' . $gamename . '.html';
} else {
$playlink = '' . $domain . '/index.php?action=play&ID=' . $in['ID'] . '';
}
示例9: sqlcache
<?php
echo '<div id="container">
<div id="content-container">
<div id="side">';
include "includes/blocks.php";
echo '</div>
<div id="content">
<div class="content_nav">Partners</div>
<table align=\'center\' border=\'0\' width=\'100%\'>
<tr>
<td align=\'center\' class=\'content\'>';
$rlinkx2 = "SELECT * FROM fas_links where activate != '0' ORDER BY activate desc ";
$rlinkx1 = sqlcache('linkspage', $cachelife, $rlinkx2);
foreach ($rlinkx1 as $row) {
echo '<a href=\'' . $row['url'] . '\' target=\'_blank\'><font size=\'3\'>' . $row['title'] . '</font></a><br>';
}
echo '
</td>
</tr>
</table>
<hr width=\'85%\'>
';
if (isset($_POST['submit'])) {
$title = clean($_POST['title']);
$url = clean($_POST['url']);
$linkbackat = clean($_POST['linkbackat']);
示例10: sqlcache
<?php
echo '<div class="header">
Top Users
</div>
<div class="content">
<ul class=\'catmenu\'>';
$tur1 = 'SELECT username, userid, plays FROM fas_users WHERE plays!="0" ORDER BY plays DESC LIMIT 0,15';
$tur = sqlcache('topplayers', $cachelife, $tur1);
if (isset($tur)) {
foreach ($tur as $r) {
if ($seo_on == 1) {
$urlp = '' . $domain . '/showprofile/' . $r['userid'] . '.html';
} else {
$urlp = '' . $domain . '/index.php?action=showprofile&profile=' . $r['userid'];
}
$avatarfileurl = get_avatar($r['userid']);
echo '<li><a href="' . $urlp . '"><img src="' . $domain . '/avatars/' . $avatarfileurl . '" alt="avatar" class="minithumb" />' . $r['username'] . ' - (' . $r['plays'] . ')</a></li>';
}
} else {
echo '<li>Either no there are no users or no users have played a game yet!</li>';
}
echo '</ul>
</div>';
示例11: writebody
function writebody()
{
global $db, $domain, $sitename, $cachelife, $template, $gamesfolder, $thumbsfolder, $limitboxgames, $seo_on, $blogentriesshown, $enabledcode_on, $comments_on, $directorypath, $autoapprovecomments, $gamesonpage, $abovegames, $belowgames, $showwebsitelimit, $supportemail, $showblog, $blogentriesshown, $blogcharactersshown, $blogcommentpermissions, $blogcommentsshown, $blogfollowtags, $blogcharactersrss, $usrdata, $userid;
$name = clean($_GET['name']);
$max = $blogentriesshown;
$show = clean($_GET['page']);
$show = abs((int) $show);
if (empty($show)) {
$show = 1;
}
$limits = ($show - 1) * $max;
$r2 = "SELECT * FROM fas_blogentries WHERE visible='1' order by entryid desc LIMIT " . $limits . "," . $max;
$sqltitle = "blogmain-page" . $show;
$r1 = sqlcache($sqltitle, $cachelife, $r2);
$totalres = mysql_result($db->query('SELECT COUNT(entryid) AS total FROM fas_blogentries where visible=\'1\' '), 0);
$totalpages = ceil($totalres / $max);
echo '<table width=\'100%\' border=\'0\' align=\'center\'>
<tr>
<td colspan=\'2\' class=\'header\'>Blog Entries</td>
</tr>';
if (!$db->num_rows($r)) {
echo ' <tr>
<td colspan=\'2\' class=\'content\'>There currently are no blog entries.</td>
</tr>';
}
foreach ($r1 as $in) {
$blogentry = $in['blogentry'];
$author = $in['author'];
$title = $in['title'];
$entryid = abs((int) $in['entryid']);
$entrydate = $in['entrydate'];
if ($seo_on == 1) {
$rburl = '' . $domain . '/blogentry/entryid/' . $entryid . '/1.html';
} else {
$rburl = '' . $domain . '/index.php?action=blogentry&entryid=' . $entryid;
}
$body = $in['body'];
if (strlen($body) > $blogcharactersshown) {
$body = substr($body, 0, $blogcharactersshown);
$body .= '...';
}
$bodystring = str_replace("[urlhead]", "<a href='http://", $body);
$bodystring = str_replace("[urlmid]", "'>", $bodystring);
$bodystring = str_replace("[urlend]", "</a>", $bodystring);
$bodystring = str_replace("[imghead]", "<img src='http://", $bodystring);
$bodystring = str_replace("[imgend]", "'>", $bodystring);
$bodystring = str_replace("[bhead]", "<b>", $bodystring);
$bodystring = str_replace("[bend]", "</b>", $bodystring);
$bodystring = str_replace("[p]", "<p>", $bodystring);
$bodystring = str_replace("\n\n", "<p>", $bodystring);
$bodystring = str_replace("\n", "<br />", $bodystring);
$body = str_replace("[br]", "<br>", $bodystring);
echo ' <tr>
<td width=\'15%\' class=\'content\' style=\'padding:4px;\' valign=\'top\'><b>Posted By:</b> ' . $author . '</td>
<td valig=\'top\' class=\'content\'><a href=\'' . $rburl . '\' >' . $title . '</a><p>' . $body . '</td>
</tr>
<tr>
<td width=\'100%\' colspan=\'2\' class=\'content\'><small><i><b>Posted On:</b> ' . $entrydate . '</i></small></td>
</tr>
';
}
echo "</table>";
echo 'Pages: ';
for ($i = 1; $i <= $totalpages; $i++) {
if ($seo_on == 1) {
$urk = '' . $domain . '/blog/page/' . $i . '.html';
} else {
$urk = '' . $domain . '/index.php?action=blog&page=' . $i . '';
}
echo '<a href=\'' . $urk . '\' class=\'pagenat\'>' . $i . '</a> ';
}
echo '<br /><br />';
}
示例12: mysql_query
<div class="content_nav">Comments Left For ' . $name . '</div>';
echo '<table width=\'100%\' border=\'0\' align=\'center\'>';
$nr = mysql_query($r);
if (!$db->num_rows($nr)) {
echo ' <tr>
<td colspan=\'2\' class=\'content\'>There currently are no comments left for this game.</td>
</tr>';
} else {
$r4 = sqlcache($sqltitle, $cachelife, $r);
foreach ($r4 as $in) {
$comment = $in['comment'];
$commenter = abs((int) $in['commenter']);
$date = date('M-d-Y', $in['date']);
$nv1 = "SELECT * FROM fas_users WHERE userid='{$commenter}' limit 1 ";
$sqltitle = "userprofile-" . $commenter;
$nv3 = sqlcache($sqltitle, $cachelife, $nv1);
foreach ($nv3 as $nv2) {
$useridl = $nv2['userid'];
if (empty($username)) {
$username = "No longer a member";
}
if ($commenter == '0') {
$username = 'Guest';
} else {
$username = $nv2['username'];
}
if ($seo_on == 1) {
$urlp = '' . $domain . '/showprofile/' . $useridl . '.html';
} else {
$urlp = '' . $domain . '/index.php?action=showprofile&profile=' . $useridl;
}
示例13: writebody
function writebody()
{
global $db, $cachelife, $domain, $suserid, $sitename, $cachelife, $template, $gamesfolder, $thumbsfolder, $limitboxgames, $seo_on, $blogentriesshown, $enabledcode_on, $comments_on, $directorypath, $autoapprovecomments, $gamesonpage, $abovegames, $belowgames, $showwebsitelimit, $supportemail, $showblog, $blogentriesshown, $blogcharactersshown, $blogcommentpermissions, $blogcommentsshown, $blogfollowtags, $blogcharactersrss, $usrdata, $userid, $username;
$max = '70';
$userids = clean($_GET['profile']);
if (!isset($suserid)) {
$smessage = 'Please login to send a message.';
} else {
$smessage = '
<form action="' . $domain . '/index.php?action=messages&case=compose" method="post">
<input size="40" name="subject" value="[No Subject]" >
<textarea cols="50" rows="5" name="message" ></textarea><br>
<input name="to" value="' . $userids . '" type="hidden">
<input name="submit" value="Send" type="submit">
</form> ';
}
if (empty($userids)) {
echo 'No profile selected';
} else {
$r = "SELECT * FROM fas_users WHERE userid='{$userids}' ";
$sqltitle = "userprofile-" . $userids;
$r1 = sqlcache($sqltitle, $cachelife, $r);
foreach ($r1 as $r2) {
$username = $r2['username'];
$played = $r2['plays'];
$aim = $r2['aim'];
$icq = $r2['icq'];
$msn = $r2['msn'];
$yim = $r2['yim'];
$location = $r2['location'];
$job = $r2['job'];
$website = $r2['website'];
$link1 = $r2['link1'];
$link2 = $r2['link2'];
$link3 = $r2['link3'];
$link4 = $r2['link4'];
$link5 = $r2['link5'];
$link6 = $r2['link6'];
$link7 = $r2['link7'];
$link8 = $r2['link8'];
$sex = $r2['sex'];
$interests = $r2['interests'];
$bio = $r2['bio'];
$avatar = $r2['avatar'];
$avatarfile = $r2['avatarfile'];
$joindate = $r2['joindate'];
}
if ($link1 != '') {
$mylinks .= '<a href=\'http://' . $link1 . '\' target=\'_blank\'>' . $link1 . '</a><br>';
}
if ($link2 != '') {
$mylinks .= '<a href=\'http://' . $link2 . '\' target=\'_blank\'>' . $link2 . '</a><br>';
}
if ($link3 != '') {
$mylinks .= '<a href=\'http://' . $link3 . '\' target=\'_blank\'>' . $link3 . '</a><br>';
}
if ($link4 != '') {
$mylinks .= '<a href=\'http://' . $link4 . '\' target=\'_blank\'>' . $link4 . '</a><br>';
}
if ($link5 != '') {
$mylinks .= '<a href=\'http://' . $link5 . '\' target=\'_blank\'>' . $link5 . '</a><br>';
}
if ($link6 != '') {
$mylinks .= '<a href=\'http://' . $link6 . '\' target=\'_blank\'>' . $link6 . '</a><br>';
}
if ($link7 != '') {
$mylinks .= '<a href=\'http://' . $link7 . '\' target=\'_blank\'>' . $link7 . '</a><br>';
}
if ($link8 != '') {
$mylinks .= '<a href=\'http://' . $link8 . '\' target=\'_blank\'>' . $link8 . '</a>';
}
if ($avatar == "1") {
$avatarfileurl = '<img src=\'' . $domain . '/avatars/' . $avatarfile . '\' height=\'100\' width=\'100\'>';
} else {
$avatarfileurl = '';
}
if ($played >= $showwebsitelimit) {
$webvar = '
<tr>
<td class="content">Website:</th>
<th class="content"><a href="http://' . $website . '" target="_blank" class="playlink">' . $website . '</a></th>
</tr>
';
} else {
$webvar = ' ';
}
echo '
<table width="100%" align="center">
<tr>
<td colspan=\'2\' class=\'header\'>User Profile: ' . $username . '</td>
</tr>
<tr>
<td class="content" width="100">About Me:<br>' . $avatarfileurl . '</th>
<th class="content" width="450">' . $bio . '</th>
</tr>
<tr>
<td class="content">Interests:</th>
//.........这里部分代码省略.........
示例14: account
//.........这里部分代码省略.........
<tr>
<td class=\'content\' style=\'padding:3px;\'><img src=\'' . $domain . '/avatars/' . $avatarfileurl . '\' height=\'100\' width=\'100\' /></td>
<td colspan=\'3\' class=\'content\' style=\'padding:3px;\'><a href=\'' . $url1 . '\'>My Favorites</a> -
<a href=\'' . $url2 . '\'>Change Password</a> -
<a href= \'' . $url6 . '\'>Change security question/answer</a> -
<a href= \'' . $url7 . '\'>Change email</a> -
<a href= \'' . $url4 . '\'>Messages</a> -
<a href= \'' . $url5 . '\'>Change Avatar</a>
</td>
</tr>
<tr>
<form action="' . $url3 . '" method="POST">
<td class="content">Games Played:</td>
<td class="content">' . $plays . '</td>
</tr>
<tr>
<td class="content">Newsletter:</td>
<td class="content"><select type="dropdown" name="newsletter">
<option value="no">No</option>
<option value="yes" ' . $nsel . ' >Yes</option>
</select>
</td>
</tr>
<tr>
<td class="content">Template:</td>
<td class="content"><select type="dropdown" name="template">
<option value="default">default</option>';
$theme = "SELECT * FROM fas_themes WHERE `active`='1'";
$theme = sqlcache('themes', $cachelife, $theme);
foreach ($theme as $row2) {
if ($row2['name'] == $utemplate) {
$usel = "selected";
} else {
$usel = NULL;
}
echo "<option value=" . $row2['name'] . " " . $usel . " >" . $row2['name'] . "</option>";
}
echo '
</select>
</td>
</tr>
<tr>
<td class="content">Location:</td>
<td class="content"><input name="location" type="text" size="50" value="' . $location . '"></td>
</tr>
<tr>
<td class="content">Website:<br><small>(Leave off the http://)</small></td>
<td class="content"><input name="website" type="text" size="50" value="' . $website . '"></td>
</tr>
<tr>
<td class="content">Occupation:<br></td>
<td class="content"><input name="job" type="text" size="50" value="' . $job . '"></td>
</tr>
<tr>
<td class="content">Sex:</td>
<td class="content"><select type="dropdown" name="sex" >
<option value="u">Undisclosed</option>
<option value="m" ' . $msel . '>Male</option>
<option value="f" ' . $fsel . '>Female</option>
示例15: writebody
function writebody()
{
global $db, $domain, $sitename, $cachelife, $template, $gamesfolder, $thumbsfolder, $limitboxgames, $seo_on, $blogentriesshown, $enabledcode_on, $comments_on, $directorypath, $autoapprovecomments, $gamesonpage, $abovegames, $belowgames, $showwebsitelimit, $supportemail, $showblog, $blogentriesshown, $blogcharactersshown, $blogcommentpermissions, $blogcommentsshown, $blogfollowtags, $blogcharactersrss, $usrdata, $userid;
$count = 0;
$baser2 = "SELECT * FROM fas_categories where active='1'";
$baser1 = sqlcache('mainpagecats', $cachelife, $baser2);
if ($baser1 == false) {
//If no games are added to the category yet, display error.
echo '<div class="msg">No categories added yet</div>';
return;
}
//end if $baser1
echo '<table width=\'99%\' border=\'0\' cellpadding=\'0\' cellspacing=\'0\' align=\'center\'>';
foreach ($baser1 as $row) {
$categorynamev = $row['name'];
$categorynameu = preg_replace('#\\W#', '-', $categorynamev);
if ($seo_on == 1) {
$categoryurl = '' . $domain . '/browse/' . $row['ID'] . '-' . $categorynameu . '.html';
} else {
$categoryurl = '' . $domain . '/index.php?action=browse&ID=' . $row['ID'] . '';
}
if ($count % 2 == 0) {
echo '<tr>
<td width=\'50%\' valign=\'top\'>
<table width=\'97%\' border=\'0\'>
<tr>
<td class=\'header\'>' . $row['name'] . '</td>
</tr>
<tr>
<td>';
echo '<table>';
$catid1 = $row['ID'];
$sqltitle = 'mainpagecat' . $catid1;
$baseir2 = "SELECT * FROM fas_games WHERE category='{$catid1}' and active='1' ORDER BY rand() LIMIT 0," . $limitboxgames;
$baseir1 = sqlcache($sqltitle, $cachelife, $baseir2);
if (isset($baseir1)) {
foreach ($baseir1 as $row) {
$gamename = preg_replace('#\\W#', '-', $row['name']);
if ($seo_on == 1) {
$playlink = '' . $domain . '/play/' . $row['ID'] . '-' . $gamename . '.html';
} else {
$playlink = '' . $domain . '/index.php?action=play&ID=' . $row['ID'] . '';
}
echo ' <tr>
<td width=\'45\' height=\'45\' valign=\'top\' class=\'content\'>
<a href=\'' . $playlink . '\'>
';
if ($row['type'] == 1) {
echo ' <img src=\'' . $domain . '/' . $thumbsfolder . '/' . $row['thumb'] . '\' width=\'45\' height=\'45\' border=\'0\'>';
} else {
echo ' <img src=\'' . $row['thumburl'] . '\' width=\'45\' height=\'45\' border=\'0\'>';
}
echo '
</a>
</td>
<td valign=\'top\' class=\'content\'><div class=\'gamehometitle\'>' . $row['name'] . '</div>
<div class=\'gamehomedesc\'>' . desclimit($row['description']) . '
<a href=\'' . $playlink . '\'>Play</a></div></td>
</tr>';
}
} else {
echo '<div>
No games in this category yet.
</div>';
}
echo '<tr><td colspan=\'2\' class=\'content\'>';
echo '<a href=\'' . $categoryurl . '\'>Play more ' . $categorynamev . ' games</a>';
echo '</td></tr>';
echo ' </table>';
echo ' </td>
</tr>
</table>
</td>';
} else {
echo '
<td width=\'50%\' valign=\'top\'>
<table width=\'97%\' border=\'0\'>
<tr>
<td class=\'header\'>' . $row['name'] . '</td>
</tr>
<tr>
<td>';
echo '<table>';
$catid1 = $row['ID'];
$sqltitle = 'mainpagecat' . $catid1;
$baseir2 = "SELECT * FROM fas_games WHERE category='{$catid1}' and active='1' ORDER BY rand() LIMIT 0," . $limitboxgames;
$baseir1 = sqlcache($sqltitle, $cachelife, $baseir2);
if (isset($baseir1)) {
foreach ($baseir1 as $row) {
$gamename = preg_replace('#\\W#', '-', $row['name']);
if ($seo_on == 1) {
$playlink = '' . $domain . '/play/' . $row['ID'] . '-' . $gamename . '.html';
} else {
$playlink = '' . $domain . '/index.php?action=play&ID=' . $row['ID'] . '';
}
echo ' <tr>
<td width=\'45\' height=\'45\' valign=\'top\' class=\'content\'>
<a href=\'' . $playlink . '\'>';
if ($row['type'] == 1) {
echo ' <img src=\'' . $domain . '/' . $thumbsfolder . '/' . $row['thumb'] . '\' width=\'45\' height=\'45\' border=\'0\'>';
//.........这里部分代码省略.........