![]() |
|
#1
|
|||
|
|||
|
I've only just installed vBadvanced yesterday to experiment with as I'm essentially looking to include news, forum login etc. in the main site from the forum. However, my main site is a very cleanly coded XHTML/CSS site.
Given my current designed page how would I insert my latest 5 news threads into a pre-arranged DIV on my design for news. I really want to strip out most of this excess code. At the moment, one news entry is looking like this: Code:
<table align="center" border="0" cellpadding="6" cellspacing="1" class="tborder" width="100%"> <thead> <tr> <td class="tcat" colspan="0"> <span class="smallfont"><strong> <a href="http://www.mywebsite.com/forums/showthread.php?t=2">Test News #2</a></strong></span></td> </tr> </thead> <tbody id="collapseobj_module_4_2" style=""> <tr> <td class="thead"> Sep 23, 2006 - 7:23 PM - by <a href="http://www.mywebsite.com/forums/member.php?u=1" rel="nofollow">Sid</a> </td> </tr> <tr> <td align="left" class="alt1" valign="top"> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec tincidunt. Nullam pretium eros. Duis tempor, sem non aliquet congue, mauris sem viverra augue, ac posuere magna nulla in mauris. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Praesent tortor ante, vehicula mattis, consequat vel, rutrum sit amet, dolor. Vestibulum id libero. Cras laoreet. Fusce tristique, purus ut egestas euismod, purus justo aliquam justo, in blandit metus quam et... <span class="smallfont">[<a href="http://www.mywebsite.com/forums/showthread.php?t=2">Read More</a>]</span> </td> </tr> <tr class="alt2" valign="middle"> <td valign="middle"> <span style="float:right"> <a href="http://www.mywebsite.com/forums/sendmessage.php?do=sendtofriend&t=2"><img alt="" border="0" src="http://www.mywebsite.com/forums/images/buttons/sendtofriend.gif" title="Send to Friend" /></a> <a href="http://www.mywebsite.com/forums/printthread.php?t=2"><img alt="" border="0" src="http://www.mywebsite.com/forums/images/buttons/printer.gif" title="Show Printable Version" /></a> </span> <span class="smallfont"> 0 Replies | 1 Views</span> </td> </tr> </tbody> </table> Code:
<h3><a href="http://www.mywebsite.com/forums/showthread.php?t=2">Test News #2</a></h3> <p>Sep 23, 2006 - 7:23 PM - by <a href="http://www.mywebsite.com/forums/member.php?u=1" rel="nofollow">Sid</a></p> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec tincidunt. Nullam pretium eros. Duis tempor, sem non aliquet congue, mauris sem viverra augue, ac posuere magna nulla in mauris. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Praesent tortor ante, vehicula mattis, consequat vel, rutrum sit amet, dolor. Vestibulum id libero. Cras laoreet. Fusce tristique, purus ut egestas euismod, purus justo aliquam justo, in blandit metus quam et...</p> <p>[<a href="http://www.mywebsite.com/forums/showthread.php?t=2">Read More</a>]</p> |
|
#2
|
|||
|
|||
|
Anyone?
|
|
#3
|
||||
|
||||
|
Just edit your adv_portal_newsbits template and make your changes in there.
|
|
#4
|
|||
|
|||
|
I've changed my newsbits to this:
Code:
<h2><a href="$vboptions[bburl]/showthread.php?t=$news[threadid]">$news[title]</a></h2> <p>$news[dateposted] - <phrase 1="$vboptions[bburl]/member.php?$session[sessionurl]u=$news[postuserid]" 2="$news[postusername]">$vbphrase[by_x]</phrase></p> <p>$news[message]</p> <p>$news[replycount] $vbphrase[views]</p>
|
|
#5
|
|||
|
|||
|
I'm sorry to keep asking but I'm really having problems with this:
This is what the outputted HTML code for my page should be: Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head>
<title>Home > myuniversityclub.com</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta name="robots" content="all" />
<link rel="stylesheet" type="text/css" href="css/print.css" media="print" />
<link rel="stylesheet" type="text/css" href="css/screen.css" media="all" />
<link rel="Shortcut Icon" type="image/x-icon" href="images/favicon.ico" />
</head>
<body>
<div id="container">
<div id="header"></div>
<div id="navbar">
<h2>Navigation</h2>
<ul>
<li id="home"><a href="index.html" title="Home">Home</a></li>
<li id="about"><a href="about.html" title="About">About</a></li>
<li id="faq"><a href="faq.html" title="FAQ">FAQ</a></li>
<li id="gallery"><a href="gallery.html" title="Gallery">Gallery</a></li>
<li id="forums"><a href="forums/index.php" title="Forums">Forums</a></li>
<li id="contact"><a href="contact.html" title="Contact">Contact</a></li>
</ul>
</div>
<div id="middle">
<h2>Home > <a href="index.html">my unversity club.com</a></h2></h2>
<div id="welcome">
<p>Welcome to the website for my university club.</p>
<p>We're a fun, friendly society who meet monthly to take part in computer game action and meet new people!
We also have lots of other regular events such as weekly pub meets, bowling etc.</p>
<p>Have a browse around, check out the information pages, photos, and if you're not sure about something
or would like to find something out, why not pop onto the forums and say "Hello!".</p>
</div>
<div id="news">
<h2>Latest News</h2>
<h3><a href="#">Test News #1</a></h3>
<p>Sept 23, 2006 - 20:23 by Sid</p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed facilisis, ante sed egestas blandit, nisl
magna consequat tortor, id hendrerit quam risus a felis. Aliquam hendrerit. Pellentesque...
<a href="#">read more</a></p>
<h3><a href="#">Test News #1</a></h3>
<p>Sept 23, 2006 - 20:23 by Sid</p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed facilisis, ante sed egestas blandit, nisl
magna consequat tortor, id hendrerit quam risus a felis. Aliquam hendrerit. Pellentesque...
<a href="#">read more</a></p>
<h3><a href="#">Test News #1</a></h3>
<p class="date">Sept 23, 2006 - 20:23 by Sid</p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed facilisis, ante sed egestas blandit, nisl
magna consequat tortor, id hendrerit quam risus a felis. Aliquam hendrerit. Pellentesque...
<a href="#">read more</a></p>
</div>
</div>
<div id="right">
<div id="login">
<h2>Log In</h2>
<form action="#" method="post">
<fieldset>
<label for="username">Username:</label><input id="username" name="username" type="text" size="15" value="Your username" />
<label for="password">Password:</label><input id="password" name="password" type="password" size="15" value="password" />
<span><label for="remember">Remember me</label><input id="remember" name="remember" type="checkbox" /></span>
<input name="submit" type="image" src="images/button_login.gif" />
</fieldset>
</form>
<!-- still to enter code for sign up text -->
</div>
<div id="events">
<h2>Upcoming events</h2>
<img src="images/event.jpg" alt="Upcoming event" />
<h3><a href="eventsignup.html">Fresher's LAN!</a></h3>
<p>7th and 8th of October</p>
<p><em>A weekend of gaming fun...</em></p>
<a href="eventsignup.html">Sign up!</a>
</div>
<div id="forum">
<h2>On the forum</h2>
<ul id="latestthreads">
<li><a href="forums/showthread.php?t=1">Thread for those with boredome</a></li>
<li><a href="forums/showthread.php?t=2">Build me a machine worthy of...</a></li>
<li><a href="forums/showthread.php?t=3">Bioshock</a></li>
<li><a href="forums/showthread.php?t=4">Buy a gun?</a></li>
</ul>
<a class="biglink" href="forum/index.php">Visit the forum</a>
</div>
</div>
</div>
</body>
</html>
Note: I'm not bothered about losing any of the easy customisation options by removing lots from the templates. I just want to be able to insert some basic forum data into my HTML page. Last edited by Sid; 10-06-2006 at 12:54 PM. |
|
#6
|
|||
|
|||
|
OK, I've been messing around for hours and I've managed to get it beginning to look not too bad. My problem is that I have this bit of code:
Code:
<table align="center" border="0" cellpadding="6" cellspacing="1" class="tborder" width="100%"> <thead> <tr> <td class="tcat" colspan="0"> <span class="smallfont"><strong> <a href="http://www.craig.rushtheweb.com/forums/showthread.php?t=4">Jan is bent</a></strong></span></td> </tr> </thead> <tbody id="collapseobj_module_4_4" style=""> Edit: OK, simplifying adv_portal_module_shell to: $mods[formcode] $modulehtml seemed to do the trick. Now to fix my login box... The login form is there and one can enter their details, login and it forwards you to login.php with "Thanks for logging in, $username" however when it returns you back to the homepage, the login box is still there rather than the user details. I get the feeling I've removed something from my adv_portal template which was required in order for the login to work. Any ideas? Last edited by Sid; 10-07-2006 at 07:49 AM. |
|
#7
|
||||
|
||||
|
Sounds more like a cookie problem. If you check the FAQ forum here, there's a thread regarding problems logging in/out.
|
|
#8
|
|||
|
|||
|
Got it sorted now, thanks. Not quite sure exactly what I changed, mind you.
I now need to sort my latest threads box. My code is as follows: Code:
<ul> <li> <p><a href="$vboptions[bburl]/showthread.php?t=$thread[threadid]" title="$thread[preview]">$thread[title]</a></p> <p>$thread[postdate] $thread[posttime] $vbphrase[by] $thread[postusername]</p> </li> </ul> Code:
$mods[formcode] $modulehtml Code:
... <div id="right"> $home[rightblocks] </div> ... Last edited by Sid; 10-07-2006 at 04:09 PM. |
|
#9
|
|||
|
|||
|
Also, in adv_portal_welcomeblock I'm not quite sure what the conditions:
<if condition="$mods['modcol'] == 1"> and <if condition="!$show['guest']"> correspond to. I'm trying to cut down the code for this template too, but there seems to be 2 repetitions for both the 'already logged in' code and the 'not logged in' code. I think if I can figure out what those conditions refer to, then I should be able to sort it. I tried a search but couldnt find anything that was of use. If anyone could help me with either of these problems, that'd be great. Cheers. |
|
#10
|
||||
|
||||
|
What exactly is the problem you're having with that code in the latest threads module?
$mods['modcol'] == 1 That means that the module is in the center column (0 = left, 1 = center, 2 = right). <if condition="!$show['guest']"> $show['guest'] is the variable used to determine if a user is logged in. |
|
#11
|
|||
|
|||
|
Quote:
Code:
<div id="forum"> <ul> <li> <p><a href="$vboptions[bburl]/showthread.php?t=$thread[threadid]" title="$thread[preview]">$thread[title]</a></p> <p>$thread[postdate] $thread[posttime] $vbphrase[by] $thread[postusername]</p> </li> <li> <p><a href="$vboptions[bburl]/showthread.php?t=$thread[threadid]" title="$thread[preview]">$thread[title]</a></p> <p>$thread[postdate] $thread[posttime] $vbphrase[by] $thread[postusername]</p> </li> <li> <p><a href="$vboptions[bburl]/showthread.php?t=$thread[threadid]" title="$thread[preview]">$thread[title]</a></p> <p>$thread[postdate] $thread[posttime] $vbphrase[by] $thread[postusername]</p> </li> </ul> </div> Where should I place the opening <div><ul> and the closing </div></ul> tags? Thanks for the information on those conditions. Very helpful. Last edited by Sid; 10-09-2006 at 02:56 PM. |
|
#12
|
||||
|
||||
|
Ahhh... Your best bet would probably be to add those things as an <if condition> in your 'adv_portal_module_shell' template. Something like this:
Code:
<if condition="$mods['identifier'] == 'latestthreads'"> <div id="forum"> <ul> </if> $modulehtml <if condition="$mods['identifier'] == 'latestthreads'"> </ul> </div> </if> |
|
#13
|
|||
|
|||
|
Excellent!
![]() Thanks ever so much, I have my homepage template just about complete now! My apologizes for asking so many questions, I'm just unfamiliar with the vBadvanced system and vBulletin as a whole, so I'll no doubt have one or two more questions before the site goes live ![]() Cheers, again. |
|
#14
|
||||
|
||||
|
No worries. I'm sure things will come easier the more you play with things.
|
|
#15
|
|||
|
|||
|
Eek, another question sooner than I thought.
I'm have problems with the login box, again. It logins in then returns back to the homepage but the 'guest' box appears. Here's the code from adv_portal_welcomeblock: Code:
<div id="login">
<if condition="!$show['guest']">
<h2>Welcome Back</h2>
<a href="$vboptions[bburl]/profile.php?do=editavatar"><img src="$avatarurl" border="0" alt="$vbphrase[edit_avatar]" /></a>
<phrase 1="$bbuserinfo[username]">$vbphrase[welcome_back_x]</phrase>
<phrase 1="$lastvisitdate" 2="$lastvisittime">$vbphrase[last_visited_x_at_y]</phrase>
<br />
$newposts <a href="$vboptions[bburl]/search.php?$session[sessionurl]do=getnew">$vbphrase[new_posts]</a> |
$bbuserinfo[pmunread] <a href="$vboptions[bburl]/private.php?$session[sessionurl]">New PMs</a>
<br />
<a href="$vboptions[bburl]/login.php?$session[sessionurl]do=logout&logouthash=$bbuserinfo[logouthash]" onclick="return log_out()">$vbphrase[log_out]</a>
<else />
<h2>Log In</h2>
<fieldset>
<label for="username">Username:</label><input id="username" name="vb_login_username" type="text" size="15" />
<label for="password">Password:</label><input id="password" name="vb_login_password" type="password" size="15" />
<label for="remember">Remember me</label><input id="remember" name="cookieuser" type="checkbox" checked="checked" />
<input type="submit" value="Log In" />
</fieldset>
<p><phrase 1="$vboptions[bburl]">$vbphrase[not_a_member_yet_register_now]</phrase>
</if></p>
</div>
|
|
#16
|
|||
|
|||
|
Anyone?
![]() I'm also looking for a way to add a header to the top of my news module in the same way I did with the latest threads. Code:
<if condition="$mods['identifier'] == 'news'"> <div id="news"> <h2>Latest News</h2> $modulehtml <if condition="$mods['identifier'] == 'latestthreads'"> </div> </if> Last edited by Sid; 10-13-2006 at 10:31 AM. |
|
#17
|
||||
|
||||
|
The welcome block template looks ok, other than the </if></p> in the 2nd to last line. I'm pretty sure those should be reversed. Do you have the module shell template enabled for that module? If not, you'll need to add $mods[formcode] near the top of the section for guests, and then </form> near the bottom. If the module shell template is enabled, then it might be a cookie problem.
For the news header, try this instead: PHP Code:
|
|
#18
|
|||
|
|||
|
Thanks. I used newscount == 1 for the first post and used newscount == 3 to close the DIV.
The login is still not working properly, though. After logging in, it seems to work but continues not to display the 'logged in user' type "Use Module Shell Template" is set to 'Yes' so I'm not entirely sure what's going on. Once I get this sorted my site seems ready to go live. |
|
#19
|
||||
|
||||
|
Sounds like a cookie problem then... Have you tried the suggestions in the FAQ forum about problems with logging in/out?
|
|
#20
|
|||
|
|||
|
Well I'd done a brand new install, imported most of the appropriate templates and it seems to have randomly fixed itself.
I'm trying to fix the breadcrumbs on my site now. I have the following code in my adv_portal template: Code:
<div id="breadcrumbs"> <h3>$pagetitle > <a href="index.php">mysite.com</a></h3> </div> |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how do i include a php file in page | Akagi | "How Do I..." Questions | 10 | 12-19-2006 05:06 PM |
| Any way to include specific modules into existing page? | BuckGB | "How Do I..." Questions | 8 | 09-27-2006 02:22 PM |
| Blank page with PHP File include | MMAFan | Troubleshooting & Problems | 1 | 12-24-2005 12:00 PM |
| Is it possible to include a whole subdirectory/.php file as a custom page? | tarzanna | Troubleshooting / "How do I..." Questions | 1 | 01-17-2005 12:21 AM |