GetSimple Support Forum
Need Random pages list - Printable Version

+- GetSimple Support Forum (http://get-simple.info/forums)
+-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3)
+--- Forum: Scripts & Components (http://get-simple.info/forums/forumdisplay.php?fid=11)
+--- Thread: Need Random pages list (/showthread.php?tid=1925)



Need Random pages list - GetSimple.RU - 2011-07-07

I need plugin or script that will generate a random pages list.

Please tell me does it exist?


Need Random pages list - RobA - 2011-07-08

You should be able to use the Page Caching plugin : http://get-simple.info/extend/plugin/page-caching/65/

It provides a global: $digi_pagesArray you can use in templates.

This array is in the format ["page"]["field"]

Not tested, I'm thinking you could use something like:
Code:
$randomkeys = array_rand($digi_pagesArray,10);
foreach($randomkeys as $randomkey) {
  echo $digi_pagesArray[$randomkey]["field_1"];
  echo $digi_pagesArray[$randomkey]["field_x"];
}

to generate your random page pieces.

-Rob A>


Need Random pages list - mikeh - 2011-07-28

RobA Wrote:You should be able to use the Page Caching plugin : http://get-simple.info/extend/plugin/page-caching/65/

It provides a global: $digi_pagesArray you can use in templates.

This array is in the format ["page"]["field"]

Not tested, I'm thinking you could use something like:
Code:
$randomkeys = array_rand($digi_pagesArray,10);
foreach($randomkeys as $randomkey) {
  echo $digi_pagesArray[$randomkey]["field_1"];
  echo $digi_pagesArray[$randomkey]["field_x"];
}

to generate your random page pieces.

-Rob A>

If you cannot figure that out, tell me some more info about how you want to use the list and ill write a quick plugin for you.