Webmastersite.net
Register Log In

<IF > Bug.
The title says it all.

Comments on <IF > Bug.

MaxiMax
Beginner

Usergroup: Customer
Joined: Jun 20, 2005
Location: Europa

Total Topics: 1
Total Comments: 2
MaxiMax
Posted Jun 20, 2005 - 3:54 AM:

I am actually to place 2 kind of images in my main.tpl for category use.
One is a static arrow, the second is the same arrow but gif animated.
I am trying to indicate categories where new link were posted.

BUT, whatever i am trying with the <IF {CATHASNEW}> Statement i alreway have a ">" before the animated gif.
I guess something is misscoded in the CATHASNEW function but i was unable to find where. (I guess it is in the conditionnals.php file but this is way hard for me to manage this function wink)

Does anyone has also this error?
Paul
developer

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

Total Topics: 61
Total Comments: 7868
Paul
Posted Jun 20, 2005 - 10:48 PM:

This is a result of the content of {CATHASNEW} ending in a >, which it has to since it's an html tag. Using it in a conditional will just require a new template variable.

If you wish/can, add this to classes/category.php next to cathasnew()

function hasnewbool()
{
global $settings, $inadmindir;
$time = $this->lastlinktime;
$maxdaysago = $settings->marknewupdates;
$maxtimeago = $maxdaysago * 24 * 60 * 60;
$compare = time() - $time;
if (($compare < $maxtimeago) && ($time > 0) && ($this->lastlinktime > $this->time)) return '1';
else return '0';
}

and then use {CATHASNEWBOOL} in the conditional.
MaxiMax
Beginner

Usergroup: Customer
Joined: Jun 20, 2005
Location: Europa

Total Topics: 1
Total Comments: 2
MaxiMax
Posted Jun 21, 2005 - 5:01 AM:

Thanks a lot for your fast answer.

Will this function be included in next release of WLINKS or will i have to rewrite each time the category.php file?
Paul
developer

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

Total Topics: 61
Total Comments: 7868
Paul
Posted Jun 22, 2005 - 8:27 AM:

I added it into my local copy of 3.2 at the time I posted it, so yes, it will be there in the future.
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



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