Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Categories and multi-categories
27-03-2011, 05:38 AM
Post: #7
RE: Categories and multi-categories
ok, well, you know how to add "date added" so i will show code just to add category.
there is 2 lines which need replaced, and replaced with extra code.


line 1 , replace:
Code:
$data=$data.'<td  valign="top"><a  href="'.$root_url.$linki.'"><div align="center"><img multiple_thumbnail_url="g" class="video-thumb" border="0" src="'.$root_url.'img/thumb/'.$row['v_id'].'_0.jpg" num="'.$row['num'].'" id="thumb'.($i+1).'" alt="'.urldecode($row['title']).'" width="160" height="120" /></div>'.urldecode($row['title']).'</a></td>';

with this:

Code:
$cat_id = $row['category'];
$sql_sorgu3="Select * from category where `id` = '$cat_id'";
$result3 = mysql_query($sql_sorgu3);
while($row3 = mysql_fetch_array($result3))
  {
$category = $row3['category'];
}
$data=$data.'<td  valign="top"><a  href="'.$root_url.$linki.'"><div align="center"><img multiple_thumbnail_url="g" class="video-thumb" border="0" src="'.$root_url.'img/thumb/'.$row['v_id'].'_0.jpg" num="'.$row['num'].'" id="thumb'.($i+1).'" alt="'.urldecode($row['title']).'" width="160" height="120" /></div>'.urldecode($row['title']).'</a><br>Category: '.$category.'</td>';




line 2 , replace:
Code:
$data=$data.'<td  valign="top"><a  href="'.$root_url.$linki.'"><div align="center"><img multiple_thumbnail_url="g" class="video-thumb" border="0" src="'.$root_url.'img/thumb/'.$row['v_id'].'_0.jpg" num="'.$row['num'].'" id="thumb'.($i+1).'" alt="'.urldecode($row['title']).'" width="160" height="120" /></div>'.urldecode($row['title']).'</a></td>';

with this:

Code:
$cat_id = $row['category'];
$sql_sorgu3="Select * from category where `id` = '$cat_id'";
$result3 = mysql_query($sql_sorgu3);
while($row3 = mysql_fetch_array($result3))
  {
$category = $row3['category'];
}
$data=$data.'<td  valign="top"><a  href="'.$root_url.$linki.'"><div align="center"><img multiple_thumbnail_url="g" class="video-thumb" border="0" src="'.$root_url.'img/thumb/'.$row['v_id'].'_0.jpg" num="'.$row['num'].'" id="thumb'.($i+1).'" alt="'.urldecode($row['title']).'" width="160" height="120" /></div>'.urldecode($row['title']).'</a><br>Category: '.$category.'</td>';

Custom HTML/CSS/PHP
http://theorderofindividualacceptance.co...p.php?id=1
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Categories and multi-categories - Punktured - 27-03-2011 05:38 AM

Forum Jump: