News:

Wondering if this will always be free?  See why free is better.

Main Menu

Mods are installed in Default Template

Started by DVD, June 08, 2005, 01:33:20 PM

Previous topic - Next topic

DVD

Hi again, i have my forum template, cerberus, so i install the mods,and they don't show up, then today when i changed to defaut skin the mods are all there.... Can anyone help me?

dtm.exe

What mods are you trying to install?  By the way, this is supposed to happen.  Most mods install only to the SMF Default Theme and sometimes to the Yabb Classic theme.

-Dan The Man

rudoka

Hurray. You're the very first example of what I was saying the other day.

Try to figure it out what was changed in the default template. And do the same changements on your template too. That's the only solution I see.

Now how you actually figure out what was changed? That's a though one, since you don't have already the original default templates, except the backups maybe. But even those are only for the last modification.

   You could also look at what every mod modified in which template to find out where and what to do. Hoping that you don't have 20 mods installed.

   In any case. It's quite a job to figure that out.

Rudolf

Gary

#3
Most of the time, mods are not designed for use for any other theme except the SMF Default theme. If you would like a mod to work for another theme, you will have mod modify the code manually.

Quote from: rudoka on June 08, 2005, 01:59:29 PM
Now how you actually figure out what was changed? That's a though one, since you don't have already the original default templates, except the backups maybe. But even those are only for the last modification.
Actually no, no matter how many modifications you install you can find every bit of code needed in there, if you wanted to install 20 mods manually thats possible, you just have to know for which files you need to modify.
Gary M. Gadsdon
Do NOT PM me unless I say so
War of the Simpsons
Bongo Comics Fan Forum
Youtube Let's Plays

^ YT is changing monetisation policy, help reach 1000 sub threshold.

rudoka

Wait Snake, I was just talking about the backups.
   If you install amod that changes, for example the Display.php the Package Manager will create a backup of this file with the ~. But if you install a next mod that changes again that file, what happens?
What will the Package Manager do? To crete another backup, or to overwrite the existing Display.php~.
   So if one installs a lot of mods, then the very original Display.php would be lost, right?! So there would be no way to confront the modifications with the original default SMF code. So you would have to go one by one through every mod of yours and see what they modify one by one.
   The same with the template files. You wil not have the chance to confront the SMF default with yours. Unless you take them out from your install kit. Something which most people would not think of, right?!

Rudolf

Gary

Gary M. Gadsdon
Do NOT PM me unless I say so
War of the Simpsons
Bongo Comics Fan Forum
Youtube Let's Plays

^ YT is changing monetisation policy, help reach 1000 sub threshold.

DVD

i get it, now, how i install manualy the mods?!

Gary

You have to modify the code yourself, use your FTP Client to download the respected pages that need to be modified. Then use any standard text editor such as Notepad, or Wordpad, and copy and paste the code between the two themes, but make sure that you download the file into TWO folders so you have a spare, so that you can re-upload the spare and try again.
Gary M. Gadsdon
Do NOT PM me unless I say so
War of the Simpsons
Bongo Comics Fan Forum
Youtube Let's Plays

^ YT is changing monetisation policy, help reach 1000 sub threshold.

DVD


Gary

Gary M. Gadsdon
Do NOT PM me unless I say so
War of the Simpsons
Bongo Comics Fan Forum
Youtube Let's Plays

^ YT is changing monetisation policy, help reach 1000 sub threshold.

DVD

for example were do i put OnLine Users Today

that the code is

$request = db_query("
   SHOW COLUMNS
   FROM {$db_prefix}log_activity
   LIKE 'allOn'", __FILE__, __LINE__);
$no_upgrade = mysql_num_rows($request) > 0;
mysql_free_result($request);

if (!$no_upgrade)
db_query("ALTER TABLE {$db_prefix}log_activity
   ADD `allOn` smallint(5) unsigned NOT NULL default '0'", __FILE__, __LINE__);

Kindred

ok...    what you need to do is go into your package manager.
Find the mod that you want implemented...  and click list files.

Choose the .mod file to view....

this will list all the actions that the mod took when it installed.
find the filenames between the <edit file> and </edit file> tags...
In your theme directory (in this case, cerberus), find any of the .template.php files that were modified (as listed in the .mod file) AND that exist in the cerberus directory (most commonly this may only be index.template.php and BoardIndex.template.php. Some more involved themes may have more template files that are theme specific. almost none will have less than those two...)

Back to the mod file...
look between the <search for> tags... 
Search for that (or those) lines in the .template.php file...
do the action that follows..
<add after>
<add before>
or <replace>
with the code between the tags...

keep going until you've scanned the entire .mod file.
I have applied 20 or so mods in just about 2 hours...


If there is no .mod file, then the mod is using an XML install... and those are a bit harder to parse in human terms...
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

DVD

<edit file>
Sources/BoardIndex.php
</edit file>

<search>
   // Load the users online right now.
</search>

<replace>
   // Load the users online today.
   $forumtime = forum_time();
   $midnight = ($forumtime) - (((date("H", $forumtime) + $modSettings['time_offset'])  * 3600) + (date("i", $forumtime) * 60) + (date("s", $forumtime)));

      // Load the users online for the past 24 hours.
      $result = db_query("
         SELECT mem.ID_MEMBER, mem.realName, mem.memberName, mem.ID_GROUP, mem.showOnline, mem.avatar, mem.lastLogin, mem.posts,   mg.onlineColor
         FROM {$db_prefix}members AS mem
         LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = mem.ID_GROUP OR (mem.ID_GROUP = 0 AND mg.ID_GROUP = mem.ID_POST_GROUP))
         WHERE mem.lastLogin >= '$midnight'
         ORDER BY mem.realName", __FILE__, __LINE__);

   $today['users'] = array();
   $today['num_users'] = 0;

   $link = array();

      while ($tmp = mysql_fetch_assoc($result))
         {
         $link []= '<a href="' . $scripturl . '?action=profile;u=' . $tmp['ID_MEMBER'] . '" style="color: ' . $tmp['onlineColor'] . ';">' . $tmp['realName'] . '</a>';
         $today['num_users']++;
         }

   mysql_free_result($result);
   
   $context['user_today'] = implode(', ', $link);
   $context['num_users_today'] = $today['num_users'];

        trackStats(array('allOn' => $context['num_users_today']));

   // Load the users online right now.
</replace>

For example this part of the program, i put it in Sources/BoardIndex.php, but where?!

Kindred

Well, if it's calling for a file in the Sources directory, you don't have to do anything.

You only have to look for files that are in the Themes/default directory that are ALSO in your Themes/Cerberus directory.

However... in the case of your example, you would open BoardIndex.php in your Sources directory and search for:
//Load the users online today

then replace that line with the entire section of code between the <replace> and </replace> tags
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: