I did a hack some days ago that worked really well until now that i tried to get the stats of an ip.
I added a button at the main menu next to "HOME" button. I named it as "WEBSITE" and it points to my main page.
The code i added in index.template.php is this
//Show the [website] button.
echo ($current_action == 'help' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'website' ? 'active_back' : 'back' , '">
<a href="http://www.xxxx.net/site/index.php">' , $txt[website] , '</a>
</td>' , $current_action == 'website' ? '<td class="maintab_active_' . $last . '"> </td>' : '';
i also added the $txt[website] value to an other php file i cant remember right now.
In my stats i got the following two errors repeatedtly
A)
8: Use of undefined constant website - assumed 'website'
File: /home/xxxx/public_html/forum/Themes/default/Profile.template.php (eval?)
Line: 5
?action=trackip;searchip=xxx.xxx.xxx.xxx
B)
8: Use of undefined constant website - assumed 'website'
File: /home/makis/public_html/forum/Themes/default/languages/Profile.english.php (eval?)
Line: 513
?action=trackip
In order to get over those errors i went to Profile.english.php and i added the following value
$txt[website] = 'website';
which is the same as the one i added the the file i told u about before(the one i dont remember :-\)
I thought that the "website" value needed to be declared to the profile.english.php as well.
Apparently i was wrong as it didnt fix anything
I also think thats its a lil trick that i cant think of because i m new to smf/joomla and php.
Could u please help?
this one seems obvious.
you can not use $txt[website]
If you'll look at all the rest of the text strings, you'll notice they read
$txt['newmessages0']
so you need to use $txt['website'] THAT is what the error is telling you.
And as a note... you should add new text strings into modifications.english.php, not the actual source file...
Well firstof all thank u for ur reply.
The file i wrote above that i didnt remember its name was ModificationsSettings.english.php and that was changed from the beggining.
I wont add anything to the source file and i just corrected the thing u mentioned. It was so easy that i feel bad for not seeing this.
As i see all is going well for now as the only error codes i see at the stats pages belong to the past hours and not the current. Is there a way to empty those error logs so i can run a new ip search and see the new errors (if there r any). I think a quick way is to go to my database and truncate the table that is responsible for this logging.
Last one:
U said i should not play with the source file, is that for later upgrades in order to get it clean?
[edit:] i truncated errol_log table and now i m error free.
Thanx again!
sorry for being snippy... left over annoyance form another forum.
Yes... don't modify original source files if there is a way around it... otherwise you'll lose modifications during even a minor upgrade