PHP Web Host - Quality Web Hosting For All PHP Applications Clan Themes! We make clans look good!!
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
gsicard
Regular
Regular


Joined: May 21, 2003
Posts: 50
Location: Suffolk, VA USA

PostPosted: Tue Jul 27, 2004 8:33 am Reply with quote Back to top

Hey all,
My dynamic signature stopped working after I did the 2.08 forum upgrade. I now have the 2.10 installed and still the dynamic sig does not work. Was there a code change or something. Here is my signature.php

Code:
 
<?php

define('IN_PHPBB', true);
$phpbb_root_path = 'modules/Forums/';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);

$user_forum_sql = ( !empty($forum_id) ) ? "AND s.session_page = " . intval($forum_id) : '';
$sql = "SELECT u.username, u.user_id, s.session_logged_in, s.session_ip
   FROM ".USERS_TABLE." u, ".SESSIONS_TABLE." s
   WHERE u.user_id = s.session_user_id
      AND s.session_time >= ".( time() - 3600 ) . "
      $user_forum_sql
   ORDER BY u.username ASC, s.session_ip ASC";
if( !($result = $db->sql_query($sql)) )
{
   message_die(GENERAL_ERROR, 'Could not obtain user/online information', '', __LINE__, __FILE__, $sql);
}

$logged_online = 0;

$prev_user_id = 0;

while( $row = $db->sql_fetchrow($result) )
{
   // User is logged in and therefor not a guest
   if ( $row['session_logged_in'] )
   {
      // Skip multiple sessions for one user
      if ( $row['user_id'] != $prev_user_id )
      {
            $logged_online++;
      }

      $prev_user_id = $row['user_id'];
   }
}

$image = "images/signature.png";
$im = imagecreatefrompng($image);
$tc  = ImageColorAllocate ($im, 0, 0, 0);
$red  = ImageColorAllocate ($im, 255, 0, 0);
$version = '2'.$board_config['version'];
$sitename = $board_config['sitename'];
$total_users = get_db_stat('usercount');
$total_posts = get_db_stat('postcount');
$total_topics = get_db_stat('topiccount');
$j = strlen($total_users);
$leerzeichen = $j*6+237;
$newest_userdata = get_db_stat('newestuser');
$newest_user = $newest_userdata['username'];
ImageString($im, 3, 148, 2, "Statistics for $sitename", $tc);
ImageString($im, 2, 148, 15, "phpBB Version: $version", $tc);
ImageString($im, 2, 148, 25, "Members: $total_users - ", $tc);
ImageString($im, 2, $leerzeichen, 25, "Online: $logged_online", $red);
ImageString($im, 2, 148, 35, "Total Posts: $total_posts Posts in $total_topics Topics", $tc);
ImageString($im, 2, 148, 45, "Newest Member: $newest_user", $tc);
header("Content-Type: image/png");
Imagepng($im,'',100);
ImageDestroy ($im);
?>


Gary
Only registered users can see links on this board!
Get registered or login to the forums!


Last edited by gsicard on Tue Dec 07, 2004 9:18 pm; edited 1 time in total
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
chatserv
The Mouse Is Extension Of Arm


Joined: May 02, 2003
Posts: 1396
Location: Puerto Rico

PostPosted: Tue Jul 27, 2004 9:40 am Reply with quote Back to top

Where can i get this mod to test it?
View user's profile Send private message Visit poster's website
gsicard
Regular
Regular


Joined: May 21, 2003
Posts: 50
Location: Suffolk, VA USA

PostPosted: Tue Jul 27, 2004 11:33 am Reply with quote Back to top

Hi Chatserv,
There is a file called signature.png in my /images folder. It is the graphic for the signature background.

The code above it the one I had to pull the info onto the graphic. Not sure where I got the code from.. There is a thread about it
Only registered users can see links on this board!
Get registered or login to the forums!
.

Your access info is still the same. I'll pm it to you just in case.
Only registered users can see links on this board!
Get registered or login to the forums!


Gary
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
tix
Hangin' Around


Joined: Jun 05, 2004
Posts: 41

PostPosted: Tue Jul 27, 2004 11:23 pm Reply with quote Back to top

if the image is calles as .php file phpbb 2.08 doesnt accept it.

PhpBB 2.08 changes wrote:
Limited allowed images in img bbcode tag to jpg, jpeg, gif and png


If it is a .jpg Chat should look it
If it is what i said you could easily use the rewrite function by apache.
Just place an .htacces file in the directory that contains
Code:

RewriteEngine on
RewriteRule ^signature.gif /signature.php
RewriteRule ^signature.jpg /signature.php
View user's profile Send private message
chatserv
The Mouse Is Extension Of Arm


Joined: May 02, 2003
Posts: 1396
Location: Puerto Rico

PostPosted: Wed Jul 28, 2004 12:01 am Reply with quote Back to top

I believe tix is correct, the phpBB group hardened the image filter in 2.0.8 because of an attack that placed a broken image in forum posts and private messages that when viewed by the forum admin would execute arbitrary code.
View user's profile Send private message Visit poster's website
GanjaUK
Life Cycles Becoming CPU Cycles


Joined: Feb 14, 2004
Posts: 633
Location: England

PostPosted: Wed Jul 28, 2004 6:27 am Reply with quote Back to top

I noticed my dynamic signature broke ages ago when I upgraded to 2.0.8 so all I did was add a Mod Rewrite to my .htaccess file and problem solved.

Add this to a .htaccess in your nuke route (assuming your server supports .htaccess):
Code:
#Signature
RewriteRule ^signature.png signature.php


Now just change your signature extension in all forums to .png


edit: Just noticed what tix wrote. Laughing Still waking up...
View user's profile Send private message Visit poster's website
gsicard
Regular
Regular


Joined: May 21, 2003
Posts: 50
Location: Suffolk, VA USA

PostPosted: Wed Jul 28, 2004 9:18 am Reply with quote Back to top

Thanks all - I have placed the RewriteRule in my htaccess and now will try to get the sig to work. All the best.

Gary
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
dean
Worker
Worker


Joined: Apr 14, 2004
Posts: 193

PostPosted: Fri Sep 03, 2004 5:12 pm Reply with quote Back to top

Added rewrite rules as suggested and changed extension of signature.php to png in my profile. Does it work?

EDIT: Yes it works here but not on my own site?
View user's profile Send private message
shotokan
Worker
Worker


Joined: Aug 27, 2006
Posts: 172

PostPosted: Wed Dec 27, 2006 1:18 pm Reply with quote Back to top

I was having exactly the same issue and the fixing did the trick. Thank you guys.
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum