Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 16 May 2010, 08:23
kardus kardus is offline
 
Join Date: May 2010
Need to Implement Custom Pages That Execute PHP Code

I've been doing a lot of searching around and have found a few guides that allow you to create custom pages within vbulletin, namely this guide: http://www.vbulletin.org/forum/showthread.php?t=228112

I followed it and it seems to work as advertised. Unfortunately, I want these pages to be able to execute PHP code, which doesn't seem to work with this method. I found http://www.vbulletin.com/docs/html/t..._externalfiles and tried to implement these changes for php/registering variables for vb4, but I can't seem to get it working.

Basically what I am trying to achieve is a setup like this: http://tools.digitalpoint.com so some of my own PHP web applications are streamlined with my forums.

I just need to manage some content/these web apps (most likely 10-30 pages). I tried vbadvanced which actually worked, but seemed like a huge amount of overkill for what I am trying to achieve, and I really didn't like how it was handling my pages, url issues, interference with other mods, etc.. I also tried http://www.vbulletin.org/forum/showthread.php?t=232207 but this mod seems outdated and gave me errors.

I'm basically looking for a simple, easy to implement, and working solution that doesn't involve me adding my own plugins/templates for every single new page I want, if possible. Essentially I want to run already finished php webapps that do various tasks, into my forums in the fashion as shown on digitalpoint forums.

I would really appreciate some assistance. I've been working on my forums for hours and this really is the only (but vital) thing I need to work out before they go live.

--------------- Added 17 May 2010 at 07:09 ---------------

bump?

Last edited by kardus; 17 May 2010 at 07:09. Reason: Auto-Merged DoublePost
Reply With Quote
  #2  
Old 18 May 2010, 04:55
ragtek's Avatar
ragtek ragtek is offline
 
Join Date: Mar 2006
Location: austria, croatia
http://www.vbulletin.org/forum/showthread.php?t=228112 should work

what did you exactly try?
__________________
my addons: http://ragtek.github.com
Reply With Quote
  #3  
Old 18 May 2010, 05:44
kardus kardus is offline
 
Join Date: May 2010
Oh, that worked fine. The only problem is that it only seemed to work for only HTML/plaintext. I put in some PHP code to test an output (just a simple echo for testing purposes) and it just displays the code how I wrote it. I made the plugin as seen in the vbulletin manual:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

and then put


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

in the template that Lynne's guide told me to make.

I also added
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

To the test.php file, and it still doesn't seem to want to include my php code.

I've been trying to get this working for nearly two days now with nothing but frustration
Reply With Quote
  #4  
Old 18 May 2010, 06:30
cellarius's Avatar
cellarius cellarius is offline
 
Join Date: Aug 2005
Real name: Sven
I can't imagine that you're using the FORUMHOME template for your custom php file, do you really? You are registering your variable for that template, but you need to register it for the template you actually use for your custom php page. If you want to output something on forumhome, you don't need a custom php page. You would put your code into a plugin.
__________________
Please note that there will be no further updates to my addons, especially they will not be upgraded for vB5. I'm leaving vB, since IB choose to go the banana-way yet again.

http://www.roma-antiqua.de
Reply With Quote
  #5  
Old 18 May 2010, 07:04
kardus kardus is offline
 
Join Date: May 2010
Originally Posted by cellarius View Post
I can't imagine that you're using the FORUMHOME template for your custom php file, do you really? You are registering your variable for that template, but you need to register it for the template you actually use for your custom php page. If you want to output something on forumhome, you don't need a custom php page. You would put your code into a plugin.
I'm not sure I understand you completely. My goal is just to have pre-written pages of php/html code display neatly where the forums region would be in a normal forum, similar to http://tools.digitalpoint.com... I'm very new to vb and have not much of a clue how it works. I've just followed what I've seen here and while the custom pages are working, php is not being parsed.
Reply With Quote
  #6  
Old 18 May 2010, 07:18
cellarius's Avatar
cellarius cellarius is offline
 
Join Date: Aug 2005
Real name: Sven
No, you did not follow the custom pages tutorial - at least not closely. You need to create your own template for your custom php page and register your variable for that template you created. You are registering it for FORUMHOME template, which most probably is wrong. What is the name of the template you created for your custom page?
__________________
Please note that there will be no further updates to my addons, especially they will not be upgraded for vB5. I'm leaving vB, since IB choose to go the banana-way yet again.

http://www.roma-antiqua.de
Reply With Quote
  #7  
Old 18 May 2010, 07:48
kardus kardus is offline
 
Join Date: May 2010
I followed the tutorial exactly as how it was written, just to try it out and made sure I was doing it properly. My file is test.php, and my template it called TEST just as the tutorial showed.

Text and html work fine. If I put on my page: <?php Print "Hello, World!"; ?>, it will not say "Hello, World!" but rather Print "Hello, World!"; ?>

My variable registration looks like:
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Sorry if that was not clear, I was just pasting it from the vb manual. On my real forums, it does say 'TEST' rather than 'FORUMHOME', I know I am doing this correctly as instructed, but I don't know why php fails to parse.
Reply With Quote
  #8  
Old 18 May 2010, 10:26
cellarius's Avatar
cellarius cellarius is offline
 
Join Date: Aug 2005
Real name: Sven
Why at all do you use the preregister method? The (correct) method in the tutorial is different and does not use preregister:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

For your variable you would have to add a line like this:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Concerning your test with

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

It looks to me that you use <?php ?> while not needing to - it's already around the complete page, so if you put your code somewhere in the middle, you don't need it once again. But this is plain guesswork without seeing your code. The base line is that the tutorial works perfectly well if followed correctly, so there need to be errors in your code. It would be helpful if you would paste the whole thing, with those little tidbids it's really hard to tell.
__________________
Please note that there will be no further updates to my addons, especially they will not be upgraded for vB5. I'm leaving vB, since IB choose to go the banana-way yet again.

http://www.roma-antiqua.de
Reply With Quote
  #9  
Old 18 May 2010, 15:59
kardus kardus is offline
 
Join Date: May 2010
Finally got it working! Thank you.

P.S. I followed what you said exactly and it STILL did not work. I was copying your line: $templater->register('includephp', $includephp); , but my variable was included, it took be about an hour to figure this out
Reply With Quote
  #10  
Old 14 Aug 2010, 00:51
theraven1 theraven1 is offline
 
Join Date: Jan 2006
I would like to see this code if possible.. in a working site..
Reply With Quote
  #11  
Old 14 Aug 2010, 01:10
kardus kardus is offline
 
Join Date: May 2010
http://www.vbulletin.org/forum/showthread.php?t=228112 actually works fine, I believe I was doing something incorrectly or misunderstood an instruction.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 05:31.

Layout Options | Width: Wide Color: