vBadvanced Forums  
Go Back   vBadvanced Forums > vBadvanced Products > vBadvanced CMPS > vBa CMPS v2.0 Support > "How Do I..." Questions

Reply
 
Thread Tools Display Modes
  #1  
Old 09-24-2006, 05:45 PM
Sid Sid is offline
Member
 
Join Date: Sep 2006
Posts: 36
Default Include news, login etc. on an xhtml strict page.

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&amp;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>
I'd like to look more like this:
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>
ready to be placed into my own DIV.
Reply With Quote
  #2  
Old 10-04-2006, 02:01 PM
Sid Sid is offline
Member
 
Join Date: Sep 2006
Posts: 36
Default Re: Include news, login etc. on an xhtml strict page.

Anyone?
Reply With Quote
  #3  
Old 10-04-2006, 02:10 PM
Brian's Avatar
Brian Brian is offline
Administrator
 
Join Date: Jan 2004
Location: Georgia, USA
Posts: 34,240
Default Re: Include news, login etc. on an xhtml strict page.

Just edit your adv_portal_newsbits template and make your changes in there.
Reply With Quote
  #4  
Old 10-05-2006, 05:30 PM
Sid Sid is offline
Member
 
Join Date: Sep 2006
Posts: 36
Default Re: Include news, login etc. on an xhtml strict page.

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>
However, I'm still getting all sorts of tables and DIVs within the news section of the page:
Reply With Quote
  #5  
Old 10-06-2006, 09:38 AM
Sid Sid is offline
Member
 
Join Date: Sep 2006
Posts: 36
Default Re: Include news, login etc. on an xhtml strict page.

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 &gt; 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 &gt; <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>
I've looked through the vBadvanced templates but I have no idea where to start.

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.
Reply With Quote
  #6  
Old 10-07-2006, 07:36 AM
Sid Sid is offline
Member
 
Join Date: Sep 2006
Posts: 36
Default Re: Include news, login etc. on an xhtml strict page.

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="">
which appearsto be at the top of $home[centerblocks]. I'm not sure which template to remove this from.

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.
Reply With Quote
  #7  
Old 10-07-2006, 11:47 AM
Brian's Avatar
Brian Brian is offline
Administrator
 
Join Date: Jan 2004
Location: Georgia, USA
Posts: 34,240
Default Re: Include news, login etc. on an xhtml strict page.

Sounds more like a cookie problem. If you check the FAQ forum here, there's a thread regarding problems logging in/out.
Reply With Quote
  #8  
Old 10-07-2006, 04:03 PM
Sid Sid is offline
Member
 
Join Date: Sep 2006
Posts: 36
Default Re: Include news, login etc. on an xhtml strict page.

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>
I want to have each of these latest thread entires inside a single DIV, I'm not quite sure where to place the code for that. At the moment, all my module shell contains is:
Code:
$mods[formcode]

$modulehtml
And adv_portal looks like this
Code:
...

<div id="right">
$home[rightblocks]
</div>

...

Last edited by Sid; 10-07-2006 at 04:09 PM.
Reply With Quote
  #9  
Old 10-09-2006, 10:40 AM
Sid Sid is offline
Member
 
Join Date: Sep 2006
Posts: 36
Default Re: Include news, login etc. on an xhtml strict page.

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.
Reply With Quote
  #10  
Old 10-09-2006, 12:27 PM
Brian's Avatar
Brian Brian is offline
Administrator
 
Join Date: Jan 2004
Location: Georgia, USA
Posts: 34,240
Default Re: Include news, login etc. on an xhtml strict page.

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.
Reply With Quote
  #11  
Old 10-09-2006, 01:54 PM
Sid Sid is offline
Member
 
Join Date: Sep 2006
Posts: 36
Default Re: Include news, login etc. on an xhtml strict page.

Quote:
Originally Posted by Brian View Post
What exactly is the problem you're having with that code in the latest threads module?
I want to display my latest threads as a list inside a DIV such that my code is like this:

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>
However, I can't put the <ul> or the <div> tags inside the adv_portal_latesttopicbits otherwise they will be included in the loop.

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.
Reply With Quote
  #12  
Old 10-09-2006, 03:04 PM
Brian's Avatar
Brian Brian is offline
Administrator
 
Join Date: Jan 2004
Location: Georgia, USA
Posts: 34,240
Default Re: Include news, login etc. on an xhtml strict page.

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>
Reply With Quote
  #13  
Old 10-09-2006, 03:20 PM
Sid Sid is offline
Member
 
Join Date: Sep 2006
Posts: 36
Default Re: Include news, login etc. on an xhtml strict page.

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.
Reply With Quote
  #14  
Old 10-09-2006, 03:35 PM
Brian's Avatar
Brian Brian is offline
Administrator
 
Join Date: Jan 2004
Location: Georgia, USA
Posts: 34,240
Default Re: Include news, login etc. on an xhtml strict page.

No worries. I'm sure things will come easier the more you play with things.
Reply With Quote
  #15  
Old 10-10-2006, 02:34 PM
Sid Sid is offline
Member
 
Join Date: Sep 2006
Posts: 36
Default Re: Include news, login etc. on an xhtml strict page.

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&amp;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>
Does this code seem okay? Does the login rely on any of the other vBadvanced templates?
Reply With Quote
  #16  
Old 10-13-2006, 09:25 AM
Sid Sid is offline
Member
 
Join Date: Sep 2006
Posts: 36
Default Re: Include news, login etc. on an xhtml strict page.

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>
adds the header to the top of every news item, however.

Last edited by Sid; 10-13-2006 at 10:31 AM.
Reply With Quote
  #17  
Old 10-13-2006, 07:27 PM
Brian's Avatar
Brian Brian is offline
Administrator
 
Join Date: Jan 2004
Location: Georgia, USA
Posts: 34,240
Default Re: Include news, login etc. on an xhtml strict page.

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:
<if condition="$mods['identifier'] == 'news' AND $newscount == 1"
Reply With Quote
  #18  
Old 10-14-2006, 09:38 PM
Sid Sid is offline
Member
 
Join Date: Sep 2006
Posts: 36
Default Re: Include news, login etc. on an xhtml strict page.

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.
Reply With Quote
  #19  
Old 10-15-2006, 05:17 PM
Brian's Avatar
Brian Brian is offline
Administrator
 
Join Date: Jan 2004
Location: Georgia, USA
Posts: 34,240
Default Re: Include news, login etc. on an xhtml strict page.

Sounds like a cookie problem then... Have you tried the suggestions in the FAQ forum about problems with logging in/out?
Reply With Quote
  #20  
Old 10-16-2006, 06:23 PM
Sid Sid is offline
Member
 
Join Date: Sep 2006
Posts: 36
Default Re: Include news, login etc. on an xhtml strict page.

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 &gt; <a href="index.php">mysite.com</a></h3>
</div>
which works great for everything apart from the Homepage which doesnt show "Home" as it should. Any ideas of how to fix this?
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

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


All times are GMT -4. The time now is 06:59 AM.

Forums Powered by vBulletin, Copyright ©2000-2009, Jelsoft Enterprises Ltd.
Please note that vBadvanced is in no way affiliated with Jelsoft Enterprises Ltd, nor will Jelsoft be able to provide any support for our products.