Log in

View Full Version : PHP script in VB custom page


Spy_Master
11-03-2006, 01:07 PM
Hi I searched for an answer to this but couldn't find one.

I'm using this (https://vborg.vbsupport.ru/showthread.php?t=98009) hack and it works great. However, I use a script called Code Sort to manage all the linking buttons that my forum has. Previously I linked to a page on the website but having successfully used the custom page for the rules I thought I'd try to put the codes in the same. However, VB doesn't allow normal php code within itself.

This is what I want to put in the template

<?php

// PHPCodeSort 1.6 codes
// subject: The Addicted

$listing = "2";

include("/home/user/public_html/codesort/codes-config.php");
include("/home/user/public_html/codesort/show-codes.php");

?>
<BR><BR>
<A href="donatecode.php">Donate a code?</A>

But obviously it's not working and I don't know how to make it work. Any suggestions? Thanks :)

ragtek
11-03-2006, 01:49 PM
you cant put a php code into the template
use the pluginsystem

Spy_Master
11-03-2006, 02:11 PM
Ok I can't put the code in the template. Where would I put it in the plugin? Would I put it in the same plugin as the custom page and if so where? If I need to create a new plugin how would I do that? Or is there a better way entirely of doing it?

Thanks for your help. :)

ragtek
11-03-2006, 04:58 PM
sorry i've just seen now that you have your own site

put the code in that file

i think i'm not the right man for this job because of my english

Spy_Master
11-03-2006, 07:15 PM
Your english is fine. I'm probably not explaining myself very well. What I want to do is to have that snippet of PHP code and thus display some images on the custom page. However, VB doesn't allow that code to work and therefore I need some way of inputing it so it does work. I don't know how to do that.

Thanks for your help :)

ragtek
11-03-2006, 08:59 PM
include("/home/user/public_html/codesort/codes-config.php");
include("/home/user/public_html/codesort/show-codes.php");

must work in "your" script

but i don't realy understand what's the problem

first i think you wanted to include it in a vbscript
but i had seen https://vborg.vbsupport.ru/showthread.php?t=98009 and that means that you made the script yourself
so the include shout not be a problem and work

what is
include("/home/user/public_html/codesort/codes-config.php");
include("/home/user/public_html/codesort/show-codes.php");

including?

try $out=....... (the code that show-codes includes
and put $out in the template

Spy_Master
11-04-2006, 09:34 AM
I didn't create the script. It's a PHP script that normally works on webpages. Those two includes are to the config file which then means that the codes for listing 2 are shown.

Normal PHP code like the snippet I'm trying to use doesn't work in a template. It just doesn't appear. From searching this board that appears to be a VB thing that it stops normal PHP code from working. I don't know how to get it to work within VB.

Thanks for your help :)

Spy_Master
11-06-2006, 04:12 PM
Can anybody help with this? I've still not got a solution.