Page 1 of 1

Random entry HTML or Javascript link

Posted: Sat May 17, 2008 11:54 pm
by vincem
Hi,

I've been trying to create a "random entry" HTML or Javascript link based on the code found in the PHP file of the "Link to next/previous entry" plugin without success. I'd like to place a link to a random entry into my main web site javascript menu and possibly also into an HTML snippet in the blog's sidebar.

Could anyone point me into the right direction as to how to tap into the serendipity_event_entrypaging.php code to create such a link? One of the issues, I suppose, is that this file might only be included when an entry is viewed expended. I would then have to turn the random entry code into a javascript function. Is it do-able?

Thanks in advance!

Vince

Re: Random entry HTML or Javascript link

Posted: Sun May 18, 2008 1:15 am
by garvinhicking
Hi!

You would need to create a s9y plugin for that. A Sidebar plugin needs to hold the PHP code (that you can rip from the current prev-entry plugin). But this is the only way to get to the content from within the sidebar.

REgards,
Garvin

Posted: Sun May 18, 2008 1:26 am
by vincem
Hi Garvin,

Thank you, I will look into it...

Cheers,

Vince