Page 1 of 1

Problem with site

Posted: Sun Jun 01, 2008 3:11 pm
by boyowilkins
Hi guys -

I just bought a gaming site which isa combination of a base CMS and a template.

The site is http://www.gamingverdict.com

If you look on the site, it has a Recent News section on the left, with a number of tabs for each of the systems. The tabs work fine. The problem I have is that when going into the site for the first time, the contents of each time is dislayed - I do not want this. I want to default to "All" which is the last 10 posts. The code that is behind this is below. Can you help with a fix - so that when I go into the site, it defaults to "All".

Thanks.

-------------------------------------------------------------------------

<!-- Latest News -->


<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td height="25" width="480" style="background: url('images/default/div_recent_news.gif') no-repeat;text-align: right;padding-right: 10px;" valign="middle"><SPAN class="view_more"><a href="archive.html" class="view_more">View More News</a></td>

</tr>
<tr>
<td valign="top">

<div id="latestnews"><a href="#" rel="All" class="selected"><img border="0" src="images/default/news_all.gif"></a><a href="#" rel="x360"><img border="0" src="images/default/news_x360.gif"></a><a href="#" rel="ps3"><img border="0" src="images/default/news_ps3.gif"></a><a href="#" rel="wii"><img border="0" src="images/default/news_wii.gif"></a><a href="#" rel="pc"><img border="0" src="images/default/news_pc.gif"></a><a href="#" rel="psp"><img border="0"src="images/default/news_psp.gif"></a><a href="#" rel="ds"><img border="0"src="images/default/news_ds.gif"></a></div>

<div style="width:100%; border: 1px solid #404040">

<div id="All" class="tabcontent">
<?php

echo '<table width="479" cellspacing="0" cellpadding="2" border="0">';
$featured_news = mysql_query("SELECT * from ccms_news where featured='1' order by id desc limit 10");
$c = 1;
while ($row = mysql_fetch_assoc($featured_news)) {

$title_start = preg_replace('/[^a-zA-Z0-9 *]/', '', $row[title]);
$title_seo = str_replace(' ', '-', $title_start);

if($odd = $c%2 ) {
$style = "#3A3A3A";
} else {
$style = "#2E2E2E";
}

echo '
<tr>
<td width="479" bgcolor="'.$style.'" height="67" valign="middle" style="padding-top: 1px;border-bottom: 1px solid #272727">

<table cellpadding="0" cellspacing="0" border="0" width="99%" align="center">
<tr>
<td width="1%"><a href="story-'.$row[id].'-'.$title_seo.'.html"><img alt="'.$row[title].'" align="left" src="thumbnailer.php?type=featured_news&image='.$row[image].'" style="border: 1px solid #B6B6B6;" width="78" height="60"></a></td>
<td width="99%" valign="top" style="padding: 5px;">
<a href="story-'.$row[id].'-'.$title_seo.'.html" class="featured_sect">'.$row[title].'</a><br />
<a class="prev_news">'.$row[prev_news].'</a>
</td>
</tr>
</table>

</td>
</tr>';

$c++;
}


echo '</table>';
?>

</div>

<div id="x360" class="tabcontent">
<?php


echo '<table width="479" cellspacing="0" cellpadding="2" border="0">';

$featured_news = mysql_query("SELECT * from ccms_news where featured='1' and platform='x360' order by id desc limit 10");
$c = 1;
while ($row = mysql_fetch_assoc($featured_news)) {

$title_start = preg_replace('/[^a-zA-Z0-9 *]/', '', $row[title]);
$title_seo = str_replace(' ', '-', $title_start);

if($odd = $c%2 ) {
$style = "#3A3A3A";
} else {
$style = "#2E2E2E";
}

echo '
<tr>
<td width="479" bgcolor="'.$style.'" height="67" valign="middle" style="padding-top: 1px;border-bottom: 1px solid #272727">

<table cellpadding="0" cellspacing="0" border="0" width="99%" align="center">
<tr>
<td width="1%"><a href="story-'.$row[id].'-'.$title_seo.'.html"><img alt="'.$row[title].'" align="left" src="thumbnailer.php?type=featured_news&image='.$row[image].'" style="border: 1px solid #B6B6B6;" width="78" height="60"></a></td>
<td width="99%" valign="top" style="padding: 5px;">
<a href="story-'.$row[id].'-'.$title_seo.'.html" class="featured_sect">'.$row[title].'</a><br />
<a class="prev_news">'.$row[prev_news].'</a>
</td>
</tr>
</table>

</td>
</tr>';

$c++;
}

