Random entry HTML or Javascript link

Creating and modifying plugins.
Post Reply
vincem
Regular
Posts: 59
Joined: Sat Mar 05, 2005 6:01 am
Contact:

Random entry HTML or Javascript link

Post 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
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Random entry HTML or Javascript link

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
vincem
Regular
Posts: 59
Joined: Sat Mar 05, 2005 6:01 am
Contact:

Post by vincem »

Hi Garvin,

Thank you, I will look into it...

Cheers,

Vince
Post Reply