PDA

View Full Version : Problems with Dynamic Forum Announcements


kall
06-26-2004, 08:41 AM
I have installed CMPS and several other things, and have managed to integrate most of them, but Logician's Dynamic Forum Home Announcements hack (which I was able to integrate into other pages than forumhome) won't seem to play nice.

Does anyone have any idea how to help me (or what I am talking about? :) )

Brian
06-26-2004, 04:06 PM
Are you saying that you're trying to also get that to display in your CMPS pages?

Our Sponsors
 

kall
06-26-2004, 08:08 PM
Yes sir, I am indeed.

I would like to have people who visit my www be subjected to the same Dynamic Forum Announcement that people who visit the Forums do.

At the moment, Guests who visit the Forums get a lovely spiel about the site, what they can expect, and info about the Arcade.

Without the Hack working on the Portal, the only way of accomplishing this (I think) is to create a custom block with the same info, and using conditionals.

Seems that the DFHA hack only works within the forums directory, not above it, as the Portal is.

Brian
06-26-2004, 11:13 PM
If I was at home right now I could tell you exactly how to do it, but I can't really access the files from where I'm at. I can tell you though that the same code you added to your forum/index.php would need to be added inside the print_portal_output() function in your includes/vba_cmps_include_bottom.php file, and then the variables that were added in your forumhome template would need to be added to your adv_portal template. Another alternative would be to use the code you added to your index.php file and create a new module with it. If that helps you at all, great. If not, let me know and I can give you some more exact instructions on Monday. :)

Our Sponsors
 

kall
06-26-2004, 11:38 PM
Et voila!

It worked! (Putting the index.php code in the aforementioned function in the bottom include file and adding the stuff to the main cmps template).

I'm absolutely stunned that I was able to do what you said first try tho...3 weeks ago I would have gotten 15 minutes of 'cannot redeclare function' errors before working it out.

That's the beauty of hacking/modding, the learning curve is steep, but once you start, it begins to become clear.

:)

*bows down*

Now...can anyone tell me how to make all the columns down the left side be the same width as the ones on the right? Is there something obvious I may have missed? I blame the Google one...

*edit* ... Or not. It doesn't seem to be pulling the User's info for the conditional...

Brian
06-30-2004, 12:00 PM
Glad you were able to do it yourself. :)
As for the user's info, try adding $bbuserinfo to the global variables defined at the top of that function. ;)

kall
07-02-2004, 08:13 AM
:)

That did the trick perfectly.

bobbo
07-06-2004, 03:07 PM
Brain/Kall,

Thanks, this helped me out a ton as well. Brian, any idea on what might be needed to actually make this function in a module? I tried creating a module with the modded contents for the index.php relocated to inside the module block. It doesnt seem to work. Im wondering if perhaps it needs to be a combination of code in the module and something added to the includes/vba_cmps_include_bottom.php

Any ideas?

bobbo
07-06-2004, 05:34 PM
Actually, I really wouldnt need a module if I could figure out the darn conditional statements.

I'm trying to make sure (at least right now) that the announcement only appears on my home page. I dont want it to popup on any of my other CMPS pages.

Brian
07-06-2004, 05:40 PM
Maybe this would work?

<if condition="$page['name'] == 'home'">
Dynamic Announcement Code here
</if>

bobbo
07-06-2004, 09:25 PM
Thanks Brian. That didn't work though. I also tried other variations of that and couldnt get it to work.

Just to clarify, I am entering the conditional in the adv_portal template and wrapping it around the $dfh_announcement_popup as well as the $dfh_announcement statements.

They work fine without the conditionals, except for the fact that the message appears on every single VBA CMPS page. So, at least I'm sure that the dynamic announcement mod worked.

I'm wondering, since I have my cmps_index.php outside my forums directory, if I need to define some variable somewhere else...

bobbo
07-08-2004, 09:48 AM
Maybe this would work?

<if condition="$page['name'] == 'home'">
Dynamic Announcement Code here
</if>


OK, got it working. There was simply a small typo in your suggestion. I changed $page to $pages and it worked.

Thanks for pointing me in the right direction. :-)