FusionBB

Please See the FusionBB End Of Life Announcement

FusionBB Review (large)
FusionBB SWAG!

FusionBB golf shirts, t-shirts, mousepads and more.

Tagging
Username Post: Including external php in post        (Topic#12015)
carbmonkey
FusionBB Neophyte
Total Posts: 40
*
Average Post Ranks%:                       
01-11-12 02:17 PM - Post#85899    



I have a simple rating script outside of my forums (same domain) that I want to include inside the forums.

I have a series of topics and in the "article" at the top i'd like to call the ratings

on my non forum html pages I use

<?php
include_once('/home/public_html/rate-photos/ratings.php');
?>

then for each photo I assign one of these
<?php show_ratings_control("photo1"); ?>
<?php show_ratings_control("photo2"); ?>
<?php show_ratings_control("photo3"); ?>
etc.

I would like to show one of these in the topic/article but I can't get it to work.

tried including ratings.php in inserts, header, showtopic.php, body of post
but can't get it going.

any ideas?

 
carbmonkey
FusionBB Neophyte
Total Posts: 40
*
Average Post Ranks%:                       
01-11-12 02:19 PM - Post#85900    


    In response to carbmonkey

i did adjust the include path as well but no luck

<?php
include_once('../rate-photos/ratings.php');
?>

<?php
include_once('../../rate-photos/ratings.php');
?>
 
JoshPet
FusionBB Developer
Total Posts: 6727
*
Birthday: 02-08 
Location: Charlotte, NC
Average Post Ranks%:                       
 
01-12-12 12:56 AM - Post#85901    


    In response to carbmonkey

Sadly, due to the nature of FusionBB it's not possible to execute PHP from within a post or insert. You can execute PHP from within particle boxes which can appear on your portal or in your sidebar, so placing something like
Code:

  include_once('/home/whatever/public_html/rate-photos/ratings.php');  




in the code section of a particle box would allow it to execute.

You might be able to get this to work by modifing scripts, would just depend on exactly how you needed it to appear. For example, appearing on all forum posts, would be pretty easy, because you could execute the code in the script and assign the output to a variable used in the template, however it gets kinda hard if it only needed to appear in a certain post or article.

The only other way I can think to get around it, would be to include the content via an iFrame, then you're essentially displaying another page (where you can execute your script).



Feel Better, Feel Younger, Sleep Better - Trans-D Tropin
Visit www.BuyTransD.com - use coupon code 1004 to save $20


 
carbmonkey
FusionBB Neophyte
Total Posts: 40
*
Average Post Ranks%:                       
01-12-12 01:51 PM - Post#85903    


    In response to JoshPet

thanks. iframe works well
 
Icon Legend Permissions & Sharing Options Topic Options
Print Topic


1073 Views
Calendar
SMTWTFS
 1234
567891011
12131415161718
19202122232425
262728293031 
Current Quote
"Just signed on today and what I see I like very much. I am impressed with the features, especially the private topic idea - a stroke of genius."
~ Bear
FusionBB™ Version 3.2 | ©2003-2014 InteractivePHP, Inc.
Execution time: 0.22 seconds.   Total Queries: 107   Zlib Compression is on.
All times are (GMT-4). Current time is 06:57 AM
Top