Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Jun 2003
Posts: 131
Journeyman
Journeyman
Offline
Joined: Jun 2003
Posts: 131
I posted a question about 10 days ago at the infopop threads board (infopop threads support contains the results and code below) on how I could have the category DESCRIPTIONS displayed on the main page, because threads doesn't display them if you are including the forum titles on the main page, too.

J.C. gave me, after a little interchange, a change of code in ubbthreads.tmpl, i.e., to:

Replace

{$catrow[$c]['CatDesc']}{$catrow[$c]['NotShown']}

with

{$catrow[$c]['CatTitle']} <br / ><span class="forumdescript">{$catrow[$c]['CatDesc']}{$catrow[$c]['NotShown']}</span>

This accomplished the basic purpose, i.e., after the category title, the category description appears in a smaller type. However, there were two problems, one quite significant:

1 - (the somewhat LESS important item) for some reason that I can't easily parse, the description appears in bold, rather than the regular type that the FOUM descriptions appear in, even though they are using the same class, i.e., forumdescript. Any guidance on how to adjust the appearance of the category description to regular font would be appreciated.

2 -(MORE importantly) one of the reasons we want the category descriptions to appear is to provide users with some info about what this category of forums is about, and in some cases a link to more information. However, when I inserted a link in the category description, the link worked, BUT: Not only did the category description appear (as it should) BELOW the category title, but it ALSO appeared in a somewhat garbled/overlapping version BEFORE the title, as part of the same string and in the same large font as the category title. It looks like a mess. The complete results, before and after the link is activated, is given here:

BEGIN RESULTS

Here's what is in the category box when the link is NOT activated (i.e., the html does NOT refer to the other page):

Special Topic: The APS report on boost-phase missile defense
The APS report on missile defense will become available in mid-July. Please have a look report excerpts and other information before entering the discussion, divided as follows:

The first part is the title and the second part is the description. It's intended that the middle of the second part, i.e., "excerpts and other information", serve as a link to another page.


And here's what I get WITH the link activated:

report excerpts and other information before entering the discussion, divided as follows: " title="The APS report on missile defense will become available in mid-July. Please have a look report excerpts and other information before entering the discussion, divided as follows: " /> Special Topic: The APS report on boost-phase missile defense
The APS report on missile defense will become available in mid-July. Please have a look report excerpts and other information before entering the discussion, divided as follows:

Notice that BEFORE the category title I now get a garble of the description, with ALL of the part before the real title displayed with the font of the title. (The link does work, by the way.)

END RESULTS

PS. Here's the code for the category description, including the activated link:

The APS report on missile defense will become available in mid-July. Please have a look <A HREF="/FPShtml/reportexcerpts.html">report excerpts and other information</A> before entering the discussion, divided as follows:

And, as mentioned, the link does work.

Any help on why all that stuff is inserted before the title, and perhaps what the solution might be, would be very much appreciated. (And sorry for my very limited knowledge of html.)

Thanks - Tony

Sponsored Links
Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
It looks to me like a problem with one of the loops. You can post templates (no copy right violation for doing it) so post your ubbthreads.tmpl file as an attachment and I'll take a look at it.

Joined: Jun 2003
Posts: 131
Journeyman
Journeyman
Offline
Joined: Jun 2003
Posts: 131
Hi, and thanks for offering!

I attach the template, including the mod suggested by J.C. If there's a loop, it is somehow activated by the presence of the link code.

The category description text, with the link in it, is here:

The APS report on missile defense will become available in mid-July. Please have a look at the <A HREF="/FPShtml/reportexcerpts.html"><I>report excerpts and other information</I></A> before entering the discussion, divided as follows:

Please let me know if you have any suggestion about what's happening! Thanks Tony
Attachments
86897-ubbthreadsmod.tmpl.txt (0 Bytes, 14 downloads)

Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
This line:

Code
 <a href="{$config['phpurl']}/postlist.php?Cat=$Cat&amp;amp;Board={$forum[$c][$f]['Keyword']}"><br />{$forum[$c][$f]['Title']} 


should be this:

Code
 <a href="{$config['phpurl']}/postlist.php?Cat=$Cat&amp;Board={$forum[$c][$f]['Keyword']}"><br />{$forum[$c][$f]['Title']} 


Notice the extra amp; -you made the same typo in every hyperlink in the template. Attached is a corrected copy. Please let me know if it works.
Attachments
86901-ubbthreadsmod.tmpl.txt (0 Bytes, 11 downloads)

Joined: Jun 2003
Posts: 131
Journeyman
Journeyman
Offline
Joined: Jun 2003
Posts: 131
OOPS! I took your attachment and, without checking it or anything, FTPed it to replace my current ubbthreads.tmpl, and when I accessesd the board, I got this erro displayed"

Parse error: parse error, unexpected '<' in /home/virtual/site30/fst/var/www/html/forums/templates/default/ubbthreads.tmpl on line 2

Should I look for a bracket next to every amp; ?

No...this doesn't make any sense. This says unexpected bracket on line 2. So I've compared the beginning of the file you attached and the one that I was using, and they are the same (at least at the beginning)...I can't figure this out. And just now I have to go to lunch and take my dog out. When I get back, I'll go searching or those duplicate amps in the template I was originally using...

Any idea? Thanks - Tony

Sponsored Links
Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
Sorry, I missed another mistake in your template. You have comments all over the PHP script loops and echos. Attached is a corrected copy. What program are you using to edit the templates?
Attachments
86920-ubbthreadsmod.tmpl.txt (0 Bytes, 15 downloads)

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
that's how it looks if you copy/paste from the template editor... must be where he got it.


- Allen wavey
- What Drives You?
Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
-ouch!

Joined: Jun 2003
Posts: 131
Journeyman
Journeyman
Offline
Joined: Jun 2003
Posts: 131
sorry - I'll go back to the orginal file, and start from there to see what I get.

Why is it bad to copy from the template editor? It's REAL hard to see those long lines of code in the editor!!!

Tony

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
The template editor has to add all sorts of style tags and comments to the templates so that it can display it all within a form box without breaking it. LOL

Most of us die hards here just edit the text directly in a text editor on the server.

I can honestly say I've never really used the template editor. LOL

Sponsored Links
Joined: Jun 2003
Posts: 131
Journeyman
Journeyman
Offline
Joined: Jun 2003
Posts: 131
OK...let's start from the beginning, i.e., with the code change that J.C. orginally suggested, which I now realize is not entirely unambiguous.

***FIRST HE SAID:

Open ubbthreads.tmpl and find:

{$catrow[$c]['CatDesc']}{$catrow[$c]['NotShown']}

Place it here:

{$catrow[$c]['CatTitle']} <br / >{$catrow[$c]['CatDesc']}{$catrow[$c]['NotShown']}

(MY INTERJECTION: HE HAD THE STRING FROM THE TOP IN BOLD WHEN HE PUT IT AT THE END OF THE BOTTOM STRING. Notice, however, that there is an added <br/> between the two. AND please note that I COPIED the indicated string from one place to another...it's not clear that this is what he intended, or whether he wanted me to MOVE it.)

this will place the descrition under the cat name:


***THEN I found that if I changed the code as indicated, basically adding the string, I did indeed have the category description after the title, BUT it was in the same large font.

HE CAME BACK WITH THE FOLLOWING ALTERED STRING:

{$catrow[$c]['CatTitle']} <br / ><span class="forumtitle">{$catrow[$c]['CatDesc']}{$catrow[$c]['NotShown']}</span>

***I TOOK THIS ENTIRE STRING and used it to REPLACE the ORGINAL short string (the part before the <br... above) in the original template. The only change I made was to replace "forumtitle" with "forumdescript" in the string so as to get the smaller font.

This resulted in a category description in a smaller font (but still bold, as indicated in the initial post of this thread), and - although J.C. thought that a link placed in the category description would work - it resulted in the mixed up title and description also described in the first post above.

So I'm going to start over again...first I'm going to upload the new original 6.3 template.tmpl to my site.

RESULT: now the site works again, but AMAZINGLY, it is doing the thing with the description before the title, but WITHOUT having the description after the title. The latter is sensible because I haven't yet changed the code as suggested by J.C., so the description shouldn't be displaying at all. So maybe the problem of the description before the title has nothing to do with the the changes we've been making, but only with the fact that I presently have a LINK in the description!!! So maybe it is the ORIGINAL 6.3 template that results in the strange display of the description if there's a link in it!!!

So NOW I'm going to see if I can find the extra "amp" in the original 6.3 template. Pardon while I stop...

OK...I checked at least the line of code that you (Dalantech) specified, and it doesn't have that extra amp. So I must have screwed up something in the way I was copying/editing pasting. (Now I'm looking at things in an official html editor.) But should I avoid just taking the code from the edit template screen, editing, and copying it back? Anyway the main conclusion so far is that the description appears before the title if I have a link in the desription.

