Results 1 to 5 of 5

Thread: 2 rows.html templates

  1. #1
    Join Date
    Sep 2002
    Posts
    60

    Default 2 rows.html templates

    Hi Guys,

    I've got a fairly simple question, what i'm trying to do is create two different styles for rows.html.

    Bascally i need one style for banner links and one for text links. I've created two html templates

    rows.html and
    rows_text.html

    I've inserted this php into browse.php on line 141

    if {($link_type == "banner"; )
    $links_obj->template_file = $theme_path."rows.html"; )
    } else {
    $links_obj->template_file = $theme_path."rows_text.html"; )
    }

    My php isn't the best, i admit, and i'm getting up a parse error mising `'(" on my top line. I think i may have part of the code correct, there again i may not.

    ESM, i know this is right up your street, so if you have any ideas let me know, or anybody else for that matter!

    Thanks in advance

    Rob

  2. #2
    Join Date
    Aug 2002
    Location
    Germany
    Posts
    1,180

    Default ?

    Hello,

    how want you tellthe script which template it should take for which link and what is the difference between the templates ?

    For me it seems easier to take some more link fields and you chose what you want, banner or textlink and in the template both side by side and if one is empty it is no problem.

    Frank

  3. #3
    Join Date
    Apr 2003
    Location
    Atlanta GA
    Posts
    3,395

    Default Re: 2 rows.html templates

    try this

    if ($link_type == "banner" )
    $links_obj->template_file = $theme_path."rows.html";
    else
    $links_obj->template_file = $theme_path."rows_text.html";

    seems like it should be

    if ($link_type == "banner" )
    $links_obj->template_file = $theme_path."rows_text.html";
    else
    $links_obj->template_file = $theme_path."rows.html";
    Last edited by esm; 12-27-2003 at 06:27 PM.
    esm
    "The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

    .

  4. #4
    Join Date
    Sep 2002
    Posts
    60

    Default

    Hi Guys,

    Frank thanks for the feedback, i see what you are saying the problem i have is that the banners are not uploaded onto our webserver, they are been called from the advertisers server, so in order to have it working correctly i need to use the <img src="....."> tag in rows.html to ensure the banner is called up correctly, and those sites that are adding text links have no banner and although i can add a fill.gif to cover up the no image part it throws the rest of the advert out.

    Also if this system works is could be a money spinner for other indexu users out there as you may be able to create two or three different templates for your listings. This project is for a client but one of the projects my company runs uses the iweb hyperseek system and we can create as many listing templates as we want, and its proving a real hit with many customers.

    Thanks for the input.

    Rob

    ESM,

    I thought you'd have an idea My php has been improving i'm seriously getting into it and i think it shows cause i wasn't to far off this time! ha ha

    Unfortunatly however the system is only calling up rows.html. I made one alteration and changed "banner" for "text" and the code is below:

    if ($link_type == "text" )
    $links_obj->template_file = $theme_path."rows_text.html";
    else
    $links_obj->template_file = $theme_path."rows.html";

    So my guess is that either i need to alter another bit of code somewhere, to make the system recognise the alternative template or, my other guess is that the system is not looking in the links table where the $link_type field is stored. I may be wrong and more than likely am, but its all i can think of.

    Any ideas?

    Thanks again,

    Rob

  5. #5
    Join Date
    Apr 2003
    Location
    Atlanta GA
    Posts
    3,395

    Default

    well, the first thing is is there a field in the idx_table called link???

    Next is that I don't think you can use it there. That section of code deals only with sponsored links. If you do not have any sponsored links ( see line 130; sp_cat = 1 ), nothing will print for them.

    For listings in general, you have to use the Display function in link.class.php ( or you could create you own browse.php using one of my "show_xxxx.php" files at my site. It would be easy to do ).

    Finally, the above code will work but it depends on what the actual value is in the field. Assuming you have two types of links, one is your "standard" link and the other is your "advertising" link.

    There has to be the same value in that field for ALL the standard links, and not the advertising links, for the above code to work. You can then test for that value.

    Alternatively, you could have the same value in that field for ALL the advertising links, and not the standard links. You could then test for that value.

    If both the standard links and the adverstising links have a unique value, then you you could test for either value.
    esm
    "The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

    .

Similar Threads

  1. Templates
    By richhead in forum v3.2
    Replies: 9
    Last Post: 09-09-2003, 02:44 AM
  2. Templates for sale
    By Veg in forum Templates
    Replies: 26
    Last Post: 08-09-2003, 08:41 AM
  3. Templates
    By richhead in forum v5.x
    Replies: 19
    Last Post: 07-07-2003, 02:53 AM
  4. NEW INDEXU THEME Templates
    By Hart_House in forum Templates
    Replies: 8
    Last Post: 02-27-2003, 07:36 PM
  5. Different Browse.htm templates
    By Shophere in forum v5.x
    Replies: 0
    Last Post: 09-10-2001, 03:05 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •