"obiku";p="12188" wrote:"evolver";p="6424" wrote:[size=99px]
- Code: Select all
function topic_review($topic_id, $is_inline_review){
[b]AFTER ADD]
- Code: Select all
global $board_config, $db, $userdata; if ( isset($userdata['user_timezone']) ) { $usersummertime = 0; $boardsummertime = 0; if($userdata['user_summer_time']) $usersummertime = 1; if($board_config['summer_time']) $boardsummertime = 1; $zonedifference = (($board_config['real_board_timezone'] + $boardsummertime) - ($board_config['board_timezone'] + $usersummertime)); } else { $zonedifference = 0; } $zonediffseconds = ($zonedifference * 3600);
If you put this code in the place you said, it looks like this
- Code: Select all
function topic_review($topic_id, $is_inline_review){ global $board_config, $db, $userdata; if ( isset($userdata['user_timezone']) ) { $usersummertime = 0; $boardsummertime = 0; if($userdata['user_summer_time']) $usersummertime = 1; if($board_config['summer_time']) $boardsummertime = 1; $zonedifference = (($board_config['real_board_timezone'] + $boardsummertime) - ($board_config['board_timezone'] + $usersummertime)); } else { $zonedifference = 0; } $zonediffseconds = ($zonedifference * 3600); global $db, $board_config, $template, $lang, $images, $theme, $phpEx, $phpbb_root_path; global $userdata, $user_ip; global $orig_word, $replacement_word; global $starttime;//-- mod ]As you can see, the third line:
global $board_config, $db, $userdata;
is already in this function. So my question is, can you also put this part of the code
[code] { $usersummertime = 0; $boardsummertime = 0; if($userdata['user_summer_time']) $usersummertime = 1; if($board_config['summer_time']) $boardsummertime = 1; $zonedifference = (($board_config['real_board_timezone'] + $boardsummertime) - ($board_config['board_timezone'] + $usersummertime)); } else { $zonedifference = 0; } $zonediffseconds = ($zonedifference * 3600);
behind the lines
[code]//-- mod ]without putting in the line
global $board_config, $db, $userdata;
You're right, obiku
global
I didn't even know what it was for...
But I'm learning, fast as a train...
I've learned a lot by now...and I'm still learning more...
I've done many experiments on testsites...
Anything I need to know, I look up on the internet.
Studying example PHP-snippets, comparing them with others, to build one completely the way I like...
Yes, that's what I'm doing right now...making a full PHP-script by my own...and it's expanding
I started with modifying a chmod-script only to add another chmod-method
But, by now, it can't even be compared with the original anymore...
I've added more functions, it will even need a menu to start with...
And now, when I look back at my first little attempts, it makes me smile

And I'm sure, I will also smile later, when I look back at the script I'm working on right now...
I'm just evolving...and I like it <img>

Always remember you're unique, just like everyone else.
We are born naked, wet and hungry. Then things get worse.
Don't take life too seriously, you won't get out alive.