vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Last post on forum home, working version (https://vborg.vbsupport.ru/showthread.php?t=28561)

kms 04-26-2002 12:42 PM

hmmm ignore my advise, deleting that } just stops any of the forums counters from working.

My forums now have all the updated files and template as per the mod instructions except for admin/functions.php which is back to the old version and everything seems to be working ok ???

What are the implications of this ? Or better still how can i stop the

Parse error: parse error

&

Fatal error: Call to undefined function: makelogincode()

as above ???

THanks in advance

kms 04-26-2002 12:49 PM

p.s. this is my admin/functions.php at present all other files and templates as per hack instructions, why wont the mods work ? TIA :)

[code removed by PPN]

Mystics 04-26-2002 12:55 PM

@kms

Do NOT post the functions.php!!!!!

Please edit your Posting and remove the whole code.

Mystics

Scott MacVicar 04-26-2002 01:29 PM

send the functions.php to scott.macvicar@vbulletin.org and I'll look it over

kms 04-26-2002 01:39 PM

sorry about that, will mail it now :)

zachb 04-26-2002 11:58 PM

Email sent, Mystics. Thanks in advance for the help!

TObject 04-29-2002 10:29 PM

I am in the middle of installing this hack. I was about to go to moodify templates, I clicked on Templates - Modify in the Admin Pane, and got:

Quote:

Parse error: parse error in /***/admin/functions.php on line 811

Fatal error: Call to undefined function: vbdate() in /***/admin/sessions.php on line 356

TObject 04-29-2002 10:45 PM

Here is the line # 811:
PHP Code:

        $buffer str_replace(""", "\""$buffer); 

And here is the block of code this line is in:
PHP Code:

// ###################### Start phphighlite #######################
function phphighlite($code) {
  //PHP 4 only

  if (floor(phpversion())<4) {
    $buffer=$code;
  } else {
        $code = str_replace("<br>", "", $code);
        $code = str_replace("<br />", "", $code);
        $code = str_replace(">", ">", $code);
        $code = str_replace("<", "<", $code);

        $code = str_replace("&", "&", $code);
        $code = str_replace('$', '\$', $code);
        $code = str_replace('\n', '\\\\n', $code);
        $code = str_replace('\r', '\\\\r', $code);
        $code = str_replace('\t', '\\\\t', $code);

        $code = stripslashes($code);

        if (!strpos($code,"<?") and substr($code,0,2)!="<?") {
            $code="<?\n".trim($code)."\n?>";
            $addedtags=1;
        }
        ob_start();
        $oldlevel=error_reporting(0);
        highlight_string($code);
        error_reporting($oldlevel);
        $buffer = ob_get_contents();
        ob_end_clean();
        if ($addedtags) {
          $openingpos = strpos($buffer,'<?');
          $closingpos = strrpos($buffer, '?');
          $buffer=substr($buffer, 0, $openingpos).substr($buffer, $openingpos+5, $closingpos-($openingpos+5)).substr($buffer, $closingpos+5);
        }
        $buffer = str_replace(""", "\"", $buffer);
  }

  return "</normalfont><blockquote><pre><smallfont>PHP:</smallfont><hr>$buffer<hr></pre></blockquote><normalfont>";
}

Does anyone see anything wrong?

TObject 04-29-2002 11:06 PM

I rolled back all the changes to PHP files, and I still get the parse error on line 811 of admin/functions.php

TECK 04-29-2002 11:19 PM

just to let you.. i installed this hack without a problem in 225. it works like a charm. it's a great hack for busy boards. however, i made a little hack similary to this. PPN was kind enough to look at the code and his conclusion was that the code is reliable only for medium to small boards. i totally agree with him.

concerning the PPN's hack installation, is simple and precise, all you have to do is follow at letter his instructions.
a little note:
if you installed this hack, make sure you reply or post into a thread, if you dont see any latest title available in forumhome. it will update the database.

for my hack, you could evaluate the comments made by firefly and PPN here:
https://vborg.vbsupport.ru/showthrea...threadid=37952

one more time, if you follow PPN's install guidelines, it will work great. i know i did and got it working in about 5minutes. ;)
good luck and happy hacking. :D

TObject 04-29-2002 11:46 PM

I think I figured out what my problem was. I used the editor from within the cpanel, and the god dammed thing replaced &-strings inside the PHP file (such as &nbsp) with gibberish.

I will catch my breath, and try loading this hack again.

TObject 04-30-2002 12:42 AM

I edited the files again (this time using the PHP Coder Pro), and it looks like it's working! Thank you!

http://www.jeepbbs.net/forums/index.php

The only problem is that Updating Forums info (threough the "Update Counters") did not make the titles to appear. The titles only start appearing as users post new messages.

TECK 04-30-2002 01:24 AM

