PDA

View Full Version : How Can I


Hell Bomb
08-16-2009, 09:25 PM
My only real question is how can i make this change so it stays with the style of each template that is being used instead of me having to draw the individual files?

<?php
// this is for the master section, 86 = starcraft
// http://www.choasgaming.com/forums/forumdisplay.php?f=86
$id93 = 86;
echo '
<table width="100%" border="0" cellpadding="0" cellspacing="0" background="http://www.choasgaming.com/forums/grunged/misc/cat_title_bg.gif">
<tr>
<td width="22" background="http://www.choasgaming.com/forums/grunged/misc/cat_title_bg.gif"><img src="http://www.choasgaming.com/forums/grunged/misc/cat_title_left.gif" width="22" height="31"></td>
<td background="http://www.choasgaming.com/forums/grunged/misc/cat_title_left_bg.gif" style="background-repeat:no-repeat;">
<font class="container">Starcraft Section</font></td>
<td background="http://www.choasgaming.com/forums/grunged/misc/cat_title_bg.gif">
<div align="right"><a style="float:right" href="#top" onclick="return toggle_collapse("forumbit_84")"><img id="collapseimg_forumbit_84" src="http://www.choasgaming.com/forums/grunged/buttons/collapse_tcat.gif" alt="" border="0" /></a>
</div></td>
<td width="21" background="http://www.choasgaming.com/forums/grunged/misc/cat_title_bg.gif"><div align="right"><img src="http://www.choasgaming.com/forums/grunged/misc/cat_title_right.gif" width="21" height="31"></div></td>
</tr>
</table>
<table class="tborder" cellpadding="6" cellspacing="1" border="0" width="100%" align="center">
<tbody id="collapseobj_forumbit_84" style="">
<tr align="center">
<td class="thead" width="50">&nbsp;</td>
<td class="thead" align="left">Forum</td>
<td class="thead" width="200">Last Post</td>
<td class="thead" width="40">Threads</td>
<td class="thead" width="40">Posts</td>
<td class="thead">Moderator</td>
</tr>
<tr align="center"><tr align="center">
<td class="alt1Active" align="left" id="f86">
<div>
<a href="forumdisplay.php?f=86"><strong>Starcraft</strong></a>
</div>
<div class="smallfont" style="margin-top:6px"><strong>Sub-Forums</strong>: <table border="0" cellpadding="0" cellspacing="0" width="100%" align="center" >
<tr valign="top">
';
$counter = -1;
$array = array();
$querya = "SELECT * FROM forum WHERE parentid = " . $id93;
$resulta = mysql_query($querya) or die(mysql_error());

while($rowa = mysql_fetch_array($resulta)){
$counter = $counter + 1;
$array[$counter] = $rowa[lastpost];

echo '
<tr><td style="text-transform:none;font-size:13px;white-space:nowrap;" width="100%"> <img class="inlineimg" src="http://www.choasgaming.com/forums/grunged/statusicon/subforum_old.gif" alt="" border="0" id="forum_statusicon_' . $rowa["forumid"] . '" /> <a href="forumdisplay.php?f=' . $rowa["forumid"] . '">' . $rowa["forumid"] . '</a></td></tr>
';
}
echo '
<td>&nbsp;</td>
</table></div>
</td>
<td class="alt2" nowrap="nowrap" width="175">
<div class="smallfont" align="">
<div>
<span style="white-space:nowrap">
<img class="inlineimg" src="http://www.choasgaming.com/forums/images/icons/icon1.gif" alt="" border="0" />
';
$id2 = max ($array);
$queryb = 'SELECT * FROM forum WHERE lastpost = '. $id2;
$resultb = mysql_query($queryb) or die(mysql_error());
while($rowb = mysql_fetch_array($resultb)){
$short1 = strlen($rowb["lastthread"]);
if ($short1 > 25){
$short1 = substr($rowb["lastthread"], 0, 25);
$short = $short1 . "...";
}else {
$short = $rowb[lastthread];
}

echo '
<a href="showthread.php?goto=newpost&amp;t=' . $rowb["lastthreadid"] . '" style=white-space:nowrap title="Go to first unread post in thread '.$rowb[lastthread].'">
<strong>' . $short . '</strong></a>
</span>
</div>
<div style="white-space:nowrap; float:"> by <a href="member.php?find=lastposter&amp;f=' . $rowb[forumid] . '" rel="nofollow">' . $rowb[lastposter] . '</a>
</div>
<div align="" style="white-space:nowrap">
2 Days Ago
<a href="showthread.php?p=' . $rowb[lastthreadid] . '#post' . $rowb[lastthreadid] . '"><img class="inlineimg" src="http://www.choasgaming.com/forums/grunged/buttons/lastpost.gif" alt="Go to last post" border="0" /></a>
</div>
</div>
</td>
<td class="alt1" width="65">25</td>
<td class="alt2" width="65">69</td>
<td class="alt1" width="120"><div class="smallfont">&nbsp;</div></td>
</tr>
</tbody>
</table>
';
}
?>

Lynne
08-17-2009, 04:10 AM
I don't understand what it is you want or what that code is for.

Hell Bomb
08-17-2009, 07:51 AM
Sorry my fault, that code displays a forum on another page, i have been making my own custom pages on my website and that will display a forum by drawing the forum id. I was able to make it draw all the information correctly but i want it to draw the template information to match the theme being used. I don't know how to make it draw the picture info so it will images used by different themes.

Lynne
08-17-2009, 03:06 PM
You may want to take a look at this article - [How-To] vBulletin API Basics: Creating Custom Pages & Misc. (https://vborg.vbsupport.ru/showthread.php?t=98009)

metalguy639
08-18-2009, 04:43 AM
Sorry my fault, that code displays a forum on another page, i have been making my own custom pages on my website and that will display a forum by drawing the forum id. I was able to make it draw all the information correctly but i want it to draw the template information to match the theme being used. I don't know how to make it draw the picture info so it will images used by different themes.

Do you have a css file for your other files in your site? If not you may want to make one and then link it into your other site pages in the head part of your html before the </head> tag. A link would look like this:

<link href="yourcssfile.css" rel="stylesheet" type="text/css" />

Then in your CSS file place the vb css info for the colors and what have you. You can get the css info the easier way is to view your page source when looking at your forums with the skin you want to duplicate engaged. You should see all the css code it will look something like this in the source view:

<!--
.vBulletin_editor
{
border: 2px groove #fff;
}
-->


That was the actual source css from this exact posting page on vb.org. There is more to the code but it maybe against the rules to show the code completely. You get the basic idea as to what it looks like though.

Not sure if this would work, but it is something that you can try. If you images do not show up try putting the full URL in the path of the css style sheet. Like you may see something like this:

body {
background-image:url (images/background.jpg);
}

You would want to change the images/background.jpg to http://www.yoursiteurl.com/images/background.jpg. Make sure you have the correct pathway on where your image is located on your server.

Hope this helps and works for you.