Re:couple of folders missing (1 viewing) (1) Guest
Favoured: 0
|
|
|
TOPIC: Re:couple of folders missing
|
steveometer (User)
Steve Alan Thought Of That
Modder
Posts: 465
|
|
couple of folders missing 1 Month, 3 Weeks ago
|
Karma: 29
|
|
i already hand coded them back in on my site, would LOVE to see them permanent
9999 - My Favorites
9998 - Newest
9997 - Popular
9996 - Scores
9996 - Players
Folders
SoM
|
|
|
|
|
|
|
|
|
|
The administrator has disabled public write access.
|
|
|
|
Re:couple of folders missing 1 Month, 3 Weeks ago
|
Karma: 89
|
|
What is in Scores and Players?
|
|
|
|
|
|
|
Please DO NOT send support requests via PM or email. Instead, please post a question in the forums so everyone can benefit. Yes, this means you. No, your problem is not an exception.
|
|
|
The administrator has disabled public write access.
|
steveometer (User)
Steve Alan Thought Of That
Modder
Posts: 465
|
|
Re:couple of folders missing 1 Month, 3 Weeks ago
|
Karma: 29
|
the players folder is a list of all players sorted by # of scores
the scores folder is a list of (x) most recent scores
player folder
| Code: |
function ShowPlayers($Itemid,$pageNav)
{
global $mainframe,$database,$mosConfig_live_site,$mosConfig_lang,$mosConfig_absolute_path;
$config = new puarcade_config($database);
$config->load(1);
$output='';
$database->setQuery("
SELECT DISTINCT #__puarcade.userid, #__users.username, #__users.id, count( #__puarcade.gameid ) AS scores
FROM #__puarcade
LEFT JOIN #__users ON #__puarcade.userid = #__users.id
WHERE #__puarcade.userid != '0'
GROUP BY #__users.id
ORDER BY scores DESC
LIMIT ".$pageNav->limitstart.",".$pageNav->limit);
$rows = $database->loadObjectList();
if (count($rows) > 0)
{
$count=$pageNav->limitstart+1;
$r = 1;
$output.= '<table width="100%" cellspacing="0" cellpadding="1" border="0"><thead>';
$output.= '<tr class="componentheading">';
$output.= '<th align="left"> </th>';
$output.= '<th align="left" width="5%">Place</th>';
$output.= '<th align="center" width="20%">Avatar</th>';
$output.= '<th align=left width="30%">Player</th>';
$output.= '<th align="right" width="15%">Score</th>';
$output.= '<th align="left"> </th>';
$output.= '</tr></thead><tbody>';
foreach ($rows as $row)
{
$output.='<tr height="70" class=sectiontableentry'.$r.'>';
$output.='<td align="left"> </td>';
if ($count > 3) {
$output.='<td width="5%" align="left"> #'.$count.' </td>';
} else {
$output.='<td width="5%" align="left"><img src="'.$mainframe->getCfg('live_site').'/components/images/sokal'.$count.'.gif" /></td>';
}
//Player Avatar
$u_avatar=NULL;
$database->setQuery( "SELECT avatar FROM #__comprofiler WHERE user_id=".$row->id.";" );
$database->loadObject($u_avatar);
if (file_exists($mosConfig_absolute_path."/images/comprofiler/tn".$u_avatar->avatar)) {
$img_avatar=$mosConfig_live_site."/images/comprofiler/tn".$u_avatar->avatar;
}
else {
$img_avatar=$mosConfig_live_site."/components/com_comprofiler/plugin/language/default_language/images/tnnophoto.jpg";
}
$output.='<td width="20%" align="center"><img src="'.$img_avatar.'" border="0" alt="avatar" height="50"/></td>';
$output.='<td width="30%" align="left"><a href="'.sefRelToAbs('index.php?option=com_comprofiler&task=userProfile&user='.$row->id).'">'.$row->username.'</a></td>';
$output.='<td width="15%" align="center">'.strval($row->scores).'</td>';
$output.='<td align="left"> </td></tr>';
$count++;
if ($r == 1)
$r = 2;
else
$r = 1;
}
$output .= '</tbody></table>';
} // count > 0
echo $output;
$url = "index.php?option=com_puarcade&Itemid=".$Itemid."&fid=9995";
if ($pageNav->limit < $pageNav->total) puarcade_html::WritePagination($url,$pageNav);
}
|
score folder
| Code: |
function ShowScoreboard($Itemid,$pageNav)
{
global $mainframe,$database,$mosConfig_live_site,$mosConfig_lang,$mosConfig_absolute_path,$my;
$config = new puarcade_config($database);
$config->load(1);
$output='';
$linkornot = 1;
$winnerimage = "<img src=".$mosConfig_live_site."/components/images/sokal1.gif alt='winner'/>";
$query = "SELECT * FROM #__puarcade WHERE published = '1' AND userid != '0' ORDER BY #__puarcade.date DESC LIMIT ".$pageNav->limitstart.",".$pageNav->limit;
$database->setQuery( $query );
$scores = $database->loadObjectList();
$i = 1;
$count=1;
$output.= '<table width="100%" cellspacing="1" cellpadding="2" border="0"><thead>';
$output.= '<tr class="componentheading">';
$output.= '<th align="center" width="12%">Avatar</th>';
$output.= '<th align="center" width="8%">Date/time</th>';
$output.= '<th align="center" width="30%">Message</th>';
$output.= '<th align="center" width="10%">Game</th>';
$output.= '<th align="center" width="40%">Desc</th>';
$output.= '</tr></thead><tbody>';
foreach($scores as $score)
{
$timestring=$timestringmain;
$datestring=$datestringmain;
if ($score->userid == 0) {
$name = $config->guest_name;
} else {
$query = "Select username from #__users where id LIKE '$score->userid'";
$database->setquery($query);
$dbrow = $database->loadRow();
if ($linkornot=='1') {
$name="<a href='".sefRelToAbs("index.php?option=com_comprofiler&task=userProfile&user=$score->userid&tab=getPuaTab&getDisplayTab=&puatabpuatab_sortby=Nameup")."'>".$dbrow[0]."</a>";
} else {
$name=$dbrow[0];
}
}
$game = "<a href='".sefRelToAbs('index.php?option=com_puarcade&Itemid='.$Itemid.'&gid='.$score->gameid)."'>";
$query = "Select title from #__puarcade_games where id LIKE '$score->gameid'";
$database->setquery($query);
$dbrow = $database->loadRow();
$game.= $dbrow[0];
$game.= '</a>';
$timestamp = $score->date;
$timestamp = @ereg_replace("[^0-9]",'',$timestamp);
$year=substr($timestamp,0,4);
$yr=substr($timestamp,2,2);
$month=substr($timestamp,4,2);
$day=substr($timestamp,6,2);
$hour=substr($timestamp,8,2);
$minute=substr($timestamp,10,2);
$second=substr($timestamp,12,2);
$newdate=mktime($hour,$minute,$second,$month,$day,$year);
$query = "Select score from #__puarcade WHERE userid='$my->id' AND gameid='$score->gameid' ";
$database->setQuery( $query );
$database->loadObject($myscore);
$query = "SELECT reverse_score FROM #__puarcade_games WHERE id = '$score->gameid'";
$database->setQuery( $query );
$reverse = $database->loadRow();
if ($reverse[0] == 0){
$database->setQuery("SELECT count(score) as rank FROM #__puarcade WHERE gameid = '$score->gameid' AND published = '1' AND score > '$score->score'"); //." ".$limit;
} else {
$database->setQuery("SELECT count(score) as rank FROM #__puarcade WHERE gameid = '$score->gameid' AND published = '1' AND score < '$score->score'"); //." ".$limit;
}
$thisscorerank=intval($database->loadResult())+1; // $scoresrank
$roundedmyscore = round($myscore->score,2);
if ($roundedmyscore == 0) {
$roundedmyscore = "not yet created";
}
$roundedscore = round($score->score,2);
if ($roundedmyscore != 0) {
if ($roundedmyscore > $roundedscore) {
$indicatorimage = "better.gif";
}
if ($roundedmyscore < $roundedscore) {
$indicatorimage = 'lesser.gif';
}
if ($roundedmyscore == $roundedscore) {
$indicatorimage = 'same.gif';
}
}else{
if ($roundedmyscore == 0) {
$indicatorimage = 'publish_x.png';
}
}
$indicator = "<img src='".$mainframe->getCfg('live_site')."/components/images/".$indicatorimage."' border='0' width='15' alt=''/>";
//Player Avatar/Name Column
$u_avatar=NULL;
$database->setQuery( "SELECT avatar FROM #__comprofiler WHERE user_id=".$score->userid.";" );
$database->loadObject($u_avatar);
if ($u_avatar->avatar == NULL) {
$img_avatar=$mosConfig_live_site."/components/com_comprofiler/plugin/language/default_language/images/nophoto.jpg";
}
elseif (file_exists($mosConfig_absolute_path."/images/comprofiler/tn".$u_avatar->avatar)) {
$img_avatar=$mosConfig_live_site."/images/comprofiler/".$u_avatar->avatar;
}
elseif (file_exists($mosConfig_absolute_path."/images/comprofiler/".$u_avatar->avatar)) {
$img_avatar=$mosConfig_live_site."/images/comprofiler/".$u_avatar->avatar;
}
$query = "Select imagename,description from #__puarcade_games where id ='$score->gameid'";
$database->setquery($query);
$database->loadObject($gameimage);
$output .= '<tr class="sectiontableentry'.$i.'"><td align="center"><img src="'.$img_avatar.'" height="70" border="0" alt="avatar"></img></td>';
$output .= '<td align="center">'.date('d.m.Y H:i:s ',$newdate).'</td>';
if ($thisscorerank == 1) {
$output .= "<td>$name scored $winnerimage with $roundedscore<br />on $game.<br />Your score: $indicator $roundedmyscore</td>";
}else{
$output .= "<td>$name scored #$thisscorerank with $roundedscore<br />on $game.<br />Your score: $indicator $roundedmyscore</td>";
}
$output .= "<td align='center'><a href='".sefRelToAbs('index.php?option=com_puarcade&Itemid='.$Itemid.'&gid='.$score->gameid)."'><img src='".$mainframe->getCfg('live_site')."/components/images/".$gameimage->imagename."' border='0' height='50' width='50' alt='online games'/></a></td>";
$output .= '<td align="center">'.$gameimage->description.'</td></tr>';
if ($i==1) $i=2; else $i=1;
$myscore->score = '0';
//echo "</center>";
$count++;
}
$output .= '</tbody></table>';
echo $output;
if ($pageNav->limit < $pageNav->total) puarcade_html::WritePagination("index.php?option=com_puarcade&fid=9996&Itemid=".$Itemid,$pageNav);
}
|
|
|
|
|
|
|
|
|
|
|
The administrator has disabled public write access.
|
steveometer (User)
Steve Alan Thought Of That
Modder
Posts: 465
|
|
Re:couple of folders missing 1 Month, 3 Weeks ago
|
Karma: 29
|
oh in function showgames..
| Code: |
if ($fid == 9998) {
$pageheading = PUA_NEWEST_GAMES;
} elseif($fid == 9997) {
$pageheading = PUA_POPULAR_GAMES;
} elseif($fid == 9996) {
$pageheading = "Recent Scores";
} elseif($fid == 9995) {
$pageheading = "Players";
}
|
in function WriteSpecialFolderLinks
| Code: |
<div class="pua_header_box">
<img src="<?php echo $imagepath; ?>smallfolder.png" alt="" />
<a href="<?php echo sefRelToAbs("index.php?option=com_puarcade&Itemid=".$Itemid."&fid=9996");?>">Scores</a>
</div>
<div class="pua_header_box">
<img src="<?php echo $imagepath; ?>smallfolder.png" alt="" />
<a href="<?php echo sefRelToAbs("index.php?option=com_puarcade&Itemid=".$Itemid."&fid=9995");?>">Players</a>
</div>
|
|
|
|
|
|
|
|
|
|
|
The administrator has disabled public write access.
|
steveometer (User)
Steve Alan Thought Of That
Modder
Posts: 465
|
|
Re:couple of folders missing 1 Month, 3 Weeks ago
|
Karma: 29
|
in class.puarcade.php
function processshowgameselections
| Code: |
/*
* This means we are looking in the Player List folder.
*/
}elseif ($fid == 9995){
echo "<div align=left><a href=".sefRelToAbs('index.php?option=com_puarcade&Itemid='.$Itemid)."> ".stripslashes($title)." </a><img src='images/M_images/arrow.png' /><a href=".sefRelToAbs('index.php?option=com_puarcade&fid=9995&Itemid='.$Itemid)."> Players </a><br/><br/></div>";
$limitstart = mosGetParam( $_REQUEST, 'limitstart', 0);
$limit = mosGetParam( $_REQUEST, 'limit', $gamesperpage);
include_once( "includes/pageNavigation.php" );
$query = "select count(distinct userid) from jos_puarcade WHERE userid != '0'";
$database->setQuery( $query );
$res = $database->loadRow();
$pageNav = new mosPageNav( $res[0], $limitstart, $limit );
$mainframe->setPageTitle($title.' - Player List');
puarcade_html::WriteSpecialFolderLinks($Itemid);
puarcade_html::ShowPlayers($Itemid,$pageNav);
/*
* This means we are looking in the Score List folder.
*/
}elseif ($fid == 9996){
echo "<div align=left><a href=".sefRelToAbs('index.php?option=com_puarcade&Itemid='.$Itemid)."> ".stripslashes($title)." </a><img src='images/M_images/arrow.png' /><a href=".sefRelToAbs('index.php?option=com_puarcade&fid=9996&Itemid='.$Itemid)."> Scores </a><br/><br/></div>";
$limitstart = mosGetParam( $_REQUEST, 'limitstart', 0);
$limit = mosGetParam( $_REQUEST, 'limit', $gamesperpage);
include_once( "includes/pageNavigation.php" );
$pageNav = new mosPageNav( 200, $limitstart, $limit );
$mainframe->setPageTitle($title.' - Recent Score List');
puarcade_html::WriteSpecialFolderLinks($Itemid);
puarcade_html::ShowScoreboard($Itemid,$pageNav);
|
|
|
|
|
|
|
|
|
|
|
The administrator has disabled public write access.
|
|
|
|
|