WebmasterSite.net: PHP scripts to enable your creativity
WSN Links PHP Directory Software
PHP Scripts Webmaster Links Support Forums

Register | Forgot Password

Titles above link type entries

Version: 4.0.14
printPrint


Titles above link type entries
Starship-Trooper
Experienced

Usergroup: Customer
Joined: Jan 06, 2007
Total Topics: 33
Total Posts: 84
Posted 02/12/07 - 12:12 PM:
quote post
#1
Hi, I have separated tables for each of my 3 link types, they display beneath each other. I want a title top of each list of links, so from left to right 3 titles. But sometinmes, i don't have a link for every type, so only neccessary titles should be displayed. but i don't get it.


in displaylinks.tpl, i have this:


<div style="float: right; width: 33%;">

<IF {LINKTYPE} is "forum">
<div class="linktype">
<h3>Forums</h3>
</div>
</IF>

<table width="100%" cellpadding="5" cellspacing="10" border="1px">
<!-- BEGIN FORUM LINKS -->


This does not work, as the IF {LINKTYPE} won't recognize anything, because it is not inside the <!-- BEGIN... ...<!-- END.. comments.

But if i put it inside (well i don't need a condition then), it will display the title as often as there are links in. So if the category has 5 links of type "forum", i get the title "Forums" 5 times below each other raised eyebrow


Do u know a workaround?


Starship-Trooper

another Q:
how do i get the subcategory-display on main-page and category pages to reduce to 3 or 4 and then a ",...", so it won't give me a full list? I did not find this topic, but am quite sure i have read about it before.
Paul
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 57
Total Posts: 6316
Posted 02/13/07 - 07:33 PM:
quote post
#2
Don't use quotes in your conditionals.

What you're looking for it totals for the category:
http://scripts.webmastersite.net/wsnlinks/wsnmanu...
To show the total of each type within a category while on the display links page, use {REGULARTOTAL}, {OTHERTYPETOTAL} etc. Elsewhere use CATTYPETOTAL as explained above.


how do i get the subcategory-display on main-page and category pages to reduce to 3 or 4 and then a ",...", so it won't give me a full list?

Admin->Settings->Categories, subcats on main page.

"Do things you love doing, because then it ain't work. Don't do something you don't really enjoy, because you're never going to work hard enough at it." - Bob Young, founder of Red Hat
Starship-Trooper
Experienced

Usergroup: Customer
Joined: Jan 06, 2007
Total Topics: 33
Total Posts: 84
Posted 02/14/07 - 06:22 AM:
quote post
#3
<What you're looking for it totals for the category:

1)Could you be so kind and explain this to me? I did not get it right. To make sure you understand me, i want no link-count as heading of the links, but the "link type display name".
And only once(if i place it below "<!--BEGIN..", the heading will be there as many times as there are links).
And only, if there are links in the cat (if i place it above the "<!--BEGIN.." (without IF), it will also be displayed if there is no content in the category. If i place it with IF, it cannot determine the LINKTYPE as it's not in the "<!--BEGIN..").



<<how do i get the subcategory-display on main-page and category pages to reduce to 3 or 4 and then a ",...", so it won't give me a full list?

<Admin->Settings->Categories, subcats on main page.

2)I tried that before. That did not do it. no changes sad (no cachin problem, i have checked that.)
Starship-Trooper
Experienced

Usergroup: Customer
Joined: Jan 06, 2007
Total Topics: 33
Total Posts: 84
Posted 02/14/07 - 06:31 AM:
quote post
#4
sth like a for.. would probably help. But I'm not into that, so maybe thats just stupid.

To get this displayed:
<div class="linktype">
<h3>Forums</h3>
</div>

I'd have to declare (below <!--BEGIN FORUM..) that this will be only displayed one time, so only for the 1st cycle. ..BUT HOW?
Paul
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 57
Total Posts: 6316
Posted 02/15/07 - 01:26 AM:
quote post
#5
1) If what you want is only show blah if there are links of type x, do <IF {TOTALXLINKS}>blah</IF>. If you want to do something else I don't understand what "no link-count as heading of the links, but the "link type display name"." means. If you're looking for something to show within the scope of a link, http://scripts.webmastersite.net/wsnlinks/wsnmanu... . If not inside, then look at the category variables instead.

