Smilies Problem »  Show posts from    to     

Icy Phoenix


Old Support Topics - Smilies Problem



dinoyoco [ Sun 29 Nov, 2009 12:31 ]
Post 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: [Hide]
  1. 'SMILEY_IMG' => 'http://' . $_SERVER['HTTP_HOST'] . $board_config['script_path'] . $board_config['smilies_path'] . '/' . $rowset[$i]['smile_url'], 


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


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


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


function generate_smilies_row_simple()
Code: [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: [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


spydie [ Sun 29 Nov, 2009 14:00 ]
Post subject: Re: Smilies Problem
thanks for the head up

had the same problem on one of the sites


novice programmer [ Sun 29 Nov, 2009 21:57 ]
Post subject: Re: Smilies Problem
it looks like $_SERVER['HTTP_HOST'] could be deprecated as of PHP 5 series if it returns nothing...


Mighty Gorgon [ Sun 29 Nov, 2009 23:52 ]
Post subject: Re: Smilies Problem
Thanks for sharing, I will try to improve that code.


spydie [ Sun 29 Nov, 2009 23:55 ]
Post 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




Powered by Icy Phoenix