OK...now just switched the J.C. line of code in place of the original in the template, using the edit template screen, and I'm back where I started: the small-font description is appearing after the title, but the BIG-font description is appearing at the beginning of the title, as it does with the original 6.3 template.

So now I'm going to FTP back the altered template, but I note that the two changes I have made (the J.C. code and a change of table widths) seem to have nothing to do with the appearance of the description before the title.

I attach the template, but it's just the original 6.3 ubbthreads.tmpl with the two changes noted above. (I checked and it doesn't have any of those extraneous remarks, etc!)

Sorry for the mixup and the waste of your time. Am very appreciative of your help and any further suggestion for eliminating the description before the tile...clearly has something to do with the link in the description as it's interpreted by some of the template coding!!! Tony
Attachments
86963-ubbthreads.tmpl (0 Bytes, 89 downloads)

Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
I'll take a look at it and see what I can do. Normally I don't use the template editor built into Threads, and if I do I cut and paste entire documents into it.

The templates are fine: What you need to understand is that there is a loop inside a loop in the ubbthreads.tmpl file and you have to be careful how you edit the file. One little mistake will be magnified if it's inside either loop...

Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
I'm still a little confused as to what you want to do, but I played with the template you posted and uploaded it to my dev site. You can see an example here. Attached is the edited template -I took out the <br /> tag cause it was causing some alignment problems.


If you don't like the parentheses then change this line:

Code
 <span class="forumdescript">({$catrow[$c]['CatDesc']}{$catrow[$c]['NotShown']})</span> 


to this:

Code
 <span class="forumdescript">{$catrow[$c]['CatDesc']}{$catrow[$c]['NotShown']}</span> 


I don't have a "forumdescript" class in my CSS so the text is the same as the default style for the table row that it's in. If you want the description text to be different from the forum text then you'll have to define a forumdescript class in your CSS files.

The mouse over for the question mark graphic still works cause you didn't pull out the html that generates it (and I didn't either). Is that what you are trying to get rid of?
Attachments
87022-ubbthreads.tmpl.txt (0 Bytes, 12 downloads)

Joined: Jun 2003
Posts: 131
Journeyman
Journeyman
Offline
Joined: Jun 2003
Posts: 131
Hi and thanks for looking at this.

I wasn't concerned about the mouse over, though it may be what is causing the template to misinterpret the html for the link in my category description.

What I was trying to do with the added bit of code was to get the category descriptions to display below the titles on the main page. But what I found yesterday was that WHETHER OR NOT I HAD THAT BIT OF CODE ADDED, if the category description contained a link to another page, then for some reason the description was displayed as part of the BEGINNING of the category title. This happens EVEN WITH THE UNCHANGED template. So when my category description was entered in the category setup screen as:

"The APS report on missile defense will become available in mid-July. Please have a look at the <A HREF="/FPShtml/reportexcerpts.html"><I>report excerpts and other information</i></a> before entering the discussion, divided as follows: "

so that it includes a link to another page, here is how the category title appears, even when I do NOT have the code for displaying the description:

"report excerpts and other information before entering the discussion, divided as follows: " title="The APS report on missile defense will become available in mid-July. Please have a look at the report excerpts and other information before entering the discussion, divided as follows: " /> Special Topic: The APS report on boost-phase missile defense"

The real title is only what appears after the />

Note that for or some reason, when the link is included in the description, the template interprets the associated html for the link to produce all the stuff before the actual title.

Assuming YOUR board has the 6.3 ubbthreads.tmpl in its original form for the category title display, it ought to do the same thing. You might just take the category description I have above and paste it into your test board as a category description and see if it produces this strange result as you category title, too.

OR you could add html to make part of the category description in YOUR example a link, to see if that messes up the display of the title. Maybe it is the html for the mouse over that is doing this.

I hope my problem is now more clear,and thank you again for your help. Tony

Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
OK, I think I got it now. It won't work unless you pull some of the variables out of the image link that comes before the catagory name / description. Attached is a corrected copy, and I'll leave my dev site alone for a while so you can see it actually work.

You have to buy the beer...
Attachments
87036-ubbthreads.tmpl.txt (0 Bytes, 14 downloads)

Joined: Jun 2003
Posts: 131
Journeyman
Journeyman
Offline
Joined: Jun 2003
Posts: 131
Dear Dalantech: well, it works! (both on your site and mine)

