Smilies Problem


Subject: Smilies Problem
After the last 2 updates (1.3.0.53a and 1.3.0.53a RC3), I had the same problem with smilies. See attached image:

smilies

The problem is the variable "$ _SERVER [ 'HTTP_HOST']", returns nothing. This occurs in both the server and local (php 5.2.0 and 5.3.0). To fix this I change that variable with "$board_config [ 'server_name']".

Open "includes\functions_post.php" and search:
Code: [Download] [Hide]
  1. 'SMILEY_IMG' => 'http://' . $_SERVER['HTTP_HOST'] . $board_config['script_path'] . $board_config['smilies_path'] . '/' . $rowset[$i]['smile_url'], 


Replace:
Code: [Download] [Hide]
  1. $_SERVER['HTTP_HOST'] 


By
Code: [Download] [Hide]
  1. $board_config['server_name'] 


Repeat this change in the following lines
function generate_smilies_row()
Code: [Download] [Hide]
  1. 'URL' => 'http://' . $_SERVER['HTTP_HOST'] . $board_config['script_path'] . $board_config['smilies_path'] . '/' . $row['smile_url'], 


function generate_smilies_row_simple()
Code: [Download] [Hide]
  1. 'URL' => 'http://' . $_SERVER['HTTP_HOST'] . $board_config['script_path'] . $board_config['smilies_path'] . '/' . $row['smile_url'], 


Open "includes/album_mod/album_functions.php":
Code: [Download] [Hide]
  1. 'SMILEY_IMG' => 'http://' . $_SERVER['HTTP_HOST'] . $board_config['script_path'] . $board_config['smilies_path'] . '/' . $smile_url, 


I do not understand why this happens now, I hope this will help others.

Bye

Subject: Re: Smilies Problem
thanks for the head up

had the same problem on one of the sites

Subject: Re: Smilies Problem
it looks like $_SERVER['HTTP_HOST'] could be deprecated as of PHP 5 series if it returns nothing...

Profile PM  
Subject: Re: Smilies Problem
Thanks for sharing, I will try to improve that code.

Subject: Re: Smilies Problem
i just tried that in the problem site.

thing is it looks like theres an / misssing in the path

example: it should be : www.yoursite.com/images/smileys

but it comes out this way www.yoursite.comimages/smileys


Page 1 of 1


  
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events

   

This is a "Lo-Fi" version of our main content. To view the full version with more information, formatting and images, please click here.

Powered by Icy Phoenix based on phpBB
Generation Time: 1.395s (PHP: 2% SQL: 98%)
SQL queries: 15 - Debug Off - GZIP Enabled