2) When you change subcats on the main page, since they're cached, you have to regenerate categories for changes to appear.

"Do things you love doing, because then it ain't work. Don't do something you don't really enjoy, because you're never going to work hard enough at it." - Bob Young, founder of Red Hat
Starship-Trooper
Experienced

Usergroup: Customer
Joined: Jan 06, 2007
Total Topics: 33
Total Posts: 84
Posted 02/15/07 - 03:40 AM:
quote post
#6
1) I guess i cannot explain very good. It seems you do not understand what my problem is. I'll attach 2 screenshots. in one, it shows what happens in a category where there is NO forum link, if i put text ("blah") above <!-- BEGIN FORUM LINKS -->
=> "blah" will still be there, but shouldn't

In the other it will show what happens if there are more than one forum links, and if i put text below <!-- BEGIN FORUM LINKS -->.
=> blah will only be there if there is a forum link, but as often as there are links..



2) that works, TY!

Edited by Starship-Trooper on 02/15/07 - 03:44 AM

Attached Files:
blah_above-BEGIN.gif
(2 KB, 18 downloads)
attachment
blah_below-BEGIN.gif
(8 KB, 20 downloads)
attachment
Paul
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 57
Total Posts: 6316
Posted 02/15/07 - 10:10 PM:
quote post
#7
If you don't want blah there, conditionalize it as I explained in post #2 and post 5. The category type totals are what you want.

"Do things you love doing, because then it ain't work. Don't do something you don't really enjoy, because you're never going to work hard enough at it." - Bob Young, founder of Red Hat
Starship-Trooper
Experienced

Usergroup: Customer
Joined: Jan 06, 2007
Total Topics: 33
Total Posts: 84
Posted 02/16/07 - 03:32 AM:
quote post
#8
i don't get it.

where should i put it?
how?

i put <IF {TOTALLINKTYPEXLINKS}>the linktypeX headline</IF> (in multilanguage displaylinks.tpl) above the <!--BEGIN "linktypeX".. :
=> the headline will also be displayed if there is no link of linktypeX

i put <IF {TOTALLINKTYPEXLINKS}>the linktypeX headline</IF> below the <!--BEGIN "linktypeX".. :
=> the headline will be only there if there is a link of this type. that would be OK if it would only display once. but it displays as many times as there are links of this type.



Is there a variable with which i can determine (outside the <!-- BEGIN linktype..) which link types are in that category i'm currently in?
So i would then write sth like
if linktype x is in this category, write headline <b>linktype x</b>
if linktype y is in this category, write headline <b>linktype y</b>
...

but i don't get {totalXlinks} workin as i told above sad



Edited by Starship-Trooper on 02/16/07 - 03:44 AM
Paul
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 57
Total Posts: 6316
Posted 02/16/07 - 10:06 PM:
quote post
#9
i put <IF {TOTALLINKTYPEXLINKS}>the linktypeX headline</IF> (in multilanguage displaylinks.tpl) above the <!--BEGIN "linktypeX".. :
=> the headline will also be displayed if there is no link of linktypeX


No, it won't. That's the whole point of the conditional. 0 is false.

{SHOWTYPEX} is an alternative syntax which is already in your template, actually.

Edited by Paul on 02/16/07 - 10:12 PM

"Do things you love doing, because then it ain't work. Don't do something you don't really enjoy, because you're never going to work hard enough at it." - Bob Young, founder of Red Hat
Starship-Trooper
Experienced

Usergroup: Customer
Joined: Jan 06, 2007
Total Topics: 33
Total Posts: 84
Posted 02/17/07 - 10:30 AM:
quote post
#10
marvellous.
now it works.

seems i got sth wrong all the tme before, don't know exactly what. I had to play around with it quite a while..

Thank you very much!

Starship-Trooper
Search thread for
Download thread as


You don't have permission to post.

Please login or register.

   
 
© 2008 Paul Knierim. All rights reserved.