1
baraxas
friendfinder random profile block + bugfix
  • 2005/8/23 14:43

  • baraxas

  • Just popping in

  • Posts: 12

  • Since: 2005/3/28


I'd like to show a resized image of the random user in the block. I've tried to add this at line 64:

le="color: #000000"><?php <center><img src='".XOOPS_URL."/modules/friendfinder/generateimg.php?viewwidth=100&pfad=".XOOPS_URL."/modules/friendfinder/members/uploads/".$imgtime."/&bildname=".$imgname."' border=0></center>



in /modules/friendfinder/blocks/friendfinder.php, but no way. Could anyone help me?

2
baraxas
Re: friendfinder random profile block
  • 2005/8/23 15:54

  • baraxas

  • Just popping in

  • Posts: 12

  • Since: 2005/3/28


By trial I've found that this work:

le="color: #000000"><?php <? ################################################################################# # Friend Finder for XOOPS 1.3.x and XOOPS 2.xx Version 3.1 beta # # # # Copyright 2003 by eagle81 # # # # Manuel Caballero friendfinder@dancepartner.net # # Module Homepage: http://www.dancepartner.net # # # # Please report bugs and new feature request at modcentral.com friendfinder # # forum or via mail frienfinder@dancepartner.net # # # # Copyright for this langfile # # Lanuage: Language name # # Name: your name and email # # Homepage: your Homepage # # # # # # Last modification: 2002-02-22 # # # # Initialy this script is based on phpMeet from # # Jeremy Ross webmaster@phprank.com # # Script design : PhpMeet Copyright 2002 - # # Created 15/01/02 Last Modified 15/01/02 # # Scripts Home http://www.jrscripts.com # # # # First XOOPS Versions from: # # # # Xoops-RC2 French Version : jokerman@free.fr # # Web Home : http://www.webetfric.com # # # # Xoops-RC2 English Version : webmaster@modscentral.com # # Web Home : http://www.modscentral.com # ################################################################################# include("../header.php"); function friendfinder_show() { global $xoopsConfig; $myts =& MyTextSanitizer::getInstance(); $block = array(); $block['title'] = ""._FFBLOCKHEAD.""; global $xoopsDB, $xoopsTheme, $xoopsConfig, $xoopsModule; $result = $xoopsDB->query("SELECT id FROM ".$xoopsDB->prefix("friendfinder")." where active=1"); $dataresult =$xoopsDB->getRowsNum($result); //$gimaxwight=100 mt_srand((double)microtime()*1000000); $zufall = mt_rand(1, $dataresult); /*Kontrollausgabe für den Admin echo "zufall: ".$zufall; echo "<br> dataresult: ".$dataresult; */ $view =$xoopsDB->query("SELECT user, id, pic, imgname, imgtime FROM ".$xoopsDB->prefix("friendfinder")." where id=$zufall"); while(list($user, $id, $pic, $imgname, $imgtime) = $xoopsDB->fetchRow($view)) { $block['content'] .= "<center><img src='".XOOPS_URL."/modules/friendfinder/generateimg.php?viewwidth=100&pfad=".XOOPS_URL."/modules/friendfinder/members/uploads/".$imgtime."/&bildname=".$imgname."' border=0><br><br>"._TEXTFFBLOCK."<br><br><a href='".XOOPS_URL."/modules/friendfinder/view.php?id=".$myts->makeTboxData4Show($id)."'>".$user."</a></center>"; return $block; } } ?>



but what if a profile don't has pic? I'm not an expert programmer, please help me!

3
baraxas
Re: friendfinder random profile block
  • 2005/8/23 18:14

  • baraxas

  • Just popping in

  • Posts: 12

  • Since: 2005/3/28


By the way I've solved the bug of the truncation while updating profiles. It was in the file /friendfinder/members/index.php. There search for all expression similar to:

le="color: #000000"><?php <input type=text name=name maxlength=50 value=".$name.">


and replace with

le="color: #000000"><?php <input type=text name=name maxlength=50 value="".$name."">


As you can see the problem was in the ""

4
stelian
Re: friendfinder random profile block
  • 2005/12/30 18:34

  • stelian

  • Just popping in

  • Posts: 87

  • Since: 2005/12/17


baraxas, thanks a lot for this.

I went further and i made a link on the picture, too
Here is the code.
le="color: #000000"><?php <? ################################################################################# # Friend Finder for XOOPS 1.3.x and XOOPS 2.xx Version 3.1 beta # # # # Copyright 2003 by eagle81 # # # # Manuel Caballero friendfinder@dancepartner.net # # Module Homepage: http://www.dancepartner.net # # # # Please report bugs and new feature request at modcentral.com friendfinder # # forum or via mail frienfinder@dancepartner.net # # # # Copyright for this langfile # # Lanuage: Language name # # Name: your name and email # # Homepage: your Homepage # # # # # # Last modification: 2002-02-22 # # # # Initialy this script is based on phpMeet from # # Jeremy Ross webmaster@phprank.com # # Script design : PhpMeet Copyright 2002 - # # Created 15/01/02 Last Modified 15/01/02 # # Scripts Home http://www.jrscripts.com # # # # First XOOPS Versions from: # # # # Xoops-RC2 French Version : jokerman@free.fr # # Web Home : http://www.webetfric.com # # # # Xoops-RC2 English Version : webmaster@modscentral.com # # Web Home : http://www.modscentral.com # ################################################################################# //include("../header.php"); include_once XOOPS_ROOT_PATH.'/modules/friendfinder/header.php'; function friendfinder_show() { global $xoopsConfig; $myts =& MyTextSanitizer::getInstance(); $block = array(); $block['title'] = ""._FFBLOCKHEAD.""; global $xoopsDB, $xoopsTheme, $xoopsConfig, $xoopsModule; $result = $xoopsDB->query("SELECT id FROM ".$xoopsDB->prefix("friendfinder")." where active=1"); $dataresult =$xoopsDB->getRowsNum($result); //$gimaxwight=100 mt_srand((double)microtime()*1000000); $zufall = mt_rand(1, $dataresult); /*Kontrollausgabe für den Admin echo "zufall: ".$zufall; echo "<br> dataresult: ".$dataresult; */ $view =$xoopsDB->query("SELECT user, id, pic, imgname, imgtime FROM ".$xoopsDB->prefix("friendfinder")." where id=$zufall"); while(list($user, $id, $pic, $imgname, $imgtime) = $xoopsDB->fetchRow($view)) { $block['content'] .= "<center> <a href='".XOOPS_URL."/modules/friendfinder/view.php?id=".$myts->makeTboxData4Show($id)."'> <img src='".XOOPS_URL."/modules/friendfinder/generateimg.php?viewwidth=100&pfad=".XOOPS_URL."/modules/friendfinder/members/uploads/".$imgtime."/&bildname=".$imgname."' border=0></a> <br> <a href='".XOOPS_URL."/modules/friendfinder/view.php?id=".$myts->makeTboxData4Show($id)."'>".$user."</a> </center>"; return $block; } } ?>

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!