The Arcive of vBulletin Modifications Site. |
|
Details »»
|
|||||||||||||||||||||||||
Can someone give me the command to grab a template onto my own PHP page? IE: not a vb Page...it's for a hack I'm working on...
Show Your Support
|
|||||||||||||||||||||||||
| Comments |
|
#2
|
|||
|
|||
|
This is untested, and possibly not 100% correct, but the theory is there
.You'll need to do something like this: Code:
<?php
require("forums/global.php");
$DB_site->query("SELECT all, of, the, things, you, want, FROM table WHERE yadda, yadda");
eval("echo(\"".gettemplate("template_name")."\");");
?>
That's the best I can do off the top of my head. The code depends on what is it you want to do more than anything else. -jim |
|
#3
|
|||
|
|||
|
I used this:
require("global.php"); $DB_site->query("SELECT * FROM template"); eval("echo(\"".gettemplate("savethread")."\");"); And got this: Fatal error: Cannot redeclare class db_sql_vb in admin/db_mysql.php on line 6 Any idea whats wrong? I created a "savethread" template and as it turns out the global.php file is in the same directory as my file. |
|
#4
|
|||
|
|||
|
Okay, I think I know what's wrong.
In global.php up towards the top you'll see a whole bunch of function definitions. Add this somewhere in there (I added mine below "Start dovars" and above "start standarderror": Code:
// ####### Start Save Thread Hack #####
function savethread($title="") {
// This is where you put all the variables that you use in your template
global $header,$footer,$cssinclude,$fivelinks,$forumjump,$timezone,$bbtitle,$hometitle,
$bburl,$homeurl,$copyrighttext,$privacyurl,$contactuslink,$titleimage,$replyimage,$newthreadimage,
$closedthreadimage,$lastvisitdate,$timenow;
makeforumjump();
eval("\$returnval = dovars(\"".gettemplate("savethread")."\");");
return $returnval;
}
Code:
require("global.php");
eval("echo savethread(\"".gettemplate("savethread")."\");");
What I did was put the second code snippet into a file called savethread.php, and put it in my /forums/ directory. Then I created a simple template called "savethread", and used some of the standard variables. You can see an example here: http://www.bronx-bombers.com/testforum/savethread.php I think that was what you were trying to do, so I hope that helps ![]() -jim [Edited by JimF on 09-19-2000 at 01:50 PM] |
|
#5
|
|||
|
|||
|
TWTCommish - Did this work?
|
|
#6
|
|||
|
|||
|
I'm sorry Jim! I never got around to it - til now.
Works great! Thanks a lot! Hopefully I'll be able to finish my pathetic exscuse for a hack now.
|
|
#7
|
|||
|
|||
|
One quick problem: how do I integrate the two together? IE: I have some SQL queries to make here, but I can't just stick em in the template, can I? I don't think the rest of vB is like that...
The problem is whatever I have printed out shows up at the bottom, below the template... |
![]() |
|
|