Author Topic: Categories  (Read 950 times)

0 Members and 1 Guest are viewing this topic.

Offline Panda

  • Newbie
  • *
  • Posts: 11
  • Karma: 0
    • View Profile
Categories
« on: April 04, 2010, 05:01:54 AM »
Hello everybody. I've been working on customizing my site and I have a general support question. How many categories can we create in PHPDirector? Is it unlimited? Also is there a way to arrange the categories in alphabetical order when clicking on the categories link? And last, if categories are unlimited, is there a certain number shown and is there a next link below them? Thanks much!

Offline FireDart

  • Project Leader
  • Pro Member
  • *****
  • Posts: 406
  • Karma: 4
    • View Profile
    • FireDart
Re: Categories
« Reply #1 on: April 04, 2010, 03:30:55 PM »
There our unlimited categories
Link is already supplied per category
Find this code in categories.php on line 30:
Code: [Select]
$query_files = mysql_query("SELECT * FROM pp_files WHERE category = $cat_id AND approved = '1'");replace with:
Code: [Select]
$query_files = mysql_query("SELECT * FROM pp_files WHERE category = $cat_id AND approved = '1' ORDER BY ASC");

I believe that should fix it.

Offline Panda

  • Newbie
  • *
  • Posts: 11
  • Karma: 0
    • View Profile
Re: Categories
« Reply #2 on: April 05, 2010, 03:36:41 AM »
I have another question. The max number of categories displayed is 6 according to the code in categories.tpl:
{section name=i loop=$cat step=4 max=6}
I have an ever growing amount of categories and don't want to just simply show all of them on one page, so how can I produce a "next page" link that shows another 6, etc., until the user goes through all categories. Thanks so much!  :)

Offline FireDart

  • Project Leader
  • Pro Member
  • *****
  • Posts: 406
  • Karma: 4
    • View Profile
    • FireDart
Re: Categories
« Reply #3 on: April 05, 2010, 03:50:16 PM »
I believe simply adding this in categories.php will work:
Code: [Select]
<!--Page Tab-->
{* display pagination info *}
<p align="center">
&nbsp;&nbsp;{paginate_prev}&nbsp;&nbsp;{paginate_next}
<br />
{paginate_middle page_limit="20"}
</p>

As the index.php file already has the pagination info.

Offline Panda

  • Newbie
  • *
  • Posts: 11
  • Karma: 0
    • View Profile
Re: Categories
« Reply #4 on: April 05, 2010, 11:55:57 PM »
I placed it in different areas in categories.php and even tried it in categories.tpl and each time it gives me a Smarty Paginate error. I can't seem to get it to work.  :-\

Offline FireDart

  • Project Leader
  • Pro Member
  • *****
  • Posts: 406
  • Karma: 4
    • View Profile
    • FireDart
Re: Categories
« Reply #5 on: April 06, 2010, 01:24:47 AM »
Sorry place:
Code: [Select]
<!--Page Tab-->
{* display pagination info *}
<p align="center">
&nbsp;&nbsp;{paginate_prev}&nbsp;&nbsp;{paginate_next}
<br />
{paginate_middle page_limit="20"}
</p>

in the categories.tpl

and put this in the categories.php:
Code: [Select]
    // assign {$paginate} var
    SmartyPaginate::assign($smarty);
if (isset($_GET["pt"])){
SmartyPaginate::setUrl('index.php?pt='.$_GET["pt"]);
}elseif(isset($_GET["cat"])){
SmartyPaginate::setUrl('index.php?cat='.$_GET["cat"]);
}else{

}

before:
Code: [Select]
$smarty->assign('cat', $result);
$smarty->display('category.tpl');


mysql_close($mysql_link);
?>

See if that works.

Offline Panda

  • Newbie
  • *
  • Posts: 11
  • Karma: 0
    • View Profile
Re: Categories
« Reply #6 on: April 06, 2010, 03:40:05 AM »
Thanks. But it didn't work. I get this:

Warning: Division by zero in /home/videos/public_html/libs/SmartyPaginate.class.php on line 241
Warning: Division by zero in /home/videos/public_html/libs/SmartyPaginate.class.php on line 242

And:

Warning: Smarty error: paginate_middle: total was not set in /home/videos/public_html/libs/Smarty.class.php on line 1095

I tried it in different spots again to see if it would help but it made things worse. Hmmm. I'm stumped.

Offline ultrafoxus

  • Newbie
  • *
  • Posts: 11
  • Karma: 0
    • View Profile
    • sbobet
Re: Categories
« Reply #7 on: June 01, 2010, 03:02:08 PM »
 :D :D very good information