![]() |
|
#1
|
|||
|
|||
|
I have a very simple PHP RSS reader that I want to include in a module.
PHP Code:
http://www.marijuana.com/420/modules...a_newsfeed.php Script works, modules dont? I've tried to create a new module, then use the drop down menu to select 'marijuana_newsfeed.php' and regardless of where I place the module on the page the php output always shows up at the very top of the page, prior to navbar or anything else. My first thought was a broken table somewhere, so I removed all table formatting from the php script output - That made no difference. Is there no way to just do a nice "include()" call into a module and spit out the contents of the php script? I've been working on this a few hours and have tried everything in the vBa CMPS manual - even changing any echo() statements to '$variable .=' and using $variable in a custom template, as suggested in a thread I researched. If anyone has any ideas on this, I would greatly appreciate your help! Thanks, Max
__________________
"There are two ways of being creative. One can sing and dance. Or one can create an environment in which singers and dancers flourish." -- Warren G. Bennis (b. 1925), American writer, educator, University of Southern California sociologist Last edited by maximux1; 06-15-2004 at 09:34 PM. |
|
#2
|
|||
|
|||
|
aiy - this is maddening. I must just be overlooking something simple.
__________________
"There are two ways of being creative. One can sing and dance. Or one can create an environment in which singers and dancers flourish." -- Warren G. Bennis (b. 1925), American writer, educator, University of Southern California sociologist |
|
#3
|
|||
|
|||
|
Oh, now I get it -
ok, I have figured my problem out. It mainly had to do with my php outputting straight to the buffer instead of being stored in a string. Here's my new module php code - I include this when creating a new module in CMPS, via php file. I add 'adv_portal_marijuana_feed' to the cached templates field on the create module page. PHP Code:
We can then assisgn the contents of the buffer to $string and use that in our template called from custom php mods. Hope this helps someone else. Max Marijuana.Com
__________________
"There are two ways of being creative. One can sing and dance. Or one can create an environment in which singers and dancers flourish." -- Warren G. Bennis (b. 1925), American writer, educator, University of Southern California sociologist Last edited by maximux1; 06-16-2004 at 12:36 AM. |
|
#4
|
|||
|
|||
|
ran into another neat little problem of redclaring classes when I tried to include multiple modules using the same php class. Found a nice and simple solution if anyone runs into the same issue -
Simply surround your class with the following code, like so; PHP Code:
__________________
"There are two ways of being creative. One can sing and dance. Or one can create an environment in which singers and dancers flourish." -- Warren G. Bennis (b. 1925), American writer, educator, University of Southern California sociologist Last edited by maximux1; 06-16-2004 at 02:18 AM. |
|
#5
|
|||
|
|||
|
I know, this thread is kinda old, even though you helped me out with the same problem. thank you - nice solution ...
|
|
#6
|
|||
|
|||
|
Threads like this should be put into a FAQ type of Setting....the most useful threads.....
|
|
#7
|
|||
|
|||
|
Hi
Could you help me out here? I seem to be missing something (like my brain). I have created a php file that deilvers, in string form, markup. I create a page and a template for it that calls the file from the droplist. and add adv_portal_mypage to the cached file list. The script from above I edit thus (in my php file) PHP Code:
|
|
#8
|
||||
|
||||
|
Did you put $string in your 'adv_portal_mypage' template?
|
|
#9
|
|||
|
|||
|
Hi Brian
This is what I have: The page: Title: Browser Archive Page Page Identifier:browserarchive Page Template:adv_portal_browser_archive_page Module: Module Title:Browser Archive Repository File to Include:browserpart.php Active: Yes Templates Used:adv_portal_browser_archiv_page Template:adv_portal_browser_archive_page content: PHP Code:
PHP Code:
|
|
#10
|
||||
|
||||
|
Try removing the ob_start() and ob_end_clean() stuff. Then replace this:
$browserString = ob_get_contents(); With this: $browserString = insertLinks(); And see if that works any better. |
|
#11
|
|||
|
|||
|
Gotcha!
Many thanks Brian!:tup: |
|
#12
|
|||
|
|||
|
Expanding on the theme, if I wanted to return different sections for various parts of the template (One per collapse section) would I have to create a php page and module to include for each or could I return an array and then use
browserString[0] ?? |
|
#13
|
||||
|
||||
|
If I'm thinking right here, you could probably do that by using a foreach statement and faking a moduleid. Something like this...
PHP Code:
|
|
#14
|
|||
|
|||
|
or, perhaps, just add the collapsable elements to the mix and import those also?
PHP Code:
|
|
#15
|
||||
|
||||
|
Should work.
|
|
#16
|
|||
|
|||
|
I will give it a whirl
|
|
#17
|
|||
|
|||
|
Hi,
I have edited the script but it causes something nasty enough to cause the page to be mia I am wondering if the variables called in the template are causing a problem when supplied in this manner? PHP Code:
|
|
#18
|
|||
|
|||
|
Hi,
I got the page back but I am also now back to square 2, it is displaying at the start of the page. ![]() The reason is that a string is not supplied now as the function writes the markup direct to the page. Is there any way to place it where required using this method? |
|
#19
|
||||
|
||||
|
Can you post the code you have in the file now?
|
|
#20
|
|||
|
|||
|
Hi Brian
Yes, here: PHP Code:
Thanks for you effort in this, it is much appreciated. |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Basic Module | cLord | Add-On Modules & Modifications | 55 | 04-24-2006 08:45 AM |
| Module: Countdown to certain date | 58sniper | Add-On Modules & Modifications | 36 | 10-26-2005 01:57 PM |
| PayPal Module | cLord | Add-On Modules & Modifications | 36 | 09-21-2005 01:08 AM |
| Module: Virus Map | 58sniper | Add-On Modules & Modifications | 9 | 06-05-2005 05:14 AM |
| Google Module | cLord | Add-On Modules & Modifications | 22 | 05-03-2005 04:49 PM |