Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Categories and multi-categories
26-03-2011, 04:33 PM
Post: #1
Categories and multi-categories
Can some one show how to add categorie bolow every video, and admin can you add to choose multy categories for videos?

Regards
svetoslav

My sites are closed. Google disconnect them and i loose all users.
Visit this user's website Find all posts by this user
Quote this message in a reply
26-03-2011, 04:46 PM (This post was last modified: 27-03-2011 05:12 AM by Punktured.)
Post: #2
RE: Categories and multi-categories
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.

Custom HTML/CSS/PHP
http://theorderofindividualacceptance.co...p.php?id=1
Find all posts by this user
Quote this message in a reply
26-03-2011, 06:11 PM (This post was last modified: 27-03-2011 05:13 AM by Punktured.)
Post: #3
RE: Categories and multi-categories
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.

My sites are closed. Google disconnect them and i loose all users.
Visit this user's website Find all posts by this user
Quote this message in a reply
26-03-2011, 06:43 PM
Post: #4
RE: Categories and multi-categories
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.

Custom HTML/CSS/PHP
http://theorderofindividualacceptance.co...p.php?id=1
Find all posts by this user
Quote this message in a reply
27-03-2011, 01:04 AM
Post: #5
RE: Categories and multi-categories
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
Find all posts by this user
Quote this message in a reply
27-03-2011, 01:54 AM
Post: #6
RE: Categories and multi-categories
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.

Custom HTML/CSS/PHP
http://theorderofindividualacceptance.co...p.php?id=1
Find all posts by this user
Quote this message in a reply
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
27-03-2011, 11:21 AM
Post: #8
RE: Categories and multi-categories
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>';

My sites are closed. Google disconnect them and i loose all users.
Visit this user's website Find all posts by this user
Quote this message in a reply
27-03-2011, 12:06 PM
Post: #9
RE: Categories and multi-categories
can you send me your site URL in private message please, so i can see what you mean.

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 


Forum Jump: