11
slyss
Re: Drop down menu with unserlize function ?
  • 2008/5/19 6:31

  • slyss

  • Quite a regular

  • Posts: 343

  • Since: 2006/1/26


many thanks ;)
[size=x-large]2008 Xoops Book[/size]



12
slyss
Re: Drop down menu with unserlize function ?
  • 2008/5/18 21:34

  • slyss

  • Quite a regular

  • Posts: 343

  • Since: 2006/1/26


hi marco


if i have this:


$countries 'a:2:{i:0;s:7:"abruzzo";i:1;s:10:"basilicata";}';


how i can extract countries?

thanks a lot
[size=x-large]2008 Xoops Book[/size]



13
slyss
Re: Myalbum random pic in just one line of code
  • 2008/5/12 6:21

  • slyss

  • Quite a regular

  • Posts: 343

  • Since: 2006/1/26


[size=x-large]2008 Xoops Book[/size]



14
slyss
Myalbum random pic in just one line of code
  • 2008/5/11 17:17

  • slyss

  • Quite a regular

  • Posts: 343

  • Since: 2006/1/26


Hi all


i have written a function to build random pictures blocks (from myalbum-p).

You need to include this into your: root/include/functions.php:

/****** hack by www.stefanosilvestrini.com *****/
function getPicGallery($myalbumNum$cid$random) {
    global 
$xoopsConfig;
    
$db =& Database::getInstance();
    
$myalbumNum trim($myalbumNum);
    if(
$random != 1$sql "SELECT s.lid AS lid, s.ext AS ext FROM ".$db->prefix('myalbum'.$myalbumNum.'_photos')." s, ".$db->prefix('myalbum'.$myalbumNum.'_cat')." t WHERE s.cid = t.cid AND s.cid = ".$cid." ORDER BY s.lid DESC LIMIT 1";
        else 
$sql "SELECT s.lid AS lid, s.ext AS ext FROM ".$db->prefix('myalbum'.$myalbumNum.'_photos')." s, ".$db->prefix('myalbum'.$myalbumNum.'_cat')." t WHERE s.cid = t.cid AND s.cid = ".$cid." ORDER BY RAND() LIMIT 1";
    
$result $db->query($sql);
    
$myrow $db->fetchArray($result);
    
$object =     "<div style='text-align: center;'>"
                
."<a href='".XOOPS_URL."/modules/myalbum".$myalbumNum."/photo.php?lid=".$myrow['lid']."'>"
                
."<img src='".XOOPS_URL."/uploads/thumbs".$myalbumNum."/".$myrow['lid'].".".$myrow['ext']."' align='center' hspace='3' vspace='3' width='100px' />"
                
."</a>"
                
."</div>";
    return 
$object;
}


and then you can add a custom PHP block with this code:

echo getPicGallery('X''Y''Z');


WHERE:

- X: myalbum Number
- Y: cid number
- Z: 1 = random pic ; 0 = last inserted pic

eg:

echo getPicGallery('''1''1');


will display random pics from myalbum and cid = 1

If you need to see the original tutorial is here:http://www.xoopsitalia.org/modules/article/view.article.php/c1/72

Feel free to visit my page for other tutorials: www.stefanosilvestrini.com

bye!!!
[size=x-large]2008 Xoops Book[/size]



15
slyss
Re: How can the banners be random in two places
  • 2008/5/5 14:02

  • slyss

  • Quite a regular

  • Posts: 343

  • Since: 2006/1/26


[size=x-large]2008 Xoops Book[/size]



16
slyss
Re: Drop down menu with unserlize function ?
  • 2008/4/14 11:53

  • slyss

  • Quite a regular

  • Posts: 343

  • Since: 2006/1/26


it's perfect!

thanks a lot!

Verabschieden
[size=x-large]2008 Xoops Book[/size]



17
slyss
Re: Drop down menu with unserlize function ?
  • 2008/4/14 11:40

  • slyss

  • Quite a regular

  • Posts: 343

  • Since: 2006/1/26


anyone ?
[size=x-large]2008 Xoops Book[/size]



18
slyss
Re: News 1.56 Hack SEO
  • 2008/4/12 23:20

  • slyss

  • Quite a regular

  • Posts: 343

  • Since: 2006/1/26


great news!
[size=x-large]2008 Xoops Book[/size]



19
slyss
Re: Drop down menu with unserlize function ?
  • 2008/4/12 13:45

  • slyss

  • Quite a regular

  • Posts: 343

  • Since: 2006/1/26


hi guys...

i have a little problem:

how i can make script work with this variable?:

$countries 'a:2:{s:5:"milan";s:6:"Milano";s:6:"naples";s:6:"Napoli";}';


thanks a lot
[size=x-large]2008 Xoops Book[/size]



20
slyss
Re: phpads implementation into xoops
  • 2008/4/3 15:51

  • slyss

  • Quite a regular

  • Posts: 343

  • Since: 2006/1/26


you can also use this:

https://xoops.org/modules/newbb/viewtopic.php?post_id=284604#forumpost284604

best
[size=x-large]2008 Xoops Book[/size]




TopTop
« 1 (2) 3 4 5 ... 22 »



Login

Who's Online

255 user(s) are online (168 user(s) are browsing Support Forums)


Members: 0


Guests: 255


more...

Donat-O-Meter

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

Latest GitHub Commits