PDA

View Full Version : cmps navbar issue


jluerken
11-25-2004, 02:47 AM
Hi developers,

I did the following:
Add new phrases:
threads_since_last_visit
Neue Threads seit letztem Besuch:
New threads since last visit:

posts_since_last_visit
Neue Posts seit letztem Besuch:
New posts since last visit:

Search in global.php for

if ($bbuserinfo['userid'])
{
$show['guest'] = false;


and change to:


// Lastest Posts and Threads since last visit hack
$getnewthread=$DB_site->query_first("SELECT COUNT(*) AS threads FROM " . TABLE_PREFIX . "thread WHERE lastpost > '$bbuserinfo[lastvisit]'");
$getnewpost=$DB_site->query_first("SELECT count(*) AS posts FROM " . TABLE_PREFIX . "post WHERE dateline > '$bbuserinfo[lastvisit]'");
// Latest Posts and Threads since last visit hack end
$show['guest'] = false;


Edit the navbar template and search for:

$vbphrase[last_visited_x_at_y]


and change to


$vbphrase[last_visited_x_at_y]<br>$vbphrase[threads_since_last_visit]<b> $getnewthread[threads]</b><br>$vbphrase[posts_since_last_visit]<b> $getnewpost[posts]</b></phrase>


This added a small info in the welcome box on how many new threads and posts the board has since the users last visit.

This is working fine for me on all forum pages but not in the cmps_index.php page of the portal.

I think the portal does not know the variables in time.

Can you please tell me where I should place the code that I added to global.php to make this tiny hack also working on the portal page?

Thanks in advance.

Brian
11-25-2004, 10:40 AM
In your /forum/includes/vba_cmps_include_bottom.php file look for:
global $pages, $stylevar, $headinclude, $header, $footer, $vboptions, $vba_options, $navbar, $cusid, $_REQUEST;


Right below that add:
global $getnewthread, $getnewpost;

And that should solve the problem.

Our Sponsors
 

oly51
11-25-2004, 12:25 PM
In your /forum/includes/vba_cmps_include_bottom.php file look for:
global $pages, $stylevar, $headinclude, $header, $footer, $vboptions, $vba_options, $navbar, $cusid, $_REQUEST;


Right below that add:
global $getnewthread, $getnewpost;

And that should solve the problem.Just added this hack and your fix and I still have the same problem (showing ok on vB but no numbers on portal page.) Any ideas?

jluerken
11-25-2004, 01:17 PM
Thanks for the fast answer but your small tip is not working :-(
Any other idea?

Our Sponsors
 

Brian
11-25-2004, 01:19 PM
You're displaying this info in the 'navbar' template, right?

oly51
11-25-2004, 02:19 PM
Yup. It works fine in the forum(s) but not on the portal page. Everything but the thread/post count show.

jluerken
11-25-2004, 02:31 PM
You're displaying this info in the 'navbar' template, right?

Yes, thats correct.

oly51
11-25-2004, 08:45 PM
In your /forum/includes/vba_cmps_include_bottom.php file look for:// ############################ Adv Navbar Function #################################
if (!function_exists('construct_adv_navbar'))
{
function construct_adv_navbar($navbits = '', $index = 'false')

{

global $vboptions, $vba_options, $vbphrase, $stylevar, $bbuserinfo, $show, $pmbox;

and below that add: global $getnewthread, $getnewpost;

Brian - your post called to add the code below the "Function to Print The Page Out" code.

I also added a hot link for the "New posts since last visit:" in the navbar template by using: <a href="$vboptions[bburl]/search.php?$session[sessionurl]do=getnew">$vbphrase[posts_since_last_visit]</a><b> $getnewpost[posts]</b>

Brian
11-26-2004, 01:28 PM
Thanks oly51... I *meant* to post the code from the adv_navbar function, but I had probably just woken up and wasn't thinking clearly yet. ;)