Welcome, Guest. Please Login or Register.
April 26, 2025, 04:01:55 PM
Home Help Search Log in Register
News: If you are still using YaBB SE, please consider upgrading to SMF as soon as possible.

YaBB SE Community  |  Development  |  Completed mods  |  [Code] Goto new posts. « previous next »
Pages: [1] 2 Reply Ignore Print
Author Topic: [Code] Goto new posts.  (Read 7381 times)
Myiasis
Full Member
***
Posts: 178


I'm a llama!

[Code] Goto new posts.
« on: May 09, 2002, 08:46:20 AM »
Reply with quote

This is something really simple... Somebody asked for a "Goto First Unread Message" like vBulletin has.

The board apparently has this ability but I don't see it in use anywhere. I've noticed when I get notifications from threads it will take me to the new messages when using that link provided. That's the only place I've seen it used.

Since it isn't in active use by the board, I'm wondering if there are some issues with it and if it was intentionally left off? I put this on my board and it appears to be working fine, so I really don't know why it isn't available -- maybe just an oversight?

Super easy to do if you want to try it out.

In MessageIndex.php search for: $new = "<img src=\"$imagesdir/new.gif\" alt=$txt[302]\">";

That is line 275 if you haven't made any changes to this file before.

Change the line to: $new = "<a href=\"$cgi;action=display;threadid=$mnum;start=new\"><img src=\"$imagesdir/new.gif\" alt=\"$txt[302]\" border=\"0\"></a>";

The "new" image is now a link to the first unread message in that topic.

This doesn't provide exactly what that guy/gal was asking for but it gives the same type of functionality with very little changes to the source.

Even if you don't want the mod, there is a bug/typo in that line that could use some fixins. The alt=$txt[302]\" is missing the starting quote and should look like: alt=\"$txt[302]\". You can see the problem this causes by hovering your mouse over the "new" image in the topic index -- you get new" as the tooltip.
« Last Edit: May 09, 2002, 08:53:06 AM by Myiasis » Logged
Daniel D.
Mod Team
YaBB God
*****
Posts: 2935


Re:[Code] Goto new posts.
« Reply #1 on: May 09, 2002, 08:54:51 AM »
Reply with quote

Nice idea. :D Sounds good - will install it.
Logged

myk
Jr. Member
**
Posts: 99


I'm a llama! *spit*

ICQ - 1938747 WWW
Re:[Code] Goto new posts.
« Reply #2 on: May 09, 2002, 09:17:37 AM »
Reply with quote

it didnt work for me. i got this message when clicking on any topic (not the "new" icon)

Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `'$'' in /home/www/wootlands/b0r3d/Sources/MessageIndex.php on line 275
 
Fatal error: Call to undefined function: messageindex() in /home/www/wootlands/b0r3d/index.php on line 298
Logged

claimed mods:
none. the world is better off with me on the receiving end of mods rather than the giving end
bad-d3v1L
Jr. Member
**
Posts: 74


ICQ - 89166331yogi33@hotmail.com WWW
Re:[Code] Goto new posts.
« Reply #3 on: May 09, 2002, 09:20:07 AM »
Reply with quote

same error on my board that's why i openend the new thread about this in Mod Idea Forum ;)
Logged
Myiasis
Full Member
***
Posts: 178


I'm a llama!

Re:[Code] Goto new posts.
« Reply #4 on: May 09, 2002, 09:30:24 AM »
Reply with quote

Are both of you getting the same error? I have this installed on two live boards and it's working... Unless something didn't copy correct for you out of the post? Both of the boards I used it on are 1.3 with the bug pack applied.

Is this happening to you when you are viewing the list of topics in a board or only when you click a topic link? If it's when you are clicking a topic link look at the address it is displaying in the browser before clicking, does it look normal? Normal being compare it to a link here on this board.
Logged
myk
Jr. Member
**
Posts: 99


I'm a llama! *spit*

ICQ - 1938747 WWW
Re:[Code] Goto new posts.
« Reply #5 on: May 09, 2002, 09:34:53 AM »
Reply with quote

i cant tell if it looked normal because im in the middle of my "busy hours" and i dont wanna make stuff unavailable to my members...

but wouldnt the fact that /home/www/wootlands/b0r3d/Sources/MessageIndex.php is the correct path for the file on my server be an indicator that the link should show up correctly?


and i copied/pasted the code you indicated... what are the urls of the boards you have it installed on so we can c it in action?
Logged

claimed mods:
none. the world is better off with me on the receiving end of mods rather than the giving end
Myiasis
Full Member
***
Posts: 178


I'm a llama!

Re:[Code] Goto new posts.
« Reply #6 on: May 09, 2002, 09:40:15 AM »
Reply with quote

That path you mentioned was just PHP telling you which file the error was in. The actual error was the: "Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `'$'"

This could happen possibly if any of the quotes were not matched up or maybe even the semicolon missing at the end. It's a syntax error which makes me think something didn't copy correctly, but it looks right to me in the post....

Two boards you can play around with it on:

http://www.mud-master.com/forum/

and

http://www.mud-master.com/soh/

There's not real "general" area on either of those boards but if you want to play around just toss the messages in the first board and I'll get around to remove them later -- no biggie. You'll have to be a member to see the "new" links. The first link is the far more generalized of the boards, maybe that one would be better for testing, but it works on either one, feel free to play. :)
Logged
bad-d3v1L
Jr. Member
**
Posts: 74


ICQ - 89166331yogi33@hotmail.com WWW
Re:[Code] Goto new posts.
« Reply #7 on: May 09, 2002, 09:42:21 AM »
Reply with quote

Well my board is new and i haven't installed a Bug pack maybe thats the reason where can i get this pack?
Logged
myk
Jr. Member
**
Posts: 99


I'm a llama! *spit*

ICQ - 1938747 WWW
Re:[Code] Goto new posts.
« Reply #8 on: May 09, 2002, 09:58:31 AM »
Reply with quote

i have the bug pack installed... i'll try the code again in a minute

and since i copied/pasted your code, nothing was missing. any other ideas as to what it could have been?
Logged

claimed mods:
none. the world is better off with me on the receiving end of mods rather than the giving end
Myiasis
Full Member
***
Posts: 178


I'm a llama!

Re:[Code] Goto new posts.
« Reply #9 on: May 09, 2002, 10:01:52 AM »
Reply with quote

Quote from: bad-d3v1L on May 09, 2002, 09:42:21 AMWell my board is new and i haven't installed a Bug pack maybe thats the reason where can i get this pack?

There's a link to the bug fix download in the "Download" section -- link at the top of this board.
Logged
Myiasis
Full Member
***
Posts: 178


I'm a llama!

Re:[Code] Goto new posts.
« Reply #10 on: May 09, 2002, 10:05:10 AM »
Reply with quote

Quote from: myk on May 09, 2002, 09:58:31 AMand since i copied/pasted your code, nothing was missing. any other ideas as to what it could have been?

I really don't know. You got everything up to and including the semicolon? And all of that old line was replaced? I'll paste it again in this message just to be sure.

      if (!$new || $username=='Guest')
         $new = '';
      else
         $new = "<a href=\"$cgi;action=display;threadid=$mnum;start=new\"><img src=\"$imagesdir/new.gif\" alt=\"$txt[302]\" border=\"0\"></a>";

That's pasted right from the files I have live on those sites I listed. Little more than I listed before, just wanted to give a reference to the code. It's that last line (obviously) that is the replaced line.

That last line is ONE long line if it's not apparent -- the board is splitting it. Make sure it comes out on one line in the source. :)
« Last Edit: May 09, 2002, 10:06:47 AM by Myiasis » Logged
Myiasis
Full Member
***
Posts: 178


I'm a llama!

Re:[Code] Goto new posts.
« Reply #11 on: May 09, 2002, 10:09:15 AM »
Reply with quote

If you still have issues, look over the line and make sure in your source that every double qoute " has a backslash in front of it, except for the very first and very last one. And make sure the semicolon is at the end of the line (outside the last double quote).
Logged
myk
Jr. Member
**
Posts: 99


I'm a llama! *spit*

ICQ - 1938747 WWW
Re:[Code] Goto new posts.
« Reply #12 on: May 09, 2002, 10:12:21 AM »
Reply with quote

*turns on twilight zone music*

worked this time. there's no difference from last time either....
Logged

claimed mods:
none. the world is better off with me on the receiving end of mods rather than the giving end
Myiasis
Full Member
***
Posts: 178


I'm a llama!

Re:[Code] Goto new posts.
« Reply #13 on: May 09, 2002, 10:13:50 AM »
Reply with quote

Quote from: myk on May 09, 2002, 10:12:21 AM*turns on twilight zone music*

worked this time. there's no difference from last time either....

Hah, well I dunno, at least it's working! I probably cursed it by daring to put the word "simple" in the original post. I'll refrain from doing that in the future. :P
Logged
bad-d3v1L
Jr. Member
**
Posts: 74


ICQ - 89166331yogi33@hotmail.com WWW
Re:[Code] Goto new posts.
« Reply #14 on: May 09, 2002, 10:17:16 AM »
Reply with quote

* bad-d3v1L uses Twilight Music too

Didn't upgrade and now it works O_o really strange
Logged
Pages: [1] 2 Reply Ignore Print 
YaBB SE Community  |  Development  |  Completed mods  |  [Code] Goto new posts. « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.013 seconds with 16 queries.