Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

SNIPPIT:: Random Avatar Panel For V7.00.0x & V7.01.0x

Asked Modified Viewed 2,801 times
C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
  • Started this discussions
asked
Fusioneer

Random Avatar Panel Version: 0.02 Alpha For PHPFusion V7.01.0x

www.fangree.co.uk/images/random_avatar_panel_preview.png

Compatible with PHPFusion V7.01.0x

Paste this into a new panel in Admin >>> System >>> Panels

Remember to remove the php tags. [<?php ?>]

<?php
/*-------------------------------------------------------+
| PHPFusion Content Management System
| Copyright (C) 2002 - 2011 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: random-avatar_panel.php
| Version: 0.02 Alpha  For PHPFusion V7.01.0x
| Author: Fangree Productions
| Developers: Fangree_Craig
| Site: http://www.fangree.co.uk
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) { die("Access Denied"); }

add_to_head("<style type='text/css'>fieldset { border: 1px solid #ccc; text-align:center; height: 100px; width:80px; padding: 5px 4px;
-moz-border-radius:5px; -webkit-border-radius:5px; -moz-box-shadow:0 1px 0 rgba(255, 255, 255, 0.20); -webkit-box-shadow:0 1px 0 rgba(255, 255, 255, 0.20) }
legend {color: #ccc;  font-size: 12px; font-weight:700; padding: 2px 4px; margin-right: 0.7em;}</style>");

openside("Random Avatar");

$result = dbquery("SELECT * FROM ".DB_USERS." WHERE user_avatar !='' AND user_status = '0' ORDER BY RAND() LIMIT 1");

if (dbrows($result)!=0) {
 
 $data = dbarray($result);
  echo "<div class='side' align='center'>\n";
    echo"<fieldset>\n";
    echo "<legend><b><i>".profile_link($data['user_id'], $data['user_name'], $data['user_status'])."</i></b></legend>\n";
      if ($data['user_avatar'] && file_exists(IMAGES."avatars/".$data['user_avatar'])) {
         $user_avatar = "<img src='".IMAGES."avatars/".$data['user_avatar']."' style='border: 0px; height: 70px; width: 70px;' alt='".$locale['567']."' />";
        echo profile_link($data['user_id'], $user_avatar, $data[user_status]);
       }

     echo "</fieldset></div>\n";
    unset($data);
   }
  unset($result);

closeside();

?>


Save as Side Left or Right Panel and enable.


CHANGELOG::
Version: 0.01 Alpha - First Public Release
Version: 0.02 Alpha - Changed Avatar code to use profile_link function for V7.01
Edited by Craig on 22-01-2011 16:40,
0 replies

1 post

C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
  • Started this discussions
answered
Fusioneer

Random Avatar Panel Version: 0.01 Alpha For PHPFusion V7.00.0x

www.fangree.co.uk/images/random_avatar_panel_preview.png

Compatible With PHPFusion V7.00.0x

Paste this into a new panel in Admin >>> System >>> Panels

Remember to remove the php tags. [<?php ?>]

<?php
/*-------------------------------------------------------+
| PHPFusion Content Management System
| Copyright (C) 2002 - 2010 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: random-avatar_panel.php
| Version: 0.01 Alpha  PHPFusion V7.00.xx Version
| Author: Fangree Productions
| Developers: Fangree_Craig
| Site: http://www.fangree.co.uk
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) { die("Access Denied"); }

add_to_head("<style type='text/css'>fieldset { border: 1px solid #ccc; text-align:center; height: 100px; width:80px; padding: 5px 4px;
-moz-border-radius:5px; -webkit-border-radius:5px; -moz-box-shadow:0 1px 0 rgba(255, 255, 255, 0.20); -webkit-box-shadow:0 1px 0 rgba(255, 255, 255, 0.20) }
legend {color: #ccc;  font-size: 12px; font-weight:700; padding: 2px 4px; margin-right: 0.7em;}</style>");

openside("Random Avatar");

$result = dbquery("SELECT * FROM ".DB_USERS." WHERE user_avatar !='' AND user_status = '0' ORDER BY RAND() LIMIT 1");

if (dbrows($result)!=0) {
 
 $data = dbarray($result);
  echo "<div class='side' align='center'>\n";
    echo"<fieldset>\n";
    echo "<legend><b><i><a href='".BASEDIR."profile.php?lookup=".$data['user_id']."'/>".$data['user_name']."</a></i></b></legend>\n";
if ($data['user_avatar'] && file_exists(IMAGES."avatars/".$data['user_avatar'])) {
    echo "<a href='".BASEDIR."profile.php?lookup=".$data['user_id']."'/><img src='".IMAGES."avatars/".$data['user_avatar']."' alt='' height='70px' width='70px' border='o' /></a><br /><br />\n";
  }

  echo "</fieldset></div>\n";
  unset($data);
 }
  unset($result);

closeside();

?>


Save as Side Left or Right Panel and enable.



CHANGELOG::
Version: 0.01 Alpha - First Public Release
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 1 post
  • Votes 0 votes
  • Topic users 1 member

1 participant

C
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
  • Started this discussions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet