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 :

$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 .= "$cid&min=$prev&orderby=$orderby&show=$show&rand=$rand'>« ";


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 :)

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
[size=x-small]http://www.gnatoll.com[/size]

Login

Who's Online

346 user(s) are online (227 user(s) are browsing Support Forums)


Members: 0


Guests: 346


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits