vBulletin SEO Forums

SEO

vBulletin Search Engine Optimization

Buy vBSEO Now! HACKER SAFE certified sites prevent over 99.9% of hacker crime.
ne nw
vBSEO Total Support Team Launches DeskPro New vBSEO Discount Level for Network Builders vBSEO 3.2.0 GOLD Has Landed Success with vBSEO = 600ore Web Visitors + $1400 in a Day! Crawlability Inc. Files for SEO Technology Patent
se sw

Display Users Viewing non-vBulletin Pages in "Online Users"

This is a discussion on Display Users Viewing non-vBulletin Pages in "Online Users" within the Member Articles forums, part of the Focus on Members category; Hi, I had some non-vBulletin pages integrated to the vb database and i wanted to show the users viewing those ...

Go Back   vBulletin SEO Forums > Focus on Members > Member Articles

Enhancing 80 million pages.

Register FAQ Members List Social Groups Calendar Search Today's Posts Mark Forums Read
  #1  
Old 09-11-2007, 09:01 AM
NeutralizeR's Avatar
Senior Member
Big Board Administrator
 
Real Name: Mavi KARANLIK
Join Date: Feb 2006
Location: Ankara/TÜRKİYE
Posts: 296
Post Display Users Viewing non-vBulletin Pages in "Online Users"

Hi,

I had some non-vBulletin pages integrated to the vb database and i wanted to show the users viewing those pages in Online Users so i used this piece of code at the top of the non-vBulletin pages:

PHP Code:
<?php

error_reporting
(E_ALL & ~E_NOTICE);
define('NO_REGISTER_GLOBALS'1);
define('THIS_SCRIPT''adv_index');
define('VBA_PORTAL'true);
define('VBA_SCRIPT''CMPS');

$forumpath 'yourforumpath';

//example = '/home/msxorg/public_html/forum'

chdir($forumpath);

$phrasegroups = array();
$globaltemplates = array();
$actiontemplates = array();
$specialtemplates = array();

require_once(
'./includes/vba_cmps_include_template.php');
require_once(
'./global.php');

exec_shut_down();
?>
You can remove the lines related to vBadvanced if you don't have it installed.

More information can be found here:

How to create your own vBulletin-powered page! (uses vB templates)


-----------------------------------------------------------------------------

Let's say you have a page nothing to do with vBulletin & vBulletin database (wordpress pages, external html pages, even pages of your other domains etc...) and you still want to show the page viewers in Online Users of vBulletin.


Step - 1


Create a page called 'extra_online_users.php'.

Copy these lines in it:
PHP Code:
<?php

error_reporting
(E_ALL & ~E_NOTICE);
define('NO_REGISTER_GLOBALS'1);

$forumpath 'yourforumpath';
//example = '/home/msxorg/public_html/forum'

chdir($forumpath);

$phrasegroups = array();
$globaltemplates = array();
$actiontemplates = array();
$specialtemplates = array();

require_once(
'./global.php');


exec_shut_down();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html dir="ltr" lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Extra Online Users</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="content-language" content="en" />
</head>
<body style="margin: 0px">
<!-- anything can be put here. a little image, some text, etc... or you may keep it like this -->
</body>
</html>
Save and upload this page to your domain or forum root.

Step - 2

Open your non-vbulletin page and copy these lines to the very bottom of your page:
(Note: Before </body>)

HTML Code:
<iframe src="http://www.yourdomain.com/extra_online_users.php" scrolling="no" allowtransparency="true" frameborder="0" width="0" height="0"></iframe> 
Now, anybody visits your non-vbulletin page will be displayed at "Online Users".

But it will show their location as "Unknown Location". We can fix this of course.

Step - 3

Go to your AdminCP > Plugins & Products > Plugin Manager > Add new Plugin

Product: vBulletin
Hook Location: online_location_process
Title: Extra Online Users Process
Execution Order: 5

Code:
PHP Code:
if ($filename == 'extra_online_users.php')
{
    
$userinfo['activity'] = 'extra_online_users';

Save.

Go to your AdminCP > Plugins & Products > Plugin Manager > Add new Plugin

Product: vBulletin
Hook Location: online_location_unknown
Title: Extra Online Users Unknown
Execution Order: 5

Code:
PHP Code:
if ($userinfo['activity'] == 'extra_online_users')
{
    
$handled true;
    
$userinfo['action'] = 'Viewing -your custom page title comes here-';
    
$userinfo['where'] = '<a href="http://-your custom page url comes here-">-your custom page title-</a>';

Save.

If you want to apply this tutorial for more than one page, just create another instance of "extra_online_users.php" and name it like "extra_online_users2.php".

Don't forget to add the lines to the plugins and make the name changes.

Demo and screenshots:
Messenger Blog
(a wordpress blog - this image at the footer is called by iframe 'extra_online_users.php')

The viewer is displayed as:


Feel free to ask any questions realated to this tutorial.

Display Users Viewing non-vBulletin Pages in "Online Users" tutorial by NeutralizeR @ MsXLabs

Original thread:
Display Users Viewing non-vBulletin Pages in "Online Users" - vBulletin.org Forum
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on Facebook!
Reply With Quote
  #2  
Old 02-02-2008, 09:16 PM
basketmen's Avatar
Senior Member
 
Real Name: richie
Join Date: Dec 2006
Location: SEO Specialist
Posts: 137
great, this what i need

but it is better if there is simpler methode or vbseo can do that in future feature

Last edited by basketmen; 02-02-2008 at 10:02 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on Facebook!
Reply With Quote
  #3  
Old 02-02-2008, 09:23 PM
Ace Shattock's Avatar
vBSEO Staff
vBSEO Total Customer SupportCommunity Builder
 
Real Name: Ace Shattock
Join Date: Jul 2005
Location: New Zealand
Posts: 2,923
Quote:
Originally Posted by basketmen View Post
great, this what i need

but it is better if there is simpler methode or vbseo can do that in future feature




also in your first php code is this line needed??





Quote:
You can remove the lines related to vBadvanced if you don't have it installed.

More information can be found here:

How to create your own vBulletin-powered page! (uses vB templates)
Nope.
__________________
Ace Shattock / Crawlability Inc.
Support Team Launches New DeskPro Powered Tool Enhanced Support at Your Service

vBSEO 3.2.0 Launched - Maximum Overdrive for Your Web Traffic! Over 100 Instant SEO Optimizations

6X Traffic - $1400 in One Day with vBSEO! Imagine What the vBSEO Patent Pending Technology Can Do For You.


My Personal Sites: New Zealand Forum | vBulletin Modifications and Styles | vBulletin Hosting
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on Facebook!
Reply With Quote
  #4  
Old 02-17-2008, 06:48 AM
Junior Member
 
Real Name: Wong Tsz Yin
Join Date: Feb 2008
Posts: 1
Quote:
Originally Posted by basketmen View Post
great, this what i need

but it is better if there is simpler methode or vbseo can do that in future feature
Not really related
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on Facebook!
Reply With Quote
  #5  
Old 07-20-2008, 02:56 AM
amenadiel's Avatar
Senior Member
Big Board Administrator
 
Real Name: Felipe CHW
Join Date: Feb 2007
Location: Santiago, Chile
Posts: 162
will the users appear in the what's going on box?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on Facebook!
Reply With Quote
  #6  
Old 07-20-2008, 08:30 AM
NeutralizeR's Avatar
Senior Member
Big Board Administrator
 
Real Name: Mavi KARANLIK
Join Date: Feb 2006
Location: Ankara/TÜRKİYE
Posts: 296
Quote:
Originally Posted by amenadiel View Post
will the users appear in the what's going on box?
Yes.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on Facebook!
Reply With Quote
  #7  
Old 09-18-2008, 09:03 PM
Member
 
Real Name: myandy99
Join Date: Jun 2008
Posts: 52
I want to add the latest threads to my homepage which is a tpl(html template) page. How to do that?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on Facebook!
Reply With Quote
  #8  
Old 09-18-2008, 09:13 PM
amenadiel's Avatar
Senior Member
Big Board Administrator
 
Real Name: Felipe CHW
Join Date: Feb 2007
Location: Santiago, Chile
Posts: 162
you could do that using an iframe.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on Facebook!
Reply With Quote
  #9  
Old 09-18-2008, 09:56 PM
Member
 
Real Name: myandy99
Join Date: Jun 2008
Posts: 52
Thanks. do you have sample code?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on Facebook!
Reply With Quote
  #10  
Old 09-18-2008, 11:02 PM
amenadiel's Avatar
Senior Member
Big Board Administrator
 
Real Name: Felipe CHW
Join Date: Feb 2007
Location: Santiago, Chile
Posts: 162
Let's see, I'd start doing a really basic script. Something like:

Code:
<?php

require_once('./global.php');

$cadena="select * from vb_thread order by lastpost desc limit 0,10";
$getthreads = $db->query_read($cadena);

echo '<div><ul>';
    while($thread = $db->fetch_array($getthreads)) {
        $title=$thread['title'] ;
        $threadid=$thread['threadid'] ;
        echo '<li><a href="showthread.php?t='.$threadid.'">'.$title.'<a></li>';
     }
echo '</ul></div>';

?>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on Facebook!
Reply With Quote
  #11  
Old 09-19-2008, 11:31 PM
Member
 
Real Name: myandy99
Join Date: Jun 2008
Posts: 52
I got following error with the code after putting it on my tpl file:

Fatal error: Smarty error: [in pages/homepage.tpl line 147]: syntax error: unrecognized tag: $title=$thread['title'] ; $threadid=$thread['threadid'] ; echo '
'.$title.''; (Smarty_Compiler.class.php, line 439) in /home/sistest/public_html/smarty/Smarty.class.php on line 1095
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on Facebook!
Reply With Quote
  #12  
Old 09-19-2008, 11:57 PM
amenadiel's Avatar
Senior Member
Big Board Administrator
 
Real Name: Felipe CHW
Join Date: Feb 2007
Location: Santiago, Chile
Posts: 162
you shouldn't paste the code in your tpl, just put it in your vbulletin directory as (for example) lastposts.php and refer it in your tpl as an iframe.

<iframe src="/forum/lastposts.php"></iframe>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on Facebook!
Reply With Quote
  #13  
Old 09-20-2008, 12:22 AM
Member
 
Real Name: myandy99
Join Date: Jun 2008
Posts: 52
Thanks. The posts do display this time in a frame. But when I click a post in the forum it opens within the frame, which is not right. How to make it open in current page?

I will PM you the link so that you can see what I mean.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on Facebook!
Reply With Quote
  #14  
Old 09-20-2008, 01:21 AM
briansol's Avatar
Senior Member
vBSEO Pre-Release TeamDesign for SEOBig Board Administrator
 
Real Name: Brian
Join Date: Apr 2006
Location: Central CT, USA
Posts: 5,538
add target="_top" to the link


echo '<li><a href="showthread.php?t='.$threadid.'" target="_top">'.$title.'<a></li>';



it should be noted, that using iframes is generally a bad idea, as they are deprecated in xhtml strict.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on Facebook!
Reply With Quote
  #15  
Old 09-20-2008, 11:28 AM
amenadiel's Avatar
Senior Member
Big Board Administrator
 
Real Name: Felipe CHW
Join Date: Feb 2007
Location: Santiago, Chile
Posts: 162
I'm aware the proper way of inserting such a block should be with an

include('/forum/lastposts.php')

but without knowing what kind of CMS is used in the frontpage, it may result in trouble. For example, using an include with the code I proposed will break postnuke, because it has a global.php of his own.

well, who uses postnuke anymore btw.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on Facebook!
Reply With Quote
Reply

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
NEWBIE HERE with Issues On Vbseo Sitemap Do Hicky DieselMinded General Discussion 70 08-24-2007 04:32 AM
Sitemap alırken hata alıyorum :( erhanerhan_5 Türkçe 9 11-15-2006 09:44 AM


All times are GMT -4. The time now is 09:16 PM.


Powered by vBulletin Version 3.8.0 Beta 4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.5 ©2008, Crawlability, Inc.