View Full Version : Specific vB info on a non-vb page


Cdaknight
28th March 2004, 10:01 PM
I have a question, I want to include some information (like recent threads) on my front page, but I really don't want to use a vB CMS (like ones offered elsewhere; I tried one, and really did not like it).

Can anybody tell me what pages would need to be included, etc (if any)? Or would I just have to query the database for the requested information?

KuraFire
28th March 2004, 10:58 PM
You can make a manual connection to the database, or you can include global.php at the start of your script and run your page as a vB-Powered page.

See Gary's thread on vB.org or .com about non-vB vB-powered pages for more info. :)

Cdaknight
7th April 2004, 03:46 AM
Hmmmm. Reading Gary's tutorial gave me another question. I've got quite a bit of php (it runs the most important section of my site) in my site, and is there any way I'd be able to run the code? I know you can't run it in templates (minus the php ones), but if I include the php code in the page itself would I be able to access the information (variables, for example) that it gives from the template (like I -think- vB3 does??)?

Thanks

KuraFire
7th April 2004, 12:33 PM
I'm not entirely sure I follow you..


You'll want to make sure to hook into the vB system at the very start of your script, really. After that, you can just have your own PHP code, but you may need to modify it a little to work with vB's engine..

Cdaknight
7th April 2004, 04:21 PM
Okay, I think I understand.

To be more specific, I make some mySQL calls to a seperate database from the forums, and then mainly use echo to print the information, and I just have lots of variable information.

Cdaknight
9th May 2004, 04:06 AM
So ... I'm finally getting around to thinking about this again.

I'm working on a vB templated navbar using the vB dropdown stuff (its easy and already exists).

However, what do I need to do so that a mySQL call (and the data returned by it) can be parsed as a variable? The toolbar just needs to grab... I think... 2 variables from the db.

Do I just grab them as usual (I normally put them into an array), and then just go (say my variable is $comic) $comic[date] <br /> $comic[img]?

Also... I'm having a problem with the drop down menus. They're just plain not showing up. I looked at one of the existing menus (quick forum links), and copied the information, changing names where appropriate (or so I thought...)