Thanks very much (but I'm not sure about how to buy you the beer, unless it's the next time I come to Italy).

Couldn't sleep anyway, so I've been a bit on your time schedule.

This afternoon (California time), I'll play with it a little more, and try to use the info you gave me in one of your posts above to see if I can easily remove the parentheses around the description. (Some other time, I'll compare with the 6.3 template to see if I can figure out how to start the description on its own line, below the title...should be doable.)

Once again, thanks very much for your help, and sorry I wasn't able to make it clear faster what I was trying to do!

Tony

PS: my next step is to set up my own test board and try installing your facelift, because I would like a cleaner look. The step after that will be the color scheme, but that may be getting in too deep for my poor knowledge of html and stylesheets!

Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
I think you'll do just fine

At least you are trying to figure things out -and once you start digging into Threads and making changes you can't stop. It's like digital crack

If you need any help just post again. I know how to make the changes that you want -but I want you to see if you can do it on your own first...

Joined: Jun 2003
Posts: 131
Journeyman
Journeyman
Offline
Joined: Jun 2003
Posts: 131
So, Dalantech: I changed those 2 little things in only a few minutes, mainly because your posts had hints of how to do them.

So next I'm going to set up a test site for trying your facelift and seeing if I can figure out how to make a new color scheme.

In the mean time I'm going to see if I can find some hint of how to get the font for the category description NOT to be bold...but that might be buried so deeply in the stylesheets that I don't even know where to start. What puzzles me is that "forumdescript" is a normal font when used for the forum descriptions, but is bold when it's used for the category descriptions. Go Figure!

Tony

Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
It has to do with "inheritance" -some CSS properties can be inherited from a previous class declaration. The text in one table cell can be influenced by the CSS classes before them when you have tables within tables and there are many places in Threads where you'll find one table in the table cell of another table...

Joined: Jun 2003
Posts: 131
Journeyman
Journeyman
Offline
Joined: Jun 2003
Posts: 131
Thought I'd show what I've more or less settled on for a main ndex template that initially was modified as indicated above to: 1) display the category descriptions, even when the forums are shown (how to do courtesy of J.C., and 2) allowed a link to be in the category description, so other material could be referred to (code changes courtesy of Dalantech.

Even though I am relying on DLT'S "facelift" for a cleaner look and functionality, I decided to further modify the basic ubbthreads.tmpl, because it seemed to work better when category descriptions were included. So I:

1. kept the white space between categories that is gone in the "facelift."

2. modified the column widths to accommodate the descriptions better and to eliminate so much "dead" space in the 2nd, 3rd, and 4th table headings (for the main table).

3. replaced the question mark icon that had been deactivated as a mouseover so that the link html in teh category description didn't mess things up. I replaced it just with a "star", rather than just eliminating it, because having some kind of icon there makes it easier to distinguish between the category title and the category description.

4. Changed the extra info/etc table to use space more effectively, mainly by swapping the icons in the legend section with those in the "facelift", which has a much more compact display.

5. also put the # registered users and the welcome newest on same line (and shortened the latter with a language edit; found that the first won't edit...little bug?), and changed to column widths to allow slightly more for the first column.

You can see, at least for now, the result at our test board, and I attach the file just in case J.C., DLT, or anyone else wants to see if I've goofed up.

I kind of like the design for anyone who DOES want to display the category descriptions. The one thing I haven't yet tried to do is provide a bigger text box for entering the category descriptions (like that for the forum descriptions), since right now there's only a single line provided.

Tony

EDIT: just realized I upload the tmpl file directly, and ALSO realize I can't figure how to use my "freezip" to ZIP!!! (Guess that's what "free" means.) Guess I'll download the tryout version of winzip...

EDIT 2: here's a try at a zipped file attachment!
Attachments
88780-catdescrip.zip (0 Bytes, 5 downloads)

Last edited by TonyN; 07/13/2003 11:21 PM.

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
badfrog
badfrog
somewhere on the coast of Maine
Posts: 94
Joined: March 2007
Forum Statistics
Forums63
Topics37,575
Posts293,932
Members13,824
Most Online6,139
Sep 21st, 2024
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,835
Greg Hard 4,625
Top Posters(30 Days)
Gizmo 1
Top Likes Received
isaac 82
Gizmo 20
Brett 7
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2025 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.1
(Snapshot build 20240918)