echo '</table>';
?>
</div>

<div id="ps3" class="tabcontent">
<?php

echo '<table width="479" cellspacing="0" cellpadding="2" border="0">';

$featured_news = mysql_query("SELECT * from ccms_news where featured='1' and platform='ps3' order by id desc limit 10");
$c = 1;
while ($row = mysql_fetch_assoc($featured_news)) {

$title_start = preg_replace('/[^a-zA-Z0-9 *]/', '', $row[title]);
$title_seo = str_replace(' ', '-', $title_start);

if($odd = $c%2 ) {
$style = "#3A3A3A";
} else {
$style = "#2E2E2E";
}

echo '
<tr>
<td width="479" bgcolor="'.$style.'" height="67" valign="middle" style="padding-top: 1px;border-bottom: 1px solid #272727">

<table cellpadding="0" cellspacing="0" border="0" width="99%" align="center">
<tr>
<td width="1%"><a href="story-'.$row[id].'-'.$title_seo.'.html"><img alt="'.$row[title].'" align="left" src="thumbnailer.php?type=featured_news&image='.$row[image].'" style="border: 1px solid #B6B6B6;" width="78" height="60"></a></td>
<td width="99%" valign="top" style="padding: 5px;">
<a href="story-'.$row[id].'-'.$title_seo.'.html" class="featured_sect">'.$row[title].'</a><br />
<a class="prev_news">'.$row[prev_news].'</a>
</td>
</tr>
</table>

</td>
</tr>';

$c++;
}

echo '</table>';
?>
</div>

<div id="wii" class="tabcontent">
<?php

echo '<table width="479" cellspacing="0" cellpadding="2" border="0">';

$featured_news = mysql_query("SELECT * from ccms_news where featured='1' and platform='wii' order by id desc limit 10");
$c = 1;
while ($row = mysql_fetch_assoc($featured_news)) {

$title_start = preg_replace('/[^a-zA-Z0-9 *]/', '', $row[title]);
$title_seo = str_replace(' ', '-', $title_start);

if($odd = $c%2 ) {
$style = "#3A3A3A";
} else {
$style = "#2E2E2E";
}

echo '
<tr>
<td width="479" bgcolor="'.$style.'" height="67" valign="middle" style="padding-top: 1px;border-bottom: 1px solid #272727">

<table cellpadding="0" cellspacing="0" border="0" width="99%" align="center">
<tr>
<td width="1%"><a href="story-'.$row[id].'-'.$title_seo.'.html"><img alt="'.$row[title].'" align="left" src="thumbnailer.php?type=featured_news&image='.$row[image].'" style="border: 1px solid #B6B6B6;" width="78" height="60"></a></td>
<td width="99%" valign="top" style="padding: 5px;">
<a href="story-'.$row[id].'-'.$title_seo.'.html" class="featured_sect">'.$row[title].'</a><br />
<a class="prev_news">'.$row[prev_news].'</a>
</td>
</tr>
</table>

</td>
</tr>';

$c++;
}

echo '</table>';
?>
</div>

<div id="pc" class="tabcontent">
<?php

echo '<table width="479" cellspacing="0" cellpadding="2" border="0">';

