Webmastersite.net
Register Log In

don't know how to describe!

Comments on don't know how to describe!

babrees
Expert

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

Total Topics: 391
Total Comments: 1303
babrees
Posted Mar 22, 2007 - 10:11 AM:

I have two sites - both run 4.0.21 and both use exactly the same templates, just that the dogscene does have a few more cat fields.

On the details page I have:

<IF {LINKTYPE} is article>
<div class="copyright">
<IF {LINKCOPYRIGHT}>{LINKCOPYRIGHT}<br />
<br /></IF>
{LINKTITLE} was published by <a href="{DIRURL}">{SITETITLE} </a> on {LINKDATE}. &copy; All rights reserved. You may download and print this article for personal or non-profit use only. Please feel free to link to this article. Visit {SITETITLE} (<a href="{DIRURL}">{DIRURL}</a>) for more articles. </div>
</IF>

Templates are exactly the same for both sites. But on The Dog Scene it does not display correctly, repeating a bit of the information above the text. You have to scroll down to the end of the article to see it - it is the copyright details in a box. On The Dog Scene you get the wording "Web site>" in front of the author's name. On The Horse Scene it displays correctly!!!

Examples:

www.thehorsescene.co.uk/det...rse-for-your-child-81.html

www.thedogscene.co.uk/detai...nd-body-language-1271.html

Also, The Dog Scene is a LOT slower to load than the Horse Scene - taking up to 14 seconds, which is not acceptable.
Paul
developer

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

Total Topics: 61
Total Comments: 7867
Paul
Posted Mar 22, 2007 - 7:51 PM:

What's the value for {LINKCOPYRIGHT} in an example where it doesn't work? I'm guessing it contains HTML. Conditionals open with <IF and close with the next >, so if you have an html tag like </a> that closes the conditional. I don't have a solution that at the moment other than using PHP
<?php if ("{LINKCOPYRIGHT}") { ?>{LINKCOPYRIGHT}<?php } ?>
instead.
babrees
Expert

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

Total Topics: 391
Total Comments: 1303
babrees
Posted Mar 22, 2007 - 10:32 PM:

Paul wrote:
What's the value for {LINKCOPYRIGHT} in an example where it doesn't work? I'm guessing it contains HTML. Conditionals open with <IF and close with the next >, so if you have an html tag like </a> that closes the conditional. I don't have a solution that at the moment other than using PHP
<?php if ("{LINKCOPYRIGHT}") { ?>{LINKCOPYRIGHT}<?php } ?>


instead.



Thanks Paul but it didn't like that at all! I thought it was perhaps because it was within another conditional <IF {LINKTYPE} is article>, so I moved it outside that, but it still didn't work at all and I had to change it back. You know I am sure that it all worked ok when I first did it, back when wsn was v.3.#


