Webmastersite.net
Register Log In

Forcing display order within catagories
Its a shame I cant write script by telepathy!

Comments on Forcing display order within catagories

Bren
Member

Usergroup: Customer
Joined: Jul 16, 2007

Total Topics: 4
Total Comments: 17
Bren
Posted Jul 25, 2007 - 7:28 PM:

I have a number of items I need to do/customize, I would prefer to do them myself, but some of this stuff way is over my head.... I have already searched thru the forum and gotten as far as I can with the info I have found

Here is what Im looking to do (Paul, please note...I may be paying you for most/all this smiling face btw...On a little side note, those of you reading this, Paul has done a little paid work on my site, and if your wondering about using his services, I would recommend him, without hesitation.

Here we go, Im looking for modifications for the order the links display "within a category", I have created a number of different link types (I got that far)
I want the link type order to be (decending)
platinum
gold
silver
bronze
regular
reciprocal


if someone clicks into a category I want the links to display all platinum links first then after platinum, the gold links ....ect.... Each level of link would have different formatting ..... example... platinum links would get a graphic saying it was a featured link, bold text ....., a gold link type might have a star graphic, Italic text... hopefully your getting the idea. As each level would have different formatting, I know thats possible, but Im not sure at this point where to edit to get the different link type formats created, do I create a templet for each type? if so where would they go? how do I reference them?

Next within EACH of those link types... for example: lets say I have 10 platinum links... I want to be able to set the display order manually in admin for those 10 links (in other words someone payed more for position 1 than position 10)..
I have already added a custom field to the link listing called customer ID, so I can use that to sort the display links show within a category, but I need the links displaying in an order set by me, within thier link type

This is where the logic arguments get over my head
I need it to display a platnum link type first in the catagory listing, in a specific order set by me
then the gold links are displayed, in a specific order set by me
then the silver....ect


there is also another aspect of this that I need to consider, that concerns webmasters that want to submit their site(s) to the index.... I have created a webmaster usergroup, and I want a webmaster to be able to submit his site, or sites to the index, and have the option to choose a different link type for each site submitted... each type would represent a different amount of $$$ with the exception of a reciprocal link, that would be free, I would also prefer to be able to offer a free upgrade to a "regular" link type to help get the site loaded up with links, initially then after i can afford to be a bit picky, and ive got some good traffic going, ad a fee back in to the regular catagory

Bottom line with all of this is.. am I trying to do something that can easily (for you Paul...lol) be accomplished with some templet editing, thats simply over my head, or (thought I doubt it) am I asking too much from the script, without a major rewrite of code.

my other question is am i trying to reinvent the wheel.... I know what I need to script to do...Im simply not sure if Im going about it in the most efficient way?
Paul
developer

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

Total Topics: 61
Total Comments: 7868
Paul
Posted Jul 26, 2007 - 8:06 PM:

I want the link type order to be (decending)

If you select to not mix link types (Admin -> Settings -> Links), the link type order is the same order as you write them in the template.

Im not sure at this point where to edit to get the different link type formats created, do I create a templet for each type?

No, you copy the existing code which your "show links in category" template already uses for regular and reciprocal link types:

<IF {SHOWRECIP}>
<table width="100%" cellpadding="5" cellspacing="10">
<!-- BEGIN RECIP LINKS -->
<td {LINKWIDTH} valign="top" class="link">
<img src="templates/default/images/star.gif" alt="reciprocal">
<IF {LINKURL}>
<a href="{TRACKLINKURL}" class="reciplink" {EXTERNALLINKS}>{LINKTITLE}</a>
<OTHERWISE>
{LINKTITLE}
</IF>
{LINKNEW} {LINKISUPDATED} <IF {LINKISREAD}><img src="templates/default/images/visited.gif" alt="viewed" title="Already Viewed"></IF> {LINKADMIN}
<IF {SWITCH_RATINGS} and {LINKRATING}><br><img src="templates/default/images/stars{LINKNUMSTARS}.gif" alt="{LINKRATING} out of {MAXVOTE} stars" title="{LINKRATING} out of {MAXVOTE} stars"> ({LINKVOTES} votes)</IF>
<IF {SWITCH_PAGERANK}><br><img src="templates/default/images/pagerank/{LINKPAGERANK}.gif" alt="PageRank {LINKPAGERANK}" title="PageRank {LINKPAGERANK}"></IF>
<br>{LINKDESCRIPTION}

<div class="linktools">
<br>Submitted {LINKDATE}<IF {LINKLASTEDIT} is greater than {LINKTIME}>, edited {LINKLASTEDITDATE}</IF>. <br>
<IF {SWITCH_HITS}>{LINKHITS} hits outgoing, {LINKHITSIN} incoming.<br></IF>
<br>
<a href="{LINKDETAILSURL}"><img src="templates/default/images/linktools_details.gif" border="0" alt="Details"> Details</a>
<IF {SWITCH_RATINGS}><a href="vote.php?id={LINKID}"><img src="templates/default/images/linktools_rate.gif" border="0" alt="Rate"> Rate</a></IF>
<IF {SWITCH_REPORTS}><a href="report.php?id={LINKID}"><img src="templates/default/images/linktools_report.gif" border="0" alt="Report"> Report</a></IF>
<IF {THISMEMBERGROUPCANEMAIL}><a href="email.php?id={LINKID}"><img src="templates/default/images/linktools_emaillink.gif" border="0" alt="Email Link"> E-Mail Link</a></IF>
<IF {THISMEMBERGROUPCANEMAILMEMBERS} and {LINKHASEMAIL}><a href="emailsubmitter.php?id={LINKID}"><img src="templates/default/images/linktools_emailsubmitter.gif" border="0" alt="Email Submitter"> E-Mail Submitter</a></IF>
<IF {SWITCH_SAVEDLINKS} and {THISMEMBERISREGISTERED}><a href="savedtopics.php?add={LINKID}"><img src="templates/default/images/linktools_save.gif" border="0" alt="Save"> Save</a></IF>
<IF {SWITCH_COMMENTS} and not {SWITCH_DETAILCOMMENTS}><a href="{LINKTHREADURL}"><img src="templates/default/images/linktools_comments.gif" border="0" alt="Comments"> Reviews (<IF {LINKCOMMENTSREAD}>{LINKNUMCOMMENTS}<OTHERWISE><b>{LINKNUMCOMMENTS}</b></IF>)</a></IF>

</div>

<IF {LINKFILEFIELD}><br>Attached files:<br>
<!-- BEGIN LINK ATTACHMENTS -->
<a href="download.php?id={LINKID}&attachid={ATTACHID}">{ATTACHFILETITLE}</a> ({ATTACHKB} KB, {ATTACHDOWNLOADS} downloads)<br>
<IF {ATTACHISIMAGE}><a href="download.php?id={LINKID}&attachid={ATTACHID}"><img src="{ATTACHTHUMBURL}" alt="image"></a><br></IF>
<!-- END LINK ATTACHMENTS -->
</IF>

</td>
<!-- END RECIP LINKS -->
</table>
</IF>


Copy and change the names to that of the link types you're using.

Same idea applies to the "search links" and "search all" templates.

I want to be able to set the display order manually in admin for those 10 links (in other words someone payed more for position 1 than position 10)..

Do you want it ordered by funds (in which case select that order) or manually? If manually, create a new link field (Admin -> Customizations -> Add Fields), let's call it sortorder, and order by that. Then edit links to put numbers in it to indicate the order.

I want a webmaster to be able to submit his site, or sites to the index, and have the option to choose a different link type for each site submitted... each type would represent a different amount of $$$ with the exception of a reciprocal link, that would be free

They always have the option to choose unless you edit that out of the template. To change what the types display as, go to Admin -> Settings -> Links and type the desired display names in the box at the top.

I would also prefer to be able to offer a free upgrade to a "regular" link type to help get the site loaded up with links, initially then after i can afford to be a bit picky, and ive got some good traffic going, ad a fee back in to the regular catagory

Not sure what you mean by that. They start in some other group and have to upgrade to regular? Would you be doing these upgrades manually? Why make them go to the trouble of upgrading if it's free?
Bren
Member

Usergroup: Customer
Joined: Jul 16, 2007

Total Topics: 4
Total Comments: 17
Bren
Posted Jul 28, 2007 - 7:35 PM:

I have gotten as far as creating the new type and added it into the
"show links in category" template in the position I want it to display .. at least the first one...

I have figured out how to change the image the shows b4 the link listing
but the thing im having a hard time with is customizing the text

For example if i want the platinum link to be displayed in bold and increase the text size

again for example sake... say I want the description of the link to be in italic, and a specific font size, and font type

how exactly would i do that... if you could edit the section below
to reflect the above formatting changes... I can go from there..im just not sure what commands to use, and exactly where to put them, Ive tried for a couple of hours and have gotten nowhere

in addition I was looking at class="link" is that a way to assign specific attributes to the way in with a link displays... I could find virtually no info about the class="link" and what i could use it for, and where and how i would add additional class types ... even if what Im trying to accomplish has nothing to do with the class="link" I would appreciate a bit of info on what its for and when its used

additionally.... what templet language are you using?...this doesn't look like a smarty templet to me, and I couldn't find a reference in the manual to what it was...so I don't know what to google to find a list of standard commands for the templet




<IF {SHOWPLATINUM}>
<table width="100%" cellpadding="5" cellspacing="10">
<!-- BEGIN PLATINUM LINKS -->
<td {LINKWIDTH} valign="top" class="link">
<img src="templates/default/images/feat_1.gif" alt="Featured Link">
<IF {LINKURL}>
<a href="{TRACKLINKURL}" {EXTERNALLINKS}>{LINKTITLE}</a>
<OTHERWISE>
{U_LANG_LINKTITLE}
</IF>
{LINKNEW} {LINKISUPDATED} <IF {LINKISREAD}><img src="templates/default/images/visited.gif" alt="viewed" title="Already Viewed"></IF> {LINKADMIN}
<IF {SWITCH_RATINGS} and {LINKRATING}><br><img src="templates/default/images/stars{LINKNUMSTARS}.gif" alt="{LINKRATING} out of {MAXVOTE} stars" title="{LINKRATING} out of {MAXVOTE} stars"> ({LINKVOTES} votes)</IF>
<IF {SWITCH_PAGERANK}><br><img src="templates/default/images/pagerank/{LINKPAGERANK}.gif" alt="PageRank {LINKPAGERANK}" title="PageRank {LINKPAGERANK}"></IF>
<br>{LINKDESCRIPTION}

<div class="linktools">
<br>
<br>
<IF {LINKDETAILSURL} and {THISMEMBERISREGISTERED}><a href="{LINKDETAILSURL}"><img src="templates/default/images/linktools_details.gif" border="0" alt="Details"> More Info </a></IF>
<IF {SWITCH_RATINGS}><a href="vote.php?id={LINKID}"><img src="templates/default/images/linktools_rate.gif" border="0" alt="Rate"> Rate </a></IF>
<IF {SWITCH_REPORTS}><a href="report.php?id={LINKID}"><img src="templates/default/images/linktools_report.gif" border="0" alt="Report"> Report </a></IF>
<IF {THISMEMBERGROUPCANEMAIL}><a href="email.php?id={LINKID}"><img src="templates/default/images/linktools_emaillink.gif" border="0" alt="Email Link"> E-Mail Link </a></IF>
<IF {SWITCH_SAVEDLINKS} and {THISMEMBERISREGISTERED}><a href="savedtopics.php?add={LINKID}"><img src="templates/default/images/linktools_save.gif" border="0" alt="Save"> Save </a></IF>
<IF {SWITCH_COMMENTS} and not {SWITCH_DETAILCOMMENTS}><a href="{LINKTHREADURL}"><img src="templates/default/images/linktools_comments.gif" border="0" alt="Comments"> Reviews (<IF {LINKCOMMENTSREAD}>{LINKNUMCOMMENTS}<OTHERWISE><b>{LINKNUMCOMMENTS}</b></IF>)</a></IF>

</div>

<IF {LINKFILEFIELD}><br>Attached files:<br>
<!-- BEGIN LINK ATTACHMENTS -->
<a href="download.php?id={LINKID}&attachid={ATTACHID}">{ATTACHFILETITLE}</a> ({ATTACHKB} KB, {ATTACHDOWNLOADS} downloads)<br>
<IF {ATTACHISIMAGE}><a href="download.php?id={LINKID}&attachid={ATTACHID}"><img src="{ATTACHTHUMBURL}" alt="image"></a><br></IF>
<!-- END LINK ATTACHMENTS -->
</IF>

</td>
<!-- END PLATINUM LINKS -->
</table>
</IF>


Paul
developer

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

Total Topics: 61
Total Comments: 7868
Paul
Posted Jul 31, 2007 - 1:28 PM:

again for example sake... say I want the description of the link to be in italic, and a specific font size, and font type

Find {LINKDESCRIPTION} in there. Type your desired HTML around it:
<span style="font-size: 20px; font-family: arial;">{LINKDESCRIPTION}</span>


I could find virtually no info about the class="link" and what i could use it for, and where and how i would add additional class types

It's just CSS, nothing at all specific to the script. The stylesheet is listed at Admin -> Customizations -> Templates -> Styles as well as in templates/styles if you prefer going through your filesystem. If you like you can use your operating system's file search tool to search for instances of each CSS class in the templates directory.

additionally.... what templet language are you using?

Mine. All it consists of is conditionals, template variables and the occasional HTML comment which marks an area to be repeated.

.so I don't know what to google to find a list of standard commands for the templete

Don't. See the manual: various lists of available variables., conditionals.
Bren
Member

Usergroup: Customer
Joined: Jul 16, 2007

Total Topics: 4
Total Comments: 17
Bren
Posted Jul 31, 2007 - 4:09 PM:

ok Im getting there but Im still having a few formatting issues
using my platinum link type as the guinea pig again
I want to "Bold up" the Link title, but, not the link description {LINKDESCRIPTION}

so I floundered around until I got what I pasted below
my issue is <a href="{TRACKLINKURL}" {EXTERNALLINKS}><h4>{LINKTITLE}</h4></a>
bolds it up a bit too much
I dont want the underline gone, I dont want added spacing below it, I simply want it bold, maybe a font size increase (but no other formating change)

<a href="{TRACKLINKURL}" {EXTERNALLINKS}><bold>{LINKTITLE}</bold></a>
does not do anything...but for argument sake...this is what I want
I dont want to change any other formatting other than to bold the link title and maybe increase the font size .....how would I go about doing that?

also where is the list of standard text formatting commands... I cant find it... as in:
h1 - looks like this and is formatted to xx font size, bold
h2 - looks like this and is formatted to xx font size, bold and italic
body is by default ...blah blah blah

something like the above that lays out the standard formatting commands for text? I know I can alter various items from the css, but is there a list showing me what default h1 vs h2 is and what all the other text variables are?

and lastly... would be be easier to create my own heading= set of parameters
as in "h9" or whatever (since i dont know how many heading formats there already are and what they do) and have it be just bold, or whatever

thanks...









-----begin-----

<IF {SHOWPLATINUM}>
<table width="100%" cellpadding="5" cellspacing="10">
<!-- BEGIN PLATINUM LINKS -->
<td {LINKWIDTH} valign="top" class="link">
<img src="{TEMPLATESDIR}/images/feat_1.gif" alt="Featured Link"><br>
<IF {LINKURL}>
<a href="{TRACKLINKURL}" {EXTERNALLINKS}<h4>{LINKTITLE}</h4></a>
<OTHERWISE>
{LINKTITLE}
</IF>
{LINKNEW} {LINKISUPDATED} <IF {LINKISREAD}><img src="{TEMPLATESDIR}/images/visited.gif" alt="viewed" title="Already Viewed"></IF> {LINKADMIN}
<IF {SWITCH_RATINGS} and {LINKRATING}><br><img src="{TEMPLATESDIR}/images/stars{LINKNUMSTARS}.gif" alt="{LINKRATING} out of {MAXVOTE} stars" title="{LINKRATING} out of {MAXVOTE} stars"> ({LINKVOTES} votes)</IF>
<IF {SWITCH_PAGERANK}><br><img src="{TEMPLATESDIR}/images/pagerank/{LINKPAGERANK}.gif" alt="PageRank {LINKPAGERANK}" title="PageRank {LINKPAGERANK}"></IF>
<br>{LINKDESCRIPTION}

-----end-----
Paul
developer

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

Total Topics: 61
Total Comments: 7868
Paul
Posted Aug 01, 2007 - 6:07 AM:

You have H4 around the title, so if you want to change how H4 looks that's what CSS does. You type h4 { font-weight: bold; font-size: 16px; } or whatever to set the style.

something like the above that lays out the standard formatting commands for text? I know I can alter various items from the css, but is there a list showing me what default h1 vs h2 is and what all the other text variables are?

<h4> is a standard HTML tag for which web browsers decide on an appearance. See the w3 page: http://www.w3schools.com/tags/tag_hn.asp

Again there are no "formatting commands" and thus nothing to document, there's only HTML and CSS.

<h4> is anyhow HTML you must've added, since it's not there by default, which makes it confusing that you're asking me about it.

<a href="{TRACKLINKURL}" {EXTERNALLINKS}><bold>{LINKTITLE}</bold></a>
does not do anything...but for argument sake...this is what I want


Again, I very strongly recommend that you learn HTML before trying to make a website. The HTML for bold, though, is <b>.

Here are the w3schools tutorials for HTML and CSS:
http://www.w3schools.com/html/default.asp
http://www.w3schools.com/css/default.asp
Bren
Member

Usergroup: Customer
Joined: Jul 16, 2007

Total Topics: 4
Total Comments: 17
Bren
Posted Aug 01, 2007 - 2:43 PM:

Im not asking what h4 means or is as an entity... if i didn't know something like that I wound not have gotten this far... Im asking what does your standard command YIELD Im looking for a topography reference sheet of what the standard commands will get me ...please see the attached image as an example of what im talking about... that was what i was asking about a list of what the standard topography commands are....and what they yield.....

you told me that this is "your" language....so Im not assuming anything...
i cant google it to find out what your base formatting for text is, for example... should i use : "strong", or an actual "font size" , or "+1" ..if im trying to increase a font size? whats your standard? thats what im trying to find out here, what are your standards and defaults concerning topography commands

also you didnt answer my primary question...seems we got a bit sidetracked,
what im trying to accomplish is...(i have attached a pic of what im trying to accomplish...that should help make this a bit more clear)


------- begin previous example ------

I want to "Bold up" the Link title, but, not the link description {LINKDESCRIPTION}

so I floundered around until I got what I pasted below
my issue is <a href="{TRACKLINKURL}" {EXTERNALLINKS}><h4>{LINKTITLE}</h4></a>
bolds it up a bit too much
I dont want the underline gone, I dont want added spacing below it, I simply want it bold, maybe a font size increase (but no other formating change)

<a href="{TRACKLINKURL}" {EXTERNALLINKS}><bold>{LINKTITLE}</bold></a>
does not do anything...but for argument sake...this is what I want
I dont want to change any other formatting other than to bold the link title and maybe increase the font size .....how would I go about doing that?


thanks...




<IF {SHOWPLATINUM}>
<table width="100%" cellpadding="5" cellspacing="10">
<!-- BEGIN PLATINUM LINKS -->
<td {LINKWIDTH} valign="top" class="link">
<img src="templates/default/images/feat_1.gif" ; alt="Featured Link"><br>
<IF {LINKURL}>
<a href="{TRACKLINKURL}" {EXTERNALLINKS}<h4>{LINKTI TLE}</h4></a>
<OTHERWISE>
{LINKTITLE}
</IF>
{LINKNEW} {LINKISUPDATED} <IF {LINKISREAD}><img src="templates/default/images/visited.gif 4; alt="viewed" title="Already Viewed"></IF> {LINKADMIN}
<IF {SWITCH_RATINGS} and {LINKRATING}><br><img src="templates/default/images/stars{ LINKNUMSTARS}.gif" alt="{LINKRATING} out of {MAXVOTE} stars" title="{LINKRATING} out of {MAXVOTE} stars"> ({LINKVOTES} votes)</IF>
<IF {SWITCH_PAGERANK}><br><img src="templates/default/images/pagerank/{LINKPAGERANK}.gif" alt="PageRank {LINKPAGERANK}" title="PageRank {LINKPAGERANK}"></IF>
<br>{LINKDESCRIPTION}

-----end-----


Attached Files:
babrees
Expert

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

Total Topics: 391
Total Comments: 1303
babrees
Posted Aug 02, 2007 - 12:20 AM:

Hi Bren,

Bren wrote:

you told me that this is "your" language....so Im not assuming anything...
i cant google it to find out what your base formatting for text is, for example... should i use : "strong", or an actual "font size" , or "+1" ..if im trying to increase a font size? whats your standard? thats what im trying to find out here, what are your standards and defaults concerning topography commands


When Paul said it was his language he meant the variables and codes within the {}. Formatting is plain html and css. To make something bold I personally prefer &#60;b&#62; to &#60;strong&#62; - but both would work. Again, with the font-size just use what you normally do in html. For my sites I made a new class for the link title in the css file, as I have a number of different types of links. This is good practice rather than to have a long format change before each title.

Bren wrote:

I want to "Bold up" the Link title, but, not the link description {LINKDESCRIPTION}

so I floundered around until I got what I pasted below
my issue is &#60;a href="{TRACKLINKURL}" {EXTERNALLINKS}&#62;&#60;h4&#62;{LINKTITLE}&#60;/h4&#62;&#60;/a&#62;
bolds it up a bit too much
I dont want the underline gone, I dont want added spacing below it, I simply want it bold, maybe a font size increase (but no other formating change)

&#60;a href="{TRACKLINKURL}" {EXTERNALLINKS}&#62;&#60;bold&#62;{LINKTITLE}&#60;/bold&#62;&#60;/a&#62;
does not do anything...but for argument sake...this is what I want
I dont want to change any other formatting other than to bold the link title and maybe increase the font size .....how would I go about doing that?


You have a choice of how to show this:

&#60;a href="{TRACKLINKURL}" {EXTERNALLINKS}&#62;&#60;b&#62;{LINKTITLE}&#60;/b&#62;&#60;/a&#62;

OR, keep the h4 tag and in your css file add something like...

H4 { font-size: 12px; font-weight: bold; }


In your attached link example, you can not have just part of the description in bold as it is one field - you have ALL the description either bold or not.

Hope this helps a bit

Jill
Bren
Member

Usergroup: Customer
Joined: Jul 16, 2007

Total Topics: 4
Total Comments: 17
Bren
Posted Aug 02, 2007 - 1:46 PM:

Hi Jill
Thanks, thats what I needed to know smiling face

I would very much appreciate it if you could post an example of:

"For my sites I made a new class for the link title in the css file, as I have a number of different types of links. This is good practice rather than to have a long format change before each title."


It would be very helpful & is pretty much the approach I would prefer to take
thanks
Paul
developer

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

Total Topics: 61
Total Comments: 7868
Paul
#10 - Quote - Permalink
Posted Aug 03, 2007 - 3:06 AM:

<a href="{TRACKLINKURL}" class="sometype">{LINKTITLE}</a>

.sometype
{
font-size: 14px;
}
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.