Not logged in. · Lost password · Register
Forum: Support Bug reports and troubleshooting RSS
Potential (minor) erros in 'modern' templates
jense #1
Member since Nov 2006 · 327 posts · Location: Dortmund
Group memberships: Members
Show profile · Link to this post
Subject: Potential (minor) erros in 'modern' templates
main.html in line 9
{if or or $resendValidationLink $UnreadTopicsCount $TopicsSinceLastLoginLink}
Is $CurrentPollsCount missing on purpose?  If added, it would show the corresponding link even if logged out.  I don't see a reason why this should be bad...

forumlist_edit.html in line 45
                        {if not $f.threadCount}
This is always true (it is (int) 0 or unset).  Possibly, the conditional should test if the variable is set at all.  A simple solution is to use {if neq $f.type "link"} instead.  Alternatively, a toggleVisId might be added so that one can quickly switch from a weblink to a category.
Alala, Alala, Gimme three wishes - CSS
jense #2
Member since Nov 2006 · 327 posts · Location: Dortmund
Group memberships: Members
Show profile · Link to this post
I missed this one in forumlist_edit.html:
            <option calue="0" {form_selected_if eq $f.parentId 0}>({tr "forum.top level"})</option>
Find 'calue' and replace with 'value'...
Alala, Alala, Gimme three wishes - CSS
jense #3
Member since Nov 2006 · 327 posts · Location: Dortmund
Group memberships: Members
Show profile · Link to this post
In reply to post #1
I've written a working solution along toggleVisId for myself.  If this is the intended way, Yves, I can prepare a patch.
Alala, Alala, Gimme three wishes - CSS
Avatar
Yves (Administrator) #4
User title: UNB developer & webmaster
Member since Jan 2004 · 3855 posts · Location: Erlangen, Germany
Group memberships: Administrators, Members
Show profile · Link to this post
In reply to post #1
Quote by jense on 2008-01-28, 14:07:
main.html in line 9
{if or or $resendValidationLink $UnreadTopicsCount $TopicsSinceLastLoginLink}
Is $CurrentPollsCount missing on purpose?  If added, it would show the corresponding link even if logged out.  I don't see a reason why this should be bad...

Correct. All four variables are contained in the block below. I've done this a thousand times. If this time it should be different, I would have commented it. But I didn't, so this is now fixed.

forumlist_edit.html in line 45
                        {if not $f.threadCount}
This is always true (it is (int) 0 or unset).  Possibly, the conditional should test if the variable is set at all.  A simple solution is to use {if neq $f.type "link"} instead.  Alternatively, a toggleVisId might be added so that one can quickly switch from a weblink to a category.

Also correct, this variable cannot be set to a different value in the code. I suppose this was meant to be different any time ago. Since the Category checkbox should only be visible if the forum contains no threads, I assume it should mean to prevent hiding existing threads by changing the forum's type to a category. Changing it to be a web link would have the same result and should be prevented, too. I'm not sure what this crap (in my code) was going to be... :(

Okay, some minutes later, I have now changed the whole thing. $f.threadCount is only set for the forum to be edited and now really does contain the number of threads in the forum. See the code comment for details. (main.inc.php:1065)
♪ ...nanananah, all in all we’re just brilliant thieves, nanananah... ♪♬
jense #5
Member since Nov 2006 · 327 posts · Location: Dortmund
Group memberships: Members
Show profile · Link to this post
Quote by Yves on 2008-02-02, 18:43:
Okay, some minutes later, I have now changed the whole thing. $f.threadCount is only set for the forum to be edited and now really does contain the number of threads in the forum. See the code comment for details. (main.inc.php:1065)
Ok, this sounds plausible.  One additional suggestion: the link target should also be hidden by such a conditional.  At present, that's only done via scripting, which is not optimal. - Apropos scripting: could you add some magic, so that the category checkbox is hidden and unchecked, if the link checkbox is checked.  This would match your PHP source and give a hint to the user that both is not possible.
Alala, Alala, Gimme three wishes - CSS
Avatar
Yves (Administrator) #6
User title: UNB developer & webmaster
Member since Jan 2004 · 3855 posts · Location: Erlangen, Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by jense:
the link target should also be hidden by such a conditional.

I see. Done.

could you add some magic, so that the category checkbox is hidden and unchecked, if the link checkbox is checked. 

Also a good idea. It requires a new JavaScript function somewhere because it doesn't all fit in the HTML event handler nicely. Hm. Somehow I feel like I'm too lazy for this. The entire template design isn't quite optimal for this... Maybe later.
♪ ...nanananah, all in all we’re just brilliant thieves, nanananah... ♪♬
jense #7
Member since Nov 2006 · 327 posts · Location: Dortmund
Group memberships: Members
Show profile · Link to this post
Well, the visibility toggle (needs id in the corresponding label) is almost equal to that for the link url.  For the check box,
  1. uncheck('iscategorybox',this.checked);
in the onclick event of the link check box (needs id="categorybox" in the category input tag) with
  1. function uncheck(id,state)
  2. {
  3.     var obj=document.getElementById(id);
  4.     if (obj!=null && (state==null?true:state))
  5.         obj.checked=false;
  6. }
works for me...

HTH
Alala, Alala, Gimme three wishes - CSS
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
This board is powered by the Unclassified NewsBoard software, 20120620-dev, © 2003-2011 by Yves Goergen
Page created in 201.7 ms (148.8 ms) · 82 database queries in 119.5 ms
Current time: 2013-05-23, 02:20:50 (UTC +02:00)