$featured_news = mysql_query("SELECT * from ccms_news where featured='1' and platform='pc' order by id desc limit 10");
$c = 1;
while ($row = mysql_fetch_assoc($featured_news)) {

$title_start = preg_replace('/[^a-zA-Z0-9 *]/', '', $row[title]);
$title_seo = str_replace(' ', '-', $title_start);

if($odd = $c%2 ) {
$style = "#3A3A3A";
} else {
$style = "#2E2E2E";
}

echo '
<tr>
<td width="479" bgcolor="'.$style.'" height="67" valign="middle" style="padding-top: 1px;border-bottom: 1px solid #272727">

<table cellpadding="0" cellspacing="0" border="0" width="99%" align="center">
<tr>
<td width="1%"><a href="story-'.$row[id].'-'.$title_seo.'.html"><img alt="'.$row[title].'" align="left" src="thumbnailer.php?type=featured_news&image='.$row[image].'" style="border: 1px solid #B6B6B6;" width="78" height="60"></a></td>
<td width="99%" valign="top" style="padding: 5px;">
<a href="story-'.$row[id].'-'.$title_seo.'.html" class="featured_sect">'.$row[title].'</a><br />
<a class="prev_news">'.$row[prev_news].'</a>
</td>
</tr>
</table>

</td>
</tr>';

$c++;
}

echo '</table>';
?>
</div>

<div id="psp" class="tabcontent">
<?php

echo '<table width="479" cellspacing="0" cellpadding="2" border="0">';

$featured_news = mysql_query("SELECT * from ccms_news where featured='1' and platform='psp' order by id desc limit 10");
$c = 1;
while ($row = mysql_fetch_assoc($featured_news)) {

$title_start = preg_replace('/[^a-zA-Z0-9 *]/', '', $row[title]);
$title_seo = str_replace(' ', '-', $title_start);

if($odd = $c%2 ) {
$style = "#3A3A3A";
} else {
$style = "#2E2E2E";
}

echo '
<tr>
<td width="479" bgcolor="'.$style.'" height="67" valign="middle" style="padding-top: 1px;border-bottom: 1px solid #272727">

<table cellpadding="0" cellspacing="0" border="0" width="99%" align="center">
<tr>
<td width="1%"><a href="story-'.$row[id].'-'.$title_seo.'.html"><img alt="'.$row[title].'" align="left" src="thumbnailer.php?type=featured_news&image='.$row[image].'" style="border: 1px solid #B6B6B6;" width="78" height="60"></a></td>
<td width="99%" valign="top" style="padding: 5px;">
<a href="story-'.$row[id].'-'.$title_seo.'.html" class="featured_sect">'.$row[title].'</a><br />
<a class="prev_news">'.$row[prev_news].'</a>
</td>
</tr>

</table>

</td>
</tr>';

$c++;
}

echo '</table>';
?>
</div>

<div id="ds" class="tabcontent">
<?php

echo '<table width="479" cellspacing="0" cellpadding="2" border="0">';

$featured_news = mysql_query("SELECT * from ccms_news where featured='1' and platform='ds' order by id desc limit 10");
$c = 1;
while ($row = mysql_fetch_assoc($featured_news)) {

$title_start = preg_replace('/[^a-zA-Z0-9 *]/', '', $row[title]);
$title_seo = str_replace(' ', '-', $title_start);

if($odd = $c%2 ) {
$style = "#3A3A3A";
} else {
$style = "#2E2E2E";
}

echo '
<tr>
<td width="479" bgcolor="'.$style.'" height="67" valign="middle" style="padding-top: 1px;border-bottom: 1px solid #272727">

<table cellpadding="0" cellspacing="0" border="0" width="99%" align="center">
<tr>
<td width="1%"><a href="story-'.$row[id].'-'.$title_seo.'.html"><img alt="'.$row[title].'" align="left" src="thumbnailer.php?type=featured_news&image='.$row[image].'" style="border: 1px solid #B6B6B6;" width="78" height="60"></a></td>
<td width="99%" valign="top" style="padding: 5px;">
<a href="story-'.$row[id].'-'.$title_seo.'.html" class="featured_sect">'.$row[title].'</a><br />
<a class="prev_news">'.$row[prev_news].'</a>
</td>
</tr>
</table>

</td>
</tr>';

$c++;
}


echo '</table>';
?>
</div>

</div>

Re: Problem with site

Posted: Sun Jun 01, 2008 3:41 pm
by califdon
Please do not post the same question twice within less than an hour! In fact, don't post twice ever!