congrats :)
did you read my post above? it shows when someone posts because it updates the field only when someone posts... ;)

Dark Odin 04-30-2002 07:52 PM

How many queries does this add?

TECK 04-30-2002 10:22 PM

none.

yasunari 04-30-2002 10:56 PM

Quote:

Originally posted by yasunari
After i do forum update counter..

http://evillage.uhome.net/upload/VBBWO.gif

.I need to wait new members post/reply topic to get that field back.. anyway I can fix it?

Anyone have my problems after update forum counter or move/delete post?

I am using 2.2.5 :)

Scott MacVicar 05-01-2002 02:09 PM

I have checked this code and it works fine with my 2.2.5 board, the conclusion is that you have applied the hack inccorectly to the /admin/functions.php file.

Try re-applying or checking that code again.

yasunari 05-02-2002 12:39 AM

Thanks, I will check the code to see any problems :D

Bald Bouncer 05-06-2002 07:29 AM

I installed on 2.2.5 word for word and Im getting a lot of errors on the main page that look like :(

Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /home/whynot-d/public_html/udfxp/index.php(332) : eval()'d code on line 2

Bald Bouncer 05-06-2002 07:32 AM

ok I sorted it you said to add

$form['lasttitle']

to the template when it should be

$form[lasttitle]

brilliant hack Btw!

Bald Bouncer 05-06-2002 07:46 AM

edited

kms 05-07-2002 01:24 PM

Quote:

Originally posted by PPN
send the functions.php to scott.macvicar@vbulletin.org and I'll look it over
hiya PPN, any luck m8 ?

TIA

mashby 05-07-2002 02:19 PM

A rather lengthy hack, but it installed just as described and works like a charm. Thanks for making such a great hack!

mashby 05-07-2002 02:21 PM

I noticed that the thread title for items in "private" forums don't show up on the home page. Is that intentional?

Boofo 05-18-2002 05:22 AM

I just installed this hack and when I tried to update the forum counters, I got this error. Can you tell me what it means and what I need to do, please?

Database error in vBulletin Control Panel 2.2.5:

Invalid SQL: SELECT * FROM thread WHERE forumid='1' AND lastposter='Boofo's Babe' AND lastpost='1021587428'
mysql error: You have an error in your SQL syntax near 's Babe' AND lastpost='1021587428'' at line 1

mysql error number: 1064

Date: Saturday 18th of May 2002 07:10:17 AM
Script: http://www.bearfacts2.com/forum/forum/admin/misc.php
Referer: http://www.bearfacts2.com/forum/admi...action=chooser

Boofo 05-18-2002 08:04 AM

It seems that SQL doesn't like user names with apostrophies in them. "Boofo's Babe" was reading as "s Babe" and the DB didn't like that. I went ahead and posted in the forums and re-ran the update counters and it went off without a hitch with me as the last poster. Is there any way around this so users can use apostrohies in their names if they like?

BTW: Great hack, PPN! (as usual) :)

Jen 05-18-2002 05:27 PM

I have one quick question that doesn't seem to have been covered yet..

I want to guarantee that the user ALWAYS goes to the thread shown as the last post, but if you load up the index, wait for a few more posts to be made and then click the thread link it goes to the newest thread, NOT the one listed as last post.

This is confusing my users to no end (if they'd only click a little faster it wouldn't be a problem ;) ).

Is there any way to set the goto link to go to the thread listed as the last post even if there have been new posts made since?

Franki 05-20-2002 12:18 AM

I installed this hack and works fine BUT not with polls. I posted a new thread with poll and it didn't appear as a new post in the forum home page. Why is that?

Boofo 05-20-2002 12:24 AM

It works with polls here fine. I am running version 2.2.5, what are you running?

Frank-kun 06-01-2002 12:02 AM

Hmm..looks like I have a problem...

Had this hack since 2.2.0 and it's worked like a charm ever since - just did the Beyond Compare thing and it worked fine. But I updated to 2.2.6 today and it's having a problem. It works fine on a new reply or new thread, but won't work on moving or deleting threads or posts. It just puts it as before, with just name and date.

I tried installing from scratch, doing the update forums info thing again, still no dice.

Curiously enough it does seem to be leaving a space for the last title on forum home, it's just that it's blanked.

Could someone give some insight or perhaps point me to the file that deals with the move/delete to try and fix this?

Frank-kun 06-01-2002 01:57 PM

Hey, how about that, I solved my own problem ;)

I believe that in 2.2.6, the file to update forum post counts and lastposters was changed, so that the "title" is not part of the SELECT statement that is called in order to get the lastposts info. Because of this, $lasttitle is set to blank because according to the code, it tries to set itself using the "title" variable.

As a quick fix, you can simply have the SELECT statement call the title column again. So if you have this hack installed, your code should look like this:

in admin/functions.php:

PHP Code:

if ($lastposts['lastpost']>$lastpost) {
    
$lastposts=$DB_site->query_first("
            SELECT lastpost,lastposter
            FROM thread
            WHERE forumid = 
$forumid AND lastpost = '$lastposts[lastpost]'");
        
$lastpost=$lastposts['lastpost'];
        
$lastposter=$lastposts['lastposter'];
        
$lasttitle=$lastposts['title']; 

Just replace it with:

PHP Code:

if ($lastposts['lastpost']>$lastpost) {
    
$lastposts=$DB_site->query_first("
            SELECT lastpost,lastposter,title
            FROM thread
            WHERE forumid = 
$forumid AND lastpost = '$lastposts[lastpost]'");
        
$lastpost=$lastposts['lastpost'];
        
$lastposter=$lastposts['lastposter'];
        
$lasttitle=$lastposts['title']; 

...and you should have no problems with moving/deleting with PPN's Last Title hack.

Now, I don't know if the "title" was taken out of the code for some reason to fix a bug, but if it was, perhaps a better fix that preserves the bugfix might be more useful. But this one's a quick fix.

Thanks again PPN for a great hack.

Boofo 06-01-2002 02:01 PM

Do you need to chnage it to this for 2.2.5 too or just 2.2.6?

Frank-kun 06-01-2002 06:55 PM

Quote:

Originally posted by Boofo
Do you need to chnage it to this for 2.2.5 too or just 2.2.6?
Probably just for 2.2.6. If you're working ok with the hack and you have 2.2.5 you should probably just leave it be. But if you're having problems when you move or delete posts, then you should probably try to apply the change.

Boofo 06-01-2002 07:33 PM

Would it mess anything up to just go ahead and add it to avoid any problmes that could arise? I mean, if it won't hurt anything then it might be a good idea to go ahead and update it.

Quote:

Originally posted by Frank-kun


Probably just for 2.2.6. If you're working ok with the hack and you have 2.2.5 you should probably just leave it be. But if you're having problems when you move or delete posts, then you should probably try to apply the change.


alanvo 07-03-2002 08:55 AM

it screws up my tables, why is that, can anybody please help me...

http://www.demsang.net/forums

Boofo 07-03-2002 09:42 AM

You need to change the length you want the last time to be in this line:

Code:

$forum['lasttitle'] = substr($forum['lasttitle'], 0, 28);
The default length of the last title is 28 right now. Either make it a smaller number or add space.gif to your forumhome_forumbit_level1_nopost like this:

Code:

<td bgcolor="#1D6AA0" nowrap><smallfont color="#EEEEFF"><img src="https://vborg.vbsupport.ru/images/space.gif" width="200" height="1"><br><b>Last Post</b></smallfont></td>
Quote:

Originally posted by alanvo
it screws up my tables, why is that, can anybody please help me...

http://www.demsang.net/forums


fonzerelli_79 07-04-2002 12:23 PM

i installed the hack on my test forums and everything seems fine when i upload the files

when i change the template though i get this error on the forums home

Quote:

Parse error: parse error, expecting `']'' in ......./index.php(362) : eval()'d code on line 2
any ideas folks? ;)

Dark Jim 07-07-2002 11:02 PM

I would also like to have the posticon used last next to it on the forum home. :)

N9ne 07-09-2002 08:03 PM

[QUOTE]Originally posted by PPN
ok open showthread.php and above

PHP Code:

if ($goto=="nextnewest") {
  
$thread verifyid("thread",$threadid,1,1); 

add

PHP Code:

// goto newest thread
if ($goto=="newthread") {
  if (isset(
$forumid) and $forumid!=0) {
    
$foruminfo=verifyid("forum",$forumid,1,1);
    
$forumid=$foruminfo['forumid'];
    
$lastthread=$DB_site->fetch_array($DB_site->query("SELECT threadid FROM post WHERE username='$foruminfo[lastposter]' AND dateline='$foruminfo[lastpost]'"));
    
header("Location: showthread.php?s=$session[sessionhash]&threadid=$lastthread[threadid]");
    exit;
  }


now change the bit i told you to to
PHP Code:

<a href="showthread.php?s=$session[sessionhash]&goto=newthread&forumid=$forum[forumid]">$forum[lasttitle]</a

sorry it took so long to reply, i thought vBulletin would have had a way to do this, but it didn't so i wrote one.

Boofo 07-16-2002 09:21 PM

Scott,

Have you had a chance to look at the problem I am haing with apostrophes in the last poster name? (Posts 185 and 186 of this thread). :)


All times are GMT. The time now is 05:54 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02136 seconds
  • Memory Usage 1,864KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (7)bbcode_php_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete