Trying to create a "random entry if nothing new" check
Posted: Fri May 22, 2009 11:43 pm
Hi,
My knowledge of PHP and Smarty being rather superficial to say the least, I'm having trouble implementing my random entry functionality as follows
I've found in the entrypaging plugin that a random entry link is generated (and in my case placed at the top of the detailed entry page) but I would like to use that value (which is $link and represents an HMTL link) and inject it directly at the top of my entries.tpl if a certain condition returns TRUE (in my case, I want to check if the most recent entry is older than 2 days and if so, inject that random entry at the top of my page and then proceed with regular entries). The issue I'm having is using the entry data from $link instead of the link itself.
In other words, can I display the content of the random entry by calling it via the entrypaging plugin variable or do I need to rewrite everything? (in which case I'm doomed.
If this doesn't make any sense, it's probably because I'm trying to brew coffee with tea leaves. Sorry!
The slightest push in the right direction would be much appreciated...
Cheers,
Vince
My knowledge of PHP and Smarty being rather superficial to say the least, I'm having trouble implementing my random entry functionality as follows
I've found in the entrypaging plugin that a random entry link is generated (and in my case placed at the top of the detailed entry page) but I would like to use that value (which is $link and represents an HMTL link) and inject it directly at the top of my entries.tpl if a certain condition returns TRUE (in my case, I want to check if the most recent entry is older than 2 days and if so, inject that random entry at the top of my page and then proceed with regular entries). The issue I'm having is using the entry data from $link instead of the link itself.
In other words, can I display the content of the random entry by calling it via the entrypaging plugin variable or do I need to rewrite everything? (in which case I'm doomed.
If this doesn't make any sense, it's probably because I'm trying to brew coffee with tea leaves. Sorry!
The slightest push in the right direction would be much appreciated...
Cheers,
Vince