Free Adult Tube-Video Script Forum

Full Version: Categories and multi-categories
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Can some one show how to add categorie bolow every video, and admin can you add to choose multy categories for videos?

Regards
svetoslav
you would have to edit the function which shows the videos.

there are two lines which you would have to edit.

CODE REMOVED

NOTE:
I do not currently have a site up, so this code is untested.
It is also a wise idea, to save a copy of the original functions.php file before making changes to it.




As for multiple categories, maybe you can add that into the requests forum.
I try it but shows only number of category Sad
I add '<br>added:'.urldecode($row['tarih']).'

Kind Regards
Svetoslav

PS: Congratulations for position you earn!!! Wish you well.

(26-03-2011 04:46 PM)Punktured Wrote: [ -> ]you would have to edit the function which shows the videos.

there are two lines which you would have to edit.

CODE REMOVED

NOTE:
I do not currently have a site up, so this code is untested.
It is also a wise idea, to save a copy of the original functions.php file before making changes to it.




As for multiple categories, maybe you can add that into the requests forum.
oh ok, sorry about that.
i forgot how the mysql table was.

i havent got a site so i cant make the proper code you want,
because i cant test it.

by the way, tarih is not url encoded so you dont need to decode it.
tarih=date
at mysql in table video fiield=category is an id that shows the id nuber of category table id number
so you must to connect category field to find the category name
yea, when i did have my site,
i did have the code for this, because i did it on my own site.

but i dont have the site anymore, and i have nowhere to test code,
so i rather not post anymore untested code at this time.

when i find a free-adult-host and get a site up,
i will re-do the code and post it here.
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>';
It works perfect, but it not conver text in utf-8 and show some signs Sad
Thank you in advance Smile



(27-03-2011 05:38 AM)Punktured Wrote: [ -> ]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>';
can you send me your site URL in private message please, so i can see what you mean.
Reference URL's