Attached is my debug. The page took over 8 seconds to load - used to be a lot quicker :-(

(edit) OK, trying to think of ways around this I changed
<IF {LINKCOPYRIGHT}>{LINKCOPYRIGHT}<br><br></IF>
to
{LINKCOPYRIGHT}<IF {LINKCOPYRIGHT}><br><br></IF>


But that still doesn't work!!

Attached Files:
Paul
developer

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

Total Topics: 61
Total Comments: 7867
Paul
Posted Mar 23, 2007 - 6:02 PM:

Please give the info I requested in post #2.

The bulk of your processing time isn't query related, it appears to be a matter of having a large amount of HTML (40KB) to process. I see you have some javascript, you should really move that to the javascript header or other external javascript files so it doesn't get reloaded inside each page. The huge category selector may take the longest to parse though, I'd guess.

You also have a gazillion <!-- BEGIN REGULAR -->s in the result, not sure how you get that since my sites don't.

Also you've just got too high of a server load, over 5 at the moment, which makes every page longer. Is it possible for you to use guest caching?
babrees
Expert

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

Total Topics: 391
Total Comments: 1303
babrees
Posted Mar 23, 2007 - 10:36 PM:

Thanks Paul

Sorry - you guessed right - {LINKCOPYRIGHT} usually contains html of a url link. This also answers my problem in https://www.webmastersite.net/forums/threads/IF_co... as that IF condition also has a field with html of a url link.

Is there another way to include a live link in a text field?

You also have a gazillion &amp;#60;!-- BEGIN REGULAR --&amp;#62;s


The menu is basically a site map where I have a conditional to only show the top level cats. I guess it was still parsing every sub-cat though. I have now changed it and put them in plain html, although I liked it done automatically so when cats are added or changed I don't have to remember to change the wrapper.

I have also moved the javascript (silly me didn't think it would matter being in the header as it was only very small)

Doing just those two has now speeded the site up. Funny thing is it only slowed down after the latest couple of upgrades, prior to that it always loaded in about 3/4 seconds.

What is guest caching and how is it normally done?

PS I can now access your site ok! No idea what the problem was and I didn't do anything it just began working ok! I think I'm jinxed!

Paul
developer

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

Total Topics: 61
Total Comments: 7867
Paul
Posted Mar 24, 2007 - 7:16 PM:

It's straight HTML, not a WSN code? I always strongly advise against HTML.

The menu is basically a site map where I have a conditional to only show the top level cats.

You could just make a toplist of categories where parent=0 instead.

What is guest caching and how is it normally done?

Admin -> Settings -> General, near the top, click the help icon by it.
babrees
Expert

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

Total Topics: 391
Total Comments: 1303
babrees
Posted Mar 24, 2007 - 10:54 PM:

Paul wrote:
It's straight HTML, not a WSN code? I always strongly advise against HTML.

.



OK, please realise I'm a bit thick. I tried to do a url link using wsncodes but can't see how to do it.

If I want to display the words "web site" and have it as a link to http://www.thedogscene.co.uk please show me exactly how I do it.

what here?
Paul
developer

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

Total Topics: 61
Total Comments: 7867
Paul
Posted Mar 25, 2007 - 2:44 AM:

The field needs to be selected as one to parse WSN codes for at the bottom of Admin -> Settings -> General. If you have it selected and still don't know, click the "WSN Codes" link to the left of your post while you're typing it -- that shows a list of codes available.
babrees
Expert

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

Total Topics: 391
Total Comments: 1303
babrees
Posted Mar 25, 2007 - 3:52 AM:

It was parsed for wsncodes, I was actually trying to ask how to put the param as I couldn't get it working - it is now.

But it STILL will not display correctly with an if condition.

www.thedogscene.co.uk/detai...nd-body-language-1271.html

Scroll down to view the first paragraph in the red box. It doesn't make any difference if I use wsn codes or html
Paul
developer

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

Total Topics: 61
Total Comments: 7867
Paul
#10 - Quote - Permalink
Posted Mar 25, 2007 - 5:45 AM:

I see, it's converted to HTML long before then. And the PHP doesn't work because the value has quotes in it, and so can't be quoted. The only way to handle it seems to be if I make it so there's a special BOOL} version of everything, so <IF {LINKCOPYRIGHTBOOL}> can be used. Applied that for 4.0.22.
babrees
Expert

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

Total Topics: 391
Total Comments: 1303
babrees
#11 - Quote - Permalink
Posted Mar 27, 2007 - 10:16 AM:

Paul wrote:
I see, it's converted to HTML long before then. And the PHP doesn't work because the value has quotes in it, and so can't be quoted. The only way to handle it seems to be if I make it so there's a special BOOL} version of everything, so <IF {LINKCOPYRIGHTBOOL}> can be used. Applied that for 4.0.22.


Thanks Paul, but unfortunately it doesn'g seem to be working and instead of the data of LINKCOPYRIGHT I get "Web Site>1" displayed.

www.thedogscene.co.uk/detai...nd-body-language-1271.html
Paul
developer

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

Total Topics: 61
Total Comments: 7867
Paul
#12 - Quote - Permalink
Posted Mar 27, 2007 - 12:48 PM:

You're not using it, there are no instances of <IF {LINKCOPYRIGHTBOOL}> in a search of www.thedogscene.co.uk/templ...plates/default/details.tpl
babrees
Expert

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

Total Topics: 391
Total Comments: 1303
babrees
#13 - Quote - Permalink
Posted Mar 27, 2007 - 1:07 PM:

Paul wrote:
You're not using it, there are no instances of <IF {LINKCOPYRIGHTBOOL}> in a search of www.thedogscene.co.uk/templ...plates/default/details.tpl


I had to remove it because otherwise the article would be in violation of the copyright, ie not displaying the author's link.
Paul
developer

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

Total Topics: 61
Total Comments: 7867
Paul
#14 - Quote - Permalink
Posted Mar 28, 2007 - 12:59 AM:

Works perfectly for me. <IF {LINKDESCRIPTIONBOOL}>{LINKDESCRIPTION}</IF> shows when there's a description, regardless of how many wsn codes are in there.
babrees
Expert

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

Total Topics: 391
Total Comments: 1303
babrees
#15 - Quote - Permalink
Posted Mar 28, 2007 - 2:41 AM:

OK, I tried it again and this time it worked! I do get this sometimes, don't know if it is my server or what sad

Thanks Paul
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



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