Webmastersite.net
Register Log In

Remodeling "displaylinks.tpl"
Changing the layout inside categories

Comments on Remodeling "displaylinks.tpl"

finsandfur
Forum Regular

Usergroup: Customer
Joined: Apr 18, 2006

Total Topics: 28
Total Comments: 103
Posted Sep 13, 2009 - 12:37 PM:

I'm in need of some advice while I remodeling my display links pages.

I added a link type called "Sponsor", and then I created an image to display next to the link title, like the current star which is used for "recips".

Then I added a line to the "linkbit.tpl" to render it on the display links page for sponsored links.

I've got the default sort order set to display "Sponsors" first, then "Recips", and then "Standard".

What I would like to do now is strip everything off the the "Standard" links except for the link title, and the link description, and they will be displayed last, preferable in a list fashion.

I'm thinking this might encourage people to submit a Reciprocal or Sponsoring link, since they will have much nicer and detailed listings.

But I'm not sure of the best way to go about it. Create a whole new linkbit file, rename it and call it from the standard links?

Or...make the adjustments in the current linkbit.tpl to do it.
babrees
Expert

Usergroup: Customer
Joined: Aug 19, 2005
Location: England

Total Topics: 391
Total Comments: 1303
babrees
Posted Sep 13, 2009 - 1:50 PM:

Yes, I have different displays for each link type I have and I created a whole new linkbit file for each link type. That to me is the easiest way.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Sep 13, 2009 - 6:00 PM:

I'd just make the adjustments in the displaylinks.tpl, search.tpl and searchall.tpl. The purpose of the link bit is to be able to control all the types in the same spot. Since you want them different enough that using conditionals to differentiate them isn't practical, there's no point in the link bit for you.

Just use
<ul>
<!-- BEGIN REGULAR -->
<li><a href="{TRACKLINKURL}">{LINKTITLE}</a> - {LINKDESCRIPTION}</li>
<!-- END REGULAR -->
</ul>

directly.

Though if you expect to change it a lot, using new link bits would allow you to update displaylinks and search at the same time.
finsandfur
Forum Regular

Usergroup: Customer
Joined: Apr 18, 2006

Total Topics: 28
Total Comments: 103
Posted Sep 14, 2009 - 2:44 PM:

I'm not sure whats causing it, but that code snippet makes a a duplicate listing for any recips in a category and lists them below. And no regular links

Any category without a recip, and the code is ignored, and no regular links.
finsandfur
Forum Regular

Usergroup: Customer
Joined: Apr 18, 2006

Total Topics: 28
Total Comments: 103
Posted Sep 14, 2009 - 5:11 PM:

Nope, something is wrong somehwere. I've tried everthing I could come up with. And all it does it copy the sponsors and list them again at the bottom.

It shows that there are x amount of regular links in the category stats box though.

Something else I just noticed, even though my new link type "Sponsor" is edited into both the search and searchall templates....I can search a sponsor link by the exact name of the link and the results come up zero.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Sep 15, 2009 - 12:12 AM:

It's actually BEGIN/END REGULAR LINKS in the displaylinks template, replacing the already-existing copy. The code I gave would be right for the search links page.

Post the content of any templates that aren't working for you.
finsandfur
Forum Regular

Usergroup: Customer
Joined: Apr 18, 2006

Total Topics: 28
Total Comments: 103
Posted Sep 15, 2009 - 3:39 AM:

That did it right there Paul.

At the risk of looking like an idiot, I got to add that I never realized the browser read and utilized the comments like that. I never imagined that would effect it.

I've seen some helacous comments in scripts and always assumed they were more or less for the authors.

Guess I learned something.

My only issue now is that my sponsor links still dont show up in a search results. I dont know if you'd rather I opened a new topic, verses tainting this one with a different subject or not.
finsandfur
Forum Regular

Usergroup: Customer
Joined: Apr 18, 2006

Total Topics: 28
Total Comments: 103
Posted Sep 15, 2009 - 7:37 PM:

After doing some more trial and error, I've discovered that Recips, and Sponsors both are excluded from any search results.

I know now the reason has to be staring me right in the face, but I can't for the life of me see it. Paul would you rather I created a new topic on this?
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Sep 15, 2009 - 8:50 PM:

I never realized the browser read and utilized the comments like that.

The browser doesn't. WSN Links does.

Just post your search.tpl and I'll see what the issue is.
finsandfur
Forum Regular

Usergroup: Customer
Joined: Apr 18, 2006

Total Topics: 28
Total Comments: 103
#10 - Quote - Permalink
Posted Sep 16, 2009 - 4:00 AM:

Thanks Paul

{NAVIGATION}

<IF {NUMRESULTS}>
<p>{NUMRESULTS} matching results for "{SEARCHTERM}"<IF {REFINE}> refined with "{REFINE}"</IF>:</p>

<form action="search.php?{ALLVARS}" method="post">
<div class="sort">
Sort by
<select name="orderfield">
<option value="id">newest</option>
<option value="lastedit">last edited</option>
<option value="title">title</option>
<IF {SWITCH_RATINGS}>
<option value="rating">rating</option>
<option value="votes">votes</option>
</IF>
<IF {SWITCH_HITS}><option value="hits">hits out</option></IF>
<IF {SWITCH_HITSIN}><option value="hitsin">hits in</option></IF>
<IF {SWITCH_COMMENTS}><option value="numcomments">comments</option></IF>
<IF {SWITCH_PAGERANK}><option value="pagerank">pagerank</option></IF>
</select>
<select name="orderascdesc">
<option value="asc">ascending</option>
<option value="desc">descending</option>
</select>
<input type="submit" value="Sort" class="button" >
</div>
</form>
</IF>

<table {STANDARDTABLE}>
<!-- BEGIN SEARCH links RESULTS -->
<!-- BEGIN SPONSOR -->
[INSERTFILE=linkbit]
<!-- END SPONSOR -->
</table>
<table {STANDARDTABLE}>
<!-- BEGIN SEARCH links RESULTS -->
<!-- BEGIN RECIP -->
[INSERTFILE=linkbit]
<!-- END RECIP -->
</table>
<table {STANDARDTABLE}>
<ul>
<!-- BEGIN REGULAR -->
<li><a href="{TRACKLINKURL}">{LINKTITLE}</a> - {LINKDESCRIPTION}</li>
<!-- END REGULAR -->
</ul><!-- END SEARCH links RESULTS -->
</table>

{PAGINATION}

<div align="center">
<form action="search.php?{ALLVARS}" method="post">
Narrow results to results containing <input type="text" name="refine" size="15" > <input type="submit" value="Refine" class="button" >
</form>
</div>
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
#11 - Quote - Permalink
Posted Sep 16, 2009 - 4:38 PM:

You've got two <!-- BEGIN SEARCH links RESULTS --> spots there. Remove the second one.

Try
{NAVIGATION}

<IF {NUMRESULTS}>
<p>{NUMRESULTS} matching results for "{SEARCHTERM}"<IF {REFINE}> refined with "{REFINE}"</IF>:</p>

<form action="search.php?{ALLVARS}" method="post">
<div class="sort">
Sort by
<select name="orderfield">
<option value="id">newest</option>
<option value="lastedit">last edited</option>
<option value="title">title</option>
<IF {SWITCH_RATINGS}>
<option value="rating">rating</option>
<option value="votes">votes</option>
</IF>
<IF {SWITCH_HITS}><option value="hits">hits out</option></IF>
<IF {SWITCH_HITSIN}><option value="hitsin">hits in</option></IF>
<IF {SWITCH_COMMENTS}><option value="numcomments">comments</option></IF>
<IF {SWITCH_PAGERANK}><option value="pagerank">pagerank</option></IF>
</select>
<select name="orderascdesc">
<option value="asc">ascending</option>
<option value="desc">descending</option>
</select>
<input type="submit" value="Sort" class="button" >
</div>
</form>
</IF>

<!-- BEGIN SEARCH links RESULTS -->
<table {STANDARDTABLE}>
<!-- BEGIN SPONSOR -->
[INSERTFILE=linkbit]
<!-- END SPONSOR -->
</table>
<table {STANDARDTABLE}>
<!-- BEGIN RECIP -->
[INSERTFILE=linkbit]
<!-- END RECIP -->
</table>
<table {STANDARDTABLE}>
<ul>
<!-- BEGIN REGULAR -->
<li><a href="{TRACKLINKURL}">{LINKTITLE}</a> - {LINKDESCRIPTION}</li>
<!-- END REGULAR -->
</ul>
</table>
<!-- END SEARCH links RESULTS -->
{PAGINATION}

<div align="center">
<form action="search.php?{ALLVARS}" method="post">
Narrow results to results containing <input type="text" name="refine" size="15" > <input type="submit" value="Refine" class="button" >
</form>
</div>
finsandfur
Forum Regular

Usergroup: Customer
Joined: Apr 18, 2006

Total Topics: 28
Total Comments: 103
#12 - Quote - Permalink
Posted Sep 17, 2009 - 3:49 AM:

Thanks Paul

Wow, I'd have thought that as many times as I compared templates I would have caught that

But that still didnt seem to fix the whole issue. Recips show up in search results now but the Sponsor links are still not included.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
#13 - Quote - Permalink
Posted Sep 17, 2009 - 11:27 PM:

Must be a setting issue for sponsor. You're sure "sponsor" is the official type name listed at Admin -> Settings -> Links? Have you selected to mix types or not? On the sponsorship page, have you selected to separate sponsors?
finsandfur
Forum Regular

Usergroup: Customer
Joined: Apr 18, 2006

Total Topics: 28
Total Comments: 103
#14 - Quote - Permalink
Posted Sep 18, 2009 - 9:10 PM:

Sponsor is the official name and type.

Types are mixed, yes

And the sponsorship setting was set to sperate sponsors, and I changed it to "no"

With that being the only change, it seems to work. Sponsors are coming up in the search results now.

I appreciate the help.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
#15 - Quote - Permalink
Posted Sep 25, 2009 - 9:13 AM:

Works for me with the sponsor separation on, maybe the sponsor type isn't in your "search links" (search.tpl) template.
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



Sorry, you don't have permission to post posts. Log in, or register if you haven't yet.