94 lines
3.2 KiB
PHP
94 lines
3.2 KiB
PHP
|
|
<?php if ( !defined('PATHTOINCLUDES') ) define('PATHTOINCLUDES', $_SERVER["DOCUMENT_ROOT"] . '/include/analytics/');
|
||
|
|
|
||
|
|
$page = "community";
|
||
|
|
include "header.php";/* $Id: community.php 59 2012-03-25 03:25:54Z phil $ */
|
||
|
|
|
||
|
|
include(PATHTOINCLUDES."base.php");
|
||
|
|
ini_set('session.bug_compat_warn', 0);
|
||
|
|
ini_set('session.bug_compat_42', 0);
|
||
|
|
|
||
|
|
$em="";
|
||
|
|
$cptheuserid=$user->user_info['user_id'];
|
||
|
|
$cpthenumber = (((int)($cptheuserid/1000))*1000)+1000;
|
||
|
|
$cptheuserphoto=$user->user_info['user_photo'];
|
||
|
|
$cpifp="http://bateworld.com/images/nophoto.png";
|
||
|
|
if($cptheuserphoto=="")
|
||
|
|
{
|
||
|
|
$cpifp="http://bateworld.com/images/nophoto.png";
|
||
|
|
}
|
||
|
|
else {
|
||
|
|
$cpifp="/uploads_user/".$cpthenumber."/".$cptheuserid."/".$cptheuserphoto;
|
||
|
|
}
|
||
|
|
$_SESSION["cp_userid"]=$user->user_info['user_id'];
|
||
|
|
$_SESSION["pagename"]="Community Page";
|
||
|
|
$_SESSION["nickname"]=$user->user_info['user_username'];
|
||
|
|
$_SESSION["blocklist"]=$user->user_info['user_blocklist'];
|
||
|
|
$_SESSION["invisible"]=$user->user_info['user_invisible'];
|
||
|
|
$_SESSION["userphoto"]=$user->user_photo("./images/nophoto.png",true);
|
||
|
|
$_SESSION["cp_useremail"]=$user->user_info['user_email'];
|
||
|
|
$_SESSION["cp_userlevel"]=$user->user_info['user_level_id'];
|
||
|
|
|
||
|
|
if(!isset($_SESSION["newvisit"]))
|
||
|
|
{
|
||
|
|
include(PATHTOINCLUDES."setstate2.php");
|
||
|
|
}
|
||
|
|
|
||
|
|
$smactive=0;
|
||
|
|
$csql="SELECT
|
||
|
|
`cp_sitemessage`.`cp_sitemsg`,
|
||
|
|
`cp_sitemessage`.`cp_active`,
|
||
|
|
`cp_sitemessage`.`lastupdate`
|
||
|
|
FROM `cp_sitemessage` WHERE `cp_sitemessage`.`cp_id` = 1";
|
||
|
|
|
||
|
|
$cresult=$database->database_query($csql) or $em=$em.$database->database_error();
|
||
|
|
$cp=$database->database_fetch_assoc($cresult);
|
||
|
|
|
||
|
|
if($cp["cp_sitemsg"]==""){$cpannounce="<br />";} else {$cpannounce=stripslashes($cp["cp_sitemsg"]);}
|
||
|
|
|
||
|
|
$ctpactive="";
|
||
|
|
$ctpentries="";
|
||
|
|
$ctpimages="";
|
||
|
|
$ctpsql="SELECT
|
||
|
|
`caption_this_pic`.`hcidu`,
|
||
|
|
`caption_this_pic`.`hcuid`,
|
||
|
|
`caption_this_pic`.`ctpactive`,
|
||
|
|
`caption_this_pic`.`hc_path`,
|
||
|
|
`caption_this_pic`.`hc_name`,
|
||
|
|
`caption_this_pic`.`hc_ext`,
|
||
|
|
`caption_this_pic`.`blogid`,
|
||
|
|
`caption_this_pic`.`ctpused`
|
||
|
|
FROM
|
||
|
|
`caption_this_pic`
|
||
|
|
WHERE
|
||
|
|
`caption_this_pic`.`ctpused` = 'yes'
|
||
|
|
ORDER BY
|
||
|
|
`caption_this_pic`.`hcidu` DESC";
|
||
|
|
|
||
|
|
$cresult=$database->database_query($ctpsql) or $em=$em.$database->database_error();
|
||
|
|
$cp=$database->database_fetch_assoc($cresult);
|
||
|
|
|
||
|
|
$ctpactive="";
|
||
|
|
$ctpentries="";
|
||
|
|
$ctpimages="";
|
||
|
|
while ($row = $database->database_fetch_assoc($ctpresult)) {
|
||
|
|
$fullctpimg=$row["hc_path"]."/".$row["hc_name"]."_full.".$row["hc_ext"]."?id=".$row["hcidu"];
|
||
|
|
$medctpimg=$row["hc_path"]."/".$row["hc_name"]."_medium.".$row["hc_ext"];
|
||
|
|
|
||
|
|
if($row["ctpactive"]=="yes")
|
||
|
|
{
|
||
|
|
$ctpactive='<a class="rsContent" href="javascript:get_page(\'http://bateworld.com/caption_this_pic.php?user=CaptionThisPic&blogentry_id='.$row["blogid"].'\')" style="margin-left:0px;"><img src="'.$medctpimg.'" class="rsImg" /></a>';
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
$ctpentries.='<a class="rsContent" href="javascript:get_page(\'http://bateworld.com/caption_this_pic.php?user=CaptionThisPic&blogentry_id='.$row["blogid"].'\')" style="margin-left:0px;"><img src="'.$medctpimg.'" class="rsImg" /></a>';
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
$ctpimages=$ctpactive.$ctpentries;
|
||
|
|
$smarty->assign('aactive', $cp["cp_active"]);
|
||
|
|
$smarty->assign('announce', $cpannounce);
|
||
|
|
$smarty->assign('ctpimages',$ctpimages);
|
||
|
|
$smarty->assign('thetitle',"Community Page");
|
||
|
|
$smarty->assign('cpuserphotourl',$cpifp);
|
||
|
|
include "footer.php";
|
||
|
|
?>
|