The template with the menu code looks like this (if anybody can tell me what I did wrong. I'm using it in a page outside of the vB folder, which includes global.php from my forum directory and then eval's/outputs the template "navbar3".

The code:

<div align="center">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="0" border="0" width="100%" align="center" style="border-top-width:0px"><tr align="center">
<td><a href='http://www.buzzcomix.net/in.php?ID=Anirpg'><img src='http://www.buzzcomix.net/vote/vote_rank_button.php?voteID=Anirpg' border=0></a></td>
<td id="help_anirpg" class="vbmenu_control"><a href="#help_anirpg">Help Anirpg.com</a><script type="text/javascript"> vbmenu_register("help_anirpg"); </script></td>
<td id="rpc" class="vbmenu_control"><a href="#rpc">The Role Playing Comic</a> <script type="text/javascript"> vbmenu_register("rpc"); </script></td>
<td id="affiliates" class="vbmenu_control"><a href="#affiliates">Affiliates</a> <script type="text/javascript"> vbmenu_register("affiliates"); </script></td>
<td id="forum_stuff" class="vbmenu_control"><a href="#forum_stuff">Forum Quicklinks</a> <script type="text/javascript"> vbmenu_register("forum_stuff");</script></td>
<td id="disclaimer" class="vbmenu_control"><a href="#disclaimer">Disclaimer</a><script type="text/javascript">vbmenu_register("disclaimer");</script></td>
</tr></table></div>

<div class="vbmenu_popup" id="help_anirpg_menu" style="display:none; ">
<table cellpadding="4" cellspacing="1" border="0">
<tr><td class="thead">Vote on Buzzcomix.net!</td></tr>
<tr><td class="vbmenu_option"><a href='http://www.buzzcomix.net/in.php?ID=Anirpg'><img src='http://www.buzzcomix.net/vote/votesmall.gif' border=0></a></td></tr>
<tr><td class="thead">Donate</td></tr>
<tr><td class="vbmenu_option"><a href="https://www.paypal.com/xclick/business=chris%40anirpg.com&item_name=Anirpg+Website+Donations&no_note=1&tax=0&currency_code=USD&lc=US">
<img src="https://www.paypal.com/en_US/i/btn/x-click-but04.gif"></a><br><b><a href="index.php?page=whydonate">Why Donate?</a></b>
<tr><td class="thead">Buy Animenation!</td></tr>
<tr><td class="vbmenu_option"><a href="http://store.yahoo.com/cgi-bin/clink?animenation+FQyqtP+index.html"><img src="images/animenation.gif" alt="animenation.gif"></a></td></tr>
<tr><td class="thead">Use Firefox</td></tr>
<tr><td class="vbmenu_option"> <a href="http://www.mozilla.org/products/firefox/" title="Get
Firefox - Web Browsing Redefined"><img src="http://www.
mozilla.org/products/firefox/buttons/takebacktheweb_small.png"
width="125" height="50" border="0" alt="Get Firefox"></a></td></tr></table></div>

<div class="vbmenu_popup" id="affiliates_menu" style="display:none; ">
<table cellpadding="4" cellspacing="1" border="0">
<tr><td class="thead">Our Affiliates</td></tr>
<tr><td class="vbmenu_option"><a href="http://www.altermeta.com"><img src="altermeta.jpg" border=0></a>
<br>
<a href="http://bahamut.buildtolearn.net"><img src="anilife.gif"></a>
<br>
<a href="http://www.uge.anirpg.com"><img src="http://www.uge.anirpg.com/images/uge.gif" border="0"></a></td></tr></table></div>

<div class="vbmenu_popup" id="disclaimer_menu" style="display:none; ">
<table cellpadding="4" cellspacing="1" border="0">
<tr><td class="thead">Anirpg.com Disclaimer for Use</td></tr>
<tr><td class="vbmenu_option">Copyright ©2000 - 2004, Anirpg.com
All Anime/Game information is Copyright to their respective owners and used for fan site purposes.
All scripts, and code are ©Chris Atwood (with labled scripts being an exception), and are his own works; please ask before using any code from this website. All information, graphics, etc concerning the Role Playing Comic is copyrighted to Matt York.</td></tr></table></div>


<if condition="$bbuserinfo['userid']">
<!-- user cp tools menu -->
<div class="vbmenu_popup" id="forum_stuff_menu" style="display:none">
<table cellpadding="4" cellspacing="1" border="0">

<tr><td class="thead">$vbphrase[quick_links]</td></tr>
<tr><td class="vbmenu_option"><a href="$vboptions[bburl]/index.php?$session[sessionurl]">Forum Home</a></td></tr>
<tr><td class="vbmenu_option"><a href="$vboptions[bburl]/search.php?$session[sessionurl]do=getnew">$vbphrase[new_posts]</a></td></tr>
<tr><td class="vbmenu_option"><a href="$vboptions[bburl]/forumdisplay.php?$session[sessionurl]do=markread">$vbphrase[mark_forums_read]</a></td></tr>
<tr><td class="vbmenu_option"><a href="#" onclick="window.open('$vboptions[bburl]/misc.php?$session[sessionurl]do=buddylist&amp;focus=1','buddylist','statusbar=no,menubar=no,toolbar=no,scrollbars =yes,resizable=yes,width=250,height=300'); return false;">$vbphrase[open_buddy_list]</a></td></tr>

<tr><td class="thead"><a href="$vboptions[bburl]/usercp.php?$session[sessionurl]">$vbphrase[user_control_panel]</a></td></tr>
<if condition="$show['siglink']"><tr><td class="vbmenu_option"><a href="$vboptions[bburl]/profile.php?$session[sessionurl]do=editsignature">$vbphrase[edit_signature]</a></td></tr></if>
<if condition="$show['avatarlink']"><tr><td class="vbmenu_option"><a href="$vboptions[bburl]/profile.php?$session[sessionurl]do=editavatar">$vbphrase[edit_avatar]</a></td></tr></if>
<tr><td class="vbmenu_option"><a href="$vboptions[bburl]/profile.php?$session[sessionurl]do=editprofile">$vbphrase[edit_profile]</a></td></tr>
<tr><td class="vbmenu_option"><a href="$vboptions[bburl]/profile.php?$session[sessionurl]do=editoptions">$vbphrase[edit_options]</a></td></tr>

<tr><td class="thead">$vbphrase[miscellaneous]</td></tr>
<if condition="$show['pmstats']"><tr><td class="vbmenu_option"><a href="$vboptions[bburl]/private.php?$session[sessionurl]">$vbphrase[private_messages]</a></td></tr></if>
<tr><td class="vbmenu_option"><a href="$vboptions[bburl]/subscription.php?$session[sessionurl]">$vbphrase[subscribed_threads]</a></td></tr>
<tr><td class="vbmenu_option"><a href="$vboptions[bburl]/member.php?$session[sessionurl]u=$bbuserinfo[userid]">$vbphrase[my_profile]</a></td></tr>
<if condition="$show['wollink']"><tr><td class="vbmenu_option"><a href="$vboptions[bburl]/online.php?$session[sessionurl]">$vbphrase[whos_online]</a></td></tr></if>

</table>
</div>
<!-- / user cp tools menu -->
</if>