Author Topic: template code help?  (Read 1394 times)

0 Members and 1 Guest are viewing this topic.

Offline nulineum

  • Newbie
  • *
  • Posts: 7
  • Karma: +1/-0
    • View Profile
template code help?
« on: August 20, 2013, 03:20:14 AM »
i want to make some changes to the index. currently, it has links to categories and subcategories. instead, where the subcategories are displayed, i want to replace this with the most recent 20 site links added to each specific category (15 categories + new, popular, top rated = 18 link sections total).  i'm having trouble determining the proper code format to get these to display properly.  can you help me?

Offline nulineum

  • Newbie
  • *
  • Posts: 7
  • Karma: +1/-0
    • View Profile
Re: template code help?
« Reply #1 on: August 21, 2013, 05:01:58 AM »
anyone who wouldn't mind giving me some assistance with getting this code right, shoot an e-mail to qon@onprobation.com - thanks!

Offline nulineum

  • Newbie
  • *
  • Posts: 7
  • Karma: +1/-0
    • View Profile
Re: template code help?
« Reply #2 on: August 22, 2013, 04:38:40 AM »
ok...let's do it this way: can anyone tell me what's wrong with my formatting in the code below:


<!----------------------------------------------->
{links var=regular_links type=regular amount=20 category=180 order="RAND()"}   
{* Only show if this category has 1 or more links *}
{if count($regular_links) > 0}
{foreach var=link from=$regular_links}
<tr>
<td width="202" bgcolor="{cycle values="#d4e1ee,#ededed"}"><span class="style15">
<img width="14" height="14" src="http://www.onprobation.com/images/folder.gif"/>   
<a href="{$link.site_url|htmlspecialchars}">{$link.title|htmlspecialchars}[/url]</span></td>
</tr>
{/foreach}
{/if}
<!----------------------------------------------->

Offline Chad

  • Administrator
  • Full Member
  • ***
  • Posts: 215
  • Karma: +27/-0
    • View Profile
Re: template code help?
« Reply #3 on: August 23, 2013, 03:46:50 PM »
I'm setting up LinkX on my dev server now.  Will post back to you in a bit.

Offline Chad

  • Administrator
  • Full Member
  • ***
  • Posts: 215
  • Karma: +27/-0
    • View Profile
Re: template code help?
« Reply #4 on: August 24, 2013, 06:25:29 PM »
Still working on this.  Will try again later tonight.  My hunch is that this:

Code: [Select]
{if count($regular_links) > 0}

is not valid template code.

Offline nulineum

  • Newbie
  • *
  • Posts: 7
  • Karma: +1/-0
    • View Profile
Re: template code help?
« Reply #5 on: August 24, 2013, 11:32:21 PM »
removed that part of the code and the remaining causes this error...

<!---------------------------------------------------------->
Warning: Division by zero in /web/sites/ebony2/onprobation/includes/mysql.class.php on line 127

Fatal error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-0,' at line 1
SELECT * FROM lx_links JOIN lx_link_cats USING (link_id) WHERE category_id=? AND type!='featured' AND status='active' ORDER BY sorter LIMIT -0, in /web/sites/ebony2/onprobation/includes/mysql.class.php on line 101
<!---------------------------------------------------------->

Unofficial JMB Support Forums

Re: template code help?
« Reply #5 on: August 24, 2013, 11:32:21 PM »


Tags:
 

Related Topics

  Subject / Started by Replies Last post
10 Replies
2196 Views
Last post December 14, 2012, 04:01:00 PM
by Rockhound
2 Replies
1065 Views
Last post December 16, 2013, 02:38:20 PM
by mac500
0 Replies
559 Views
Last post January 29, 2014, 05:40:02 PM
by scully
0 Replies
784 Views
Last post May 12, 2014, 04:05:19 PM
by Robbie
0 Replies
1343 Views
Last post March 05, 2015, 12:52:49 PM
by chrisfc61

anything