xoops forums

Vince100

Just popping in
Posted on: 2005/6/12 19:41
Vince100
Vince100 (Show more)
Just popping in
Posts: 1
Since: 2005/6/12
#1

Need a little hack for mylinks

Hello,

I would like to display links (module mylinks) in random order first. I modified viewcat.php, I only replaced

if(isset($HTTP_GET_VARS['orderby'])) {
$orderby = convertorderbyin($HTTP_GET_VARS['orderby']);
} else {
$orderby = "title ASC";
}


by

if(isset($HTTP_GET_VARS['orderby'])) {
$orderby = convertorderbyin($HTTP_GET_VARS['orderby']);
} else {
$orderby = "rand()";
}


It's OK for the first page of links, but the others are ordered by date... Have you a better solution ?

Thanks

KubaZ

Just popping in
Posted on: 2005/6/12 22:51
KubaZ
KubaZ (Show more)
Just popping in
Posts: 37
Since: 2002/10/9
#2

Re: Need a little hack for mylinks

Hi , I think that you have to inform your script you use random sorting :

$rand = isset($HTTP_GET_VARS['rand']) ? intval($HTTP_GET_VARS['rand']) : 1;


if ( (isset(
$HTTP_GET_VARS['orderby'])) && ($rand == 0)) {
$orderby convertorderbyin($HTTP_GET_VARS['orderby']);
} else {
$orderby "rand()";
}


and then you have to modify several links by adding variable rand to the url, e.g. ( add &rand=$rand )
$page_nav .= "<a href='viewcat.php?cid=$cid&amp;min=$prev&amp;orderby=$orderby&amp;show=$show&amp;rand=$rand'><b><u>&laquo;</u></b></a>&nbsp;";


next step:
change urls responsible for sorting in template :
mylinks_viewcat.html (add &rand=0)

<a href="viewcat.php?cid=<{$category_id}>&orderby=titleA&rand=0">


third step: I think adding url for random ordering will be useful (becouse after choosing normal sorting you can't use random sorting, except clicking on main links to viewcat.php will bring random links)
<a href="viewcat.php?cid=<{$category_id}>"><img src="images/(some image, maybe question mark, which describes random sorting)" border="0" align="middle" alt="" />



I don't know if there above is a mistake. I didn't test it. I took it from head :)

hydrO

Not too shy to talk
Posted on: 2005/7/16 12:24
hydrO
hydrO (Show more)
Not too shy to talk
Posts: 105
Since: 2004/1/8 8
#3

Re: Need a little hack for mylinks

i would also like to request a little hack for mylinks module.
I am not sure if this is possible but if it is that would be superb!

I would like it to be able to make a screenshot of the website i am entering and store the image on its own. Or make a screen shots of all the links i want and store them in the website.

I know many websites does this was wondering if its possible to do using xoops.

Cheers everyone
Download Dhivehi mp3s
www.gnatoll.com