Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by (Guest)
Developer Last Online: Jan 1970 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 09-19-2000 Last Update: Never Installs: 0
 
No support by the author.

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

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 09-19-2000, 01:31 PM
Guest
 
Posts: n/a
Default

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")."\");");

?>
The theory is that you'd include global.php, connect to the database, and call the template you want.

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
Reply With Quote
  #3  
Old 09-19-2000, 01:39 PM
Guest
 
Posts: n/a
Default

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.
Reply With Quote
  #4  
Old 09-19-2000, 04:48 PM
Guest
 
Posts: n/a
Default

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;
}
And then in your page, you would put this:
Code:
require("global.php");

  eval("echo savethread(\"".gettemplate("savethread")."\");");
As I was typing this, I decided to try it out on my test board.

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]
Reply With Quote
  #5  
Old 09-20-2000, 04:03 PM
Guest
 
Posts: n/a
Default

TWTCommish - Did this work?
Reply With Quote
  #6  
Old 09-27-2000, 12:24 AM
Guest
 
Posts: n/a
Default

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.
Reply With Quote
  #7  
Old 09-27-2000, 12:26 AM
Guest
 
Posts: n/a
Default

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...
Reply With Quote
Reply


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

Forum Jump


All times are GMT. The time now is 10:07 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05481 seconds
  • Memory Usage 2,238KB
  • Queries Executed 20 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (6)postbit
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete