“x user(s)s online” link screws css of page?
-
Hello again,
I’m stuck on another problem I guess. I installed a “user online” plugin which works fine. Except if you click the link for further info on the guests/members, it puts this information on a screen with a screwed up layout.
Like this: https://www.stooker-web.nl/wp-useronline.php
Does anybody know what the problem here is ?
Greetz,
Jeroen Stooker
-
I heard that I have to change the wp-useronline to the index.php from the theme, cause the plugin was made for the standard skin from wordpress. But since I’m no hero in coding I’m still stuck.
Can anybody help me a little bit on the way if I post the wp-useronline.php and wp-content/themes/rin/index.php
wp-useronline
<?php
// Require WordPress Header
require(‘./wp-blog-header.php’);// Search Bots
$bots = array(‘Google Bot’ => ‘googlebot’, ‘MSN’ => ‘msnbot’, ‘Alex’ => ‘ia_archiver’, ‘Lycos’ => ‘lycos’, ‘Ask Jeeves’ => ‘askjeeves’, ‘Altavista’ => ‘scooter’, ‘AllTheWeb’ => ‘fast-webcrawler’, ‘Inktomi’ => ‘slurp@inktomi’, ‘Turnitin.com’ => ‘turnitinbot’);// Reassign Bots Name
$bots_name = array();
foreach($bots as $botname => $botlookfor) {
$bots_name[] = $botname;
}// Get User Online
$usersonline = $wpdb->get_results(“SELECT * FROM $wpdb->useronline”);// Type Of Users Array
$bots = array();
$guests = array();
$members = array();// Users Count
$total = array();
$total[‘bots’] = 0;
$total[‘guests’] = 0;
$total[‘members’] = 0;// Assign It To Array
foreach($usersonline as $useronline) {
if($useronline->username == ‘Guest’) {
$guests[] = array(‘username’ => stripslashes($useronline->username), ‘timestamp’ => $useronline->timestamp, ‘ip’ => $useronline->ip, ‘location’ => stripslashes($useronline->location), ‘url’ => $useronline->url);
$total[‘guests’]++;
} elseif(in_array($useronline->username, $bots_name)) {
$bots[] = array(‘username’ => stripslashes($useronline->username), ‘timestamp’ => $useronline->timestamp, ‘ip’ => $useronline->ip, ‘location’ => stripslashes($useronline->location), ‘url’ => $useronline->url);
$total[‘bots’]++;
} else {
$members[] = array(‘username’ => stripslashes($useronline->username), ‘timestamp’ => $useronline->timestamp, ‘ip’ => $useronline->ip, ‘location’ => stripslashes($useronline->location), ‘url’ => $useronline->url);
$total[‘members’]++;
}
}// Nicer Text
$nicetext = array();
if($total[‘bots’] > 1) { $nicetext[‘bots’] = ‘Bots’; } else { $nicetext[‘bots’] = ‘Bot’; }
if($total[‘guests’] > 1) { $nicetext[‘guests’] = ‘Guests’; } else { $nicetext[‘guests’] = ‘Guest’; }
if($total[‘members’] > 1) { $nicetext[‘members’] = ‘Members’; } else { $nicetext[‘members’] = ‘Member’; }// Check IP
function check_ip($ip) {
if(isset($_COOKIE[‘wordpressuser_’.COOKIEHASH])) {
return “($ip)”;
}
}
?>
<?php get_header(); ?>
<div id=”content” class=”narrowcolumn”>
There Are A Total Of <b><?=$total[‘members’].’ ‘.$nicetext[‘members’]?></b>, <b><?=$total[‘guests’].’ ‘.$nicetext[‘guests’]?></b> And <b><?=$total[‘bots’].’ ‘.$nicetext[‘bots’]?></b> Online Now.<b></b>
<table width=”100%” border=”0″ cellspacing=”1″ cellpadding=”5″>
<?php
if($total[‘members’] > 0) {
echo ‘<tr><td><h2 class=”pagetitle”>’.$total[‘members’].’ ‘.$nicetext[‘members’].’ Online Now</h2></td></tr>’;
}
?>
<?php
$no=1;
foreach($members as $member) {
echo ‘<tr>’;
echo ‘<td><b>#’.$no.’ – ‘.$member[‘username’].’</b> ‘.check_ip($member[‘ip’]).’ on ‘.gmdate(‘d.m.Y @ H:i’,($member[‘timestamp’]+(get_settings(‘gmt_offset’) * 3600))).’
‘.$member[‘location’].’ [url]</td>’.”\n”;
echo ‘</tr>’;
$no++;
}
// Print Out Guest
if($total[‘guests’] > 0) {
echo ‘<tr><td><h2 class=”pagetitle”>’.$total[‘guests’].’ ‘.$nicetext[‘guests’].’ Online Now</h2></td></tr>’;
}
$no=1;
foreach($guests as $guest) {
echo ‘<tr>’;
echo ‘<td><b>#’.$no.’ – ‘.$guest[‘username’].'</b> ‘.check_ip($guest[‘ip’]).’ on ‘.gmdate(‘d.m.Y @ H:i’,($guest[‘timestamp’]+(get_settings(‘gmt_offset’) * 3600))).’
‘.$guest[‘location’].’ [url]</td>’.”\n”;
echo ‘</tr>’;
$no++;
}
// Print Out Bots
if($total[‘bots’] > 0) {
echo ‘<tr><td><h2 class=”pagetitle”>’.$total[‘bots’].’ ‘.$nicetext[‘bots’].’ Online Now</h2></td></tr>’;
}
$no=1;
foreach($bots as $bot) {
echo ‘<tr>’;
echo ‘<td><b>#’.$no.’ – ‘.$bot[‘username’].'</b> ‘.check_ip($bot[‘ip’]).’ on ‘.gmdate(‘d.m.Y @ H:i’,($bot[‘timestamp’]+(get_settings(‘gmt_offset’) * 3600))).’
‘.$bot[‘location’].’ [url]</td>’.”\n”;
echo ‘</tr>’;
$no++;
}
?>
</table>
</div>
<?php
get_sidebar();
get_footer();
?>wp-content/themes/rin/index.php
<?php include(‘header.php’); ?>
<div id=”container” class=”clearfix”>
<?php include(‘sidebar.php’); ?>
<div id=”topcontentdouble”></div>
<div id=”content”>
<div class=”contentright”>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class=”post”>
<div class=”title” id=”post-<?php the_ID(); ?>”>
” rel=”bookmark”>
<?php the_title(); ?>
</div>
<h3><span class=”posted”><?php _e(“Posted on “); ?></span>
<?php the_time(‘l j F Y’,display); ?>
</h3>
<div class=”storycontent”>
<?php the_content(__(‘(more…)’)); ?>
</div>
<div class=”meta”>
<div class=”author”>
<?php the_author() ?> @ <?php the_time() ?> <?php edit_post_link(__(‘Edit This’)); ?></div>
<?php _e(“Filed under:”); ?> <?php the_category(‘ and’) ?>
</div>
<div class=”feedback”>
<?php comments_popup_link(__(‘No Comments’), __(‘1 Comment’), __(‘% Comments’)); ?>
</div>
<?php wp_link_pages(); ?>
<!–<?php trackback_rdf(); ?> –>
</div> <!– Closes the post div–>
<?php comments_template(); // Get wp-comments.php template ?>
<?php endwhile; else: ?>
<?php _e(‘Sorry, no posts matched your criteria.’); ?>
<?php endif; ?>
<div class=”postnavigation”>
<div class=”rightdouble”>
<?php posts_nav_link(”,”,’previous posts + »’) ?>
</div>
<div class=”leftdouble”>
<?php posts_nav_link(”,’« + newer posts ‘,”) ?>
</div>
</div>
</div> <!–Closes the contentright div–>
</div> <!– Closes the content div–>
<div id=”bottomcontentdouble”>
</div>
</div> <!– Closes the container div–>
<?php include(‘footer.php’); ?>That’s it I guess, hope somebody knows what to change.
Cya
This one is solved !!
- The topic ‘“x user(s)s online” link screws css of page?’ is closed to new replies.