1
Vince100
Need a little hack for mylinks
  • 2005/6/12 19:41

  • Vince100

  • Just popping in

  • Posts: 1

  • Since: 2005/6/12


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

2
KubaZ
Re: Need a little hack for mylinks
  • 2005/6/12 22:51

  • KubaZ

  • Just popping in

  • Posts: 37

  • Since: 2002/10/9


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

le="color: #000000"><?php $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 )
le="color: #000000"><?php $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)

le="color: #000000"><?php <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)
le="color: #000000"><?php <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 :)

3
hydrO
Re: Need a little hack for mylinks
  • 2005/7/16 12:24

  • hydrO

  • Not too shy to talk

  • Posts: 105

  • Since: 2004/1/8 8


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
http://www.gnatoll.com

Login

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits