News:

SMF 2.1.2 has been released! Take it for a spin! Read more.

Main Menu

Global Topics

Started by margarett, March 27, 2009, 10:15:33 AM

Previous topic - Next topic

margarett

Can't really reproduce it....

Didn't you get any error at install that you ignored, maybe?
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

player.samp

No error was shown when I installed the package. I will check the bug as soon as I can when the forum is online again because currently it got other problem.

fastlight

Hi,

I tried using this mod with 2.0.10 (patched from 2.0.9). It seems to work except that it's changing the background color of part of the screen.  Can you help?  Is there an updated version or something else I should try?

margarett

Hi and welcome to sm.org ;)

Can you post a print screen of the behavior you described?
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

zurgenaboy

Have searched and found 7 pages on Globaltopics mod and read all 7, so if this is in the wrong place, please move. (last post was older than 120 days)
Using smf 2.0.11
default curve theme
I installed above mod and got this error when clicking on any board:
Parse error: syntax error, unexpected 'elseif' (T_ELSEIF) in smf/Themes/default/MessageIndex.template.php on line 301
(no install errors)

Uninstalled the mod and everything back to working normally.
(no uninstall errors)

Installed again after midnight(only guests around) with the same result, so uninstalled again. (no checkbox to undo d/b changes)

MessageIndex.template.php  (attached)   Any solution to let me install a workable mod please.

margarett

The edit to MessageIndex.template.php isn't in the file and line 301 is NOT an elseif... Are you sure you're giving us the correct file?
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

zurgenaboy

I looked at line 301 and noticed that the global code started at like 302, but did not question that.
I downloaded themes/default/MessageIndex.template.php
as listed in the error thrown up.
Is there another one elsewhere?

edit:
Here is the backup file from the package backups

zurgenaboy

If its any help, I still have the backup file before I installed the mod for the first time.
(remember that I installed it twice.)

margarett

You have another MOD conflicting with this which produces that error.
Original MessageIndex.template.php has:
// Is this topic pending approval, or does it have any posts pending approval?
if ($context['can_approve_posts'] && $topic['unapproved_posts'])
$color_class = !$topic['approved'] ? 'approvetbg' : 'approvebg';
// We start with locked and sticky topics.
elseif ($topic['is_sticky'] && $topic['is_locked'])
$color_class = 'stickybg locked_sticky';


Your MessageIndex.template.php has:
// Is this topic pending approval, or does it have any posts pending approval?
if ($context['can_approve_posts'] && $topic['unapproved_posts']) {
$color_class = !$topic['approved'] ? 'approvetbg' : 'approvebg';
$hover_class = !$topic['approved'] ? 'approvetbg' : 'approvebg'; }
// We start with locked and sticky topics.
elseif ($topic['is_sticky'] && $topic['is_locked']) {
$color_class = 'stickybg locked_sticky';
$hover_class = 'stickybg'; }


My MOD adds an elseif before the second comment (but uses the code line above as the search point), which breaks the PHP code because of that "foreign code"

Around line 301, you need to have something like:
// Is this topic pending approval, or does it have any posts pending approval?
if ($context['can_approve_posts'] && $topic['unapproved_posts']) {
$color_class = !$topic['approved'] ? 'approvetbg' : 'approvebg';
$hover_class = !$topic['approved'] ? 'approvetbg' : 'approvebg'; }
elseif ($topic['is_global']) {
$color_class = 'global';
}
// We start with locked and sticky topics.
elseif ($topic['is_sticky'] && $topic['is_locked']) {
$color_class = 'stickybg locked_sticky';
$hover_class = 'stickybg'; }

You might want to add something for the "$hover_class" in it too...
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

zurgenaboy

I am not happy with changing code, its been years since I was a programmer.
Will it take up much time to make the required changes?

zurgenaboy

Or shall I just uninstall the board hover mod?   

I really appreciate your help and advice Margarett

margarett

Yeah, it's one of the issues of MODs, when they conflict. If you don't want to edit code, you definitely need to choose one over the other... Do note, I already gave you the code you need to fix and explained why ;)

Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

zurgenaboy

OK Margarett, as its not my forum, it would not be right for me to change any code
and mess it up, so I will uninstall the hover mod and then try the Global mod as it seems to be a really good mod.
Thank you for your time and help.

ps.   I took your earlier advice and now have regular backups.....lol

margarett

Ok good luck ;) Just let me know if you need further help ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

zurgenaboy

Will do, but as its now 3am, I am off to bed.

1985

#135
Hi,

Why the Global Topics dose not show for guests. The Global Topics only show for members of forum.

Edit: My mistake. I understand now.

Jailer

This mod seems to have stopped working on my forum. The global topic I set previously still functions but the button to set a new or existing topic global no longer appears.

efk

Any idea how to fix this?

Installations actions for "Global Topics"
* 1. Execute Modification ./index.php Test successful
1. Add After ./index.php Test successful
>>>>>* 2. Execute Modification ./Sources/Display.php Test failed
1. Replace ./Sources/Display.php Test failed<<<<<
2. Replace ./Sources/Display.php Test successful
3. Replace ./Sources/Display.php Test successful
4. Replace ./Sources/Display.php Test successful
5. Replace ./Sources/Display.php Test successful
* 3. Execute Modification ./Sources/Load.php Test successful
* 4. Execute Modification ./Sources/LockTopic.php Test successful
* 5. Execute Modification ./Sources/ManageBoards.php Test successful
* 6. Execute Modification ./Sources/ManagePermissions.php Test successful
* 7. Execute Modification ./Sources/MessageIndex.php Test successful
* 8. Execute Modification ./Sources/Recent.php Test successful
* 9. Execute Modification ./Sources/Subs.php Test successful
* 10. Execute Modification ./Sources/Subs-Boards.php Test successful
* 11. Execute Modification ./Themes/default/Display.template.php Test successful
* 12. Execute Modification ./Themes/default/ManageBoards.template.php Test successful
* 13. Execute Modification ./Themes/default/MessageIndex.template.php Test successful
* 14. Execute Modification ./Themes/default/Recent.template.php Test successful
* 15. Execute Modification ./Themes/default/Wireless.template.php Test successful
* 16. Execute Modification ./Themes/default/css/index.css Test successful
* 17. Execute Modification ./Themes/default/languages/Modifications.english.php Test successful
18. Execute Modification ./Themes/default/languages/Modifications.english-utf8.php Skipping file
19. Extract File ./Themes/default/images/topic/global.gif
20. Adapt Database install.php


Core Theme
Execute Modification ./Themes/core/Display.template.php Test successful
1. Replace ./Themes/core/Display.template.php Test successful
Execute Modification ./Themes/core/MessageIndex.template.php Test successful
1. Add After ./Themes/core/MessageIndex.template.php Test successful
Execute Modification ./Themes/core/Recent.template.php Test failed
1. Add After ./Themes/core/Recent.template.php Test failed
2. Add After ./Themes/core/Recent.template.php Test failed
Execute Modification ./Themes/core/css/index.css Test failed
1. Add Before ./Themes/core/css/index.css Test failed
Extract File ./Themes/core/images/topic/global.gif

I guess core theme is not important here.

Tepid (theme)
Tepid
Extract File ./Themes/tepid/images/topic/global.gif

kja12

When installing the mod the execution fails at this:

Quote
Code: (Find) [Select]

foreach ($context['topics'] as $topic)
      {
         // Calculate the color class of the topic.
         $color_class = '';
         if (strpos($topic['class'], 'sticky') !== false)
            $color_class = 'stickybg';
         if (strpos($topic['class'], 'locked') !== false)
            $color_class .= 'lockedbg';

Code: (Add After) [Select]

         elseif ($topic['is_global'])
            $color_class = 'global';

Apparently our Recent_template.php is missing this chuck to display the global topic's background. It can be installed and it works but the background is transparent. Anyone has ideas how this could be fixed?

-Rock Lee-

What theme are you using? When it does not appear, the modification is not applied correctly.


Regards!
¡Regresando como cual Fenix! ~ Bomber Code
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

Advertisement: