New Stuff

Posted In: News. Reading This Thread:

LoonyPandora

| 17,916 posts


9th Feb 2007 at 12:31 am

LoonyPandora - Daft Cow?

Daft Cow?

 
Just finished upgrading the shoutbox. I got jealous of that Gabbly thing being so much more useful than the old shoutbox...

Here's the key features:

[list][*] Uses AJAX so you don't have to refresh to see new posts. A yellow flash indicates when there is a new post.
[*] Supports bold, italic and underline bbcode. Also supports links using the url tag.
[*] Improved 'past shouts' - now sorted into archives by day
[*] Now prints out a timestamp every hour, so you don't jump into a conversation that was over a long time ago.
[*] Times out after 10 minutes of inactivity and greys itself out. Simply go to another page, refresh the whole page or post a shout to bring it back.
[/list]


Also, on a side note, the URL for your profile has changed. Thanks the magic of mod_rewrite your profile now lives at: http://www.vegetablerevolution.com/user/<username>;

Mine, for example is:
http://www.vegetablerevolution.com/user/admin

Just makes things a bit cleaner and easier if you ever send it to people. And makes it easier to remember.

Any problems, questions, or suggestions please let me know. If you get any nasty errors, or it makes your computer go slow or anything at all - please let me know, it will need to be fixed.

Edited by LoonyPandora Feb 2007

Jewbacca

| 6,793 posts


9th Feb 2007 at 12:39 am

Jewbacca -

 
Good stuff!
AAAAAAARRRRRRRGHHHHHHHHHHHHH!!

Gary

| 3,774 posts


9th Feb 2007 at 12:52 am

Gary - I is not evil.

I is not evil.

 
It's slick - I like it. Lots of nice touches. Especially the yellow flash, that's a great addition. Not too distracting, but enough to make you realise something's going on.

Seeing how there's nothing underneath the Shoutbox how about fixing the position on the page or having it catch up with the scrolling so that it's still visible when you scroll down? I'm guessing the Shoutbox will be a little more active now conversation wise, and if you get caught reading a long thread on the forum you could miss a lot of stuff unless you keep scrolling up. Seeing how it's just empty space once you scroll past it anyway...
[http://imagegen.last.fm/Apnet/recenttracks/3/se_osiris.gif]

I like an escalator because an escalator can never break, it can only become stairs. There would never be an "Escalator temporarily out of order" sign, only an "Escalator temporarily stairs. Sorry for the convenience."
- Mitch Hedberg

Πανδώρα

| 15,327 posts


9th Feb 2007 at 12:58 am

 Πανδώρα -

 
ditto that

[http://img.photobucket.com/albums/v502/XDOW/Untitled-1copy-1.jpg]

it's the same in my IE too

and if anyone was wondering, i don't go skulking round ebay for pigeon crap, that's down to my mothers wierdo boyfriend wanting a calender full of flying rats


Edited by Πανδώρα Feb 2007
*burp*

Jewbacca

| 6,793 posts


9th Feb 2007 at 1:29 am

Jewbacca -

 
Quote: Mr_Lisa
ditto that


it's the same in my IE too


nice firefox theme, which one is that? i want it!
AAAAAAARRRRRRRGHHHHHHHHHHHHH!!

Πανδώρα

| 15,327 posts


9th Feb 2007 at 1:34 am

 Πανδώρα -

 

Gary

| 3,774 posts


9th Feb 2007 at 3:26 am

Gary - I is not evil.

I is not evil.

 
I hacked together a quick and dirty Firefox extension to take advantage of the new spangly auto-update-ness when you're looking at other webpages. I can't do the fancy auto-install link through BBCode, so if you want to use it you'll need to download this XPI file and then just drop it onto a Firefox window. It's basically just the VR Shoutbox embedded into the Sidebar, so all normal rules like the ten minute timeout still apply. If it times out, just hide and open the bar again. Use either View -> Sidebar -> VR Shoutbox or ctrl-shift-z to toggle it on and off.

[http://www.vegetablerevolution.com/Resources/Photos/random_stuff/firefoxshoutbox.jpg]
[http://imagegen.last.fm/Apnet/recenttracks/3/se_osiris.gif]

I like an escalator because an escalator can never break, it can only become stairs. There would never be an "Escalator temporarily out of order" sign, only an "Escalator temporarily stairs. Sorry for the convenience."
- Mitch Hedberg

Aras

| 1,774 posts


9th Feb 2007 at 3:27 am

Aras - Charmed I'm sure

Charmed I'm sure

 
mine vblank
She isn't in love...she's merely insane!

LoonyPandora

| 17,916 posts


9th Feb 2007 at 7:17 am

LoonyPandora - Daft Cow?

Daft Cow?

 
Anyone that it's blank for - can you go to http://www.vegetablerevolution.com/shoutbox/index.php

And see what shows up?

Big nose strikes again

| 2,343 posts


9th Feb 2007 at 8:49 am

 
blank!
[

Dissimulation

| 5,671 posts


9th Feb 2007 at 9:18 am

Dissimulation -

 
It's also blank with me, on both accounts.

LoonyPandora

| 17,916 posts


9th Feb 2007 at 10:20 am

LoonyPandora - Daft Cow?

Daft Cow?

 
Right, should work in IE now - all because it can't take a silly auto closing script tag. That was the cause of the blank-ness

If it's still blank, log out, and log into VR again, should be OK then.

LoonyPandora

| 17,916 posts


9th Feb 2007 at 12:32 pm

LoonyPandora - Daft Cow?

Daft Cow?

 
Now supports using links using the url tag like on the forum:

[url=http://www.website.com]Website[/url]


As for making it stay visible at all times, that's a damn fine idea... problem is, it's a bit too tall to fit full screen on a lot of peoples browsers where it currently is, so it would have to be shorter... Or I could make it the full length of the page, which would mean changing the design a bit...

Anyone else think it would be a great idea to have the shoutbox always visible?

Gary

| 3,774 posts


9th Feb 2007 at 12:47 pm

Gary - I is not evil.

I is not evil.

 
Quote: Parachutes
I'm going to kick your a*se RE: the new profile urls because it means I'm going to have to edit the Name list!


Modify the post, copy and paste it all into Notepad, click Edit -> Replace and replace "/forum/YaBB.pl?action=viewprofile;username=" with "/user/". The Replace All button is your friend
[http://imagegen.last.fm/Apnet/recenttracks/3/se_osiris.gif]

I like an escalator because an escalator can never break, it can only become stairs. There would never be an "Escalator temporarily out of order" sign, only an "Escalator temporarily stairs. Sorry for the convenience."
- Mitch Hedberg

LoonyPandora

| 17,916 posts


9th Feb 2007 at 1:23 pm

LoonyPandora - Daft Cow?

Daft Cow?

 
Quote: Parachutes
Yay for the new shoutbox, which appears to be working OK for me. But I'm going to kick your a*se RE: the new profile urls because it means I'm going to have to edit the Name list!



The old ones still work - Just the new ones are much prettier...

Albert Johanneson

| 14,477 posts


9th Feb 2007 at 2:00 pm

Albert Johanneson - Outside-left

Outside-left

 
thank me for bringing Gabbly to your attention

Dissimulation

| 5,671 posts


9th Feb 2007 at 3:11 pm

Dissimulation -

 
the shoutbox has become really small for some reason.

LoonyPandora

| 17,916 posts


9th Feb 2007 at 3:38 pm

LoonyPandora - Daft Cow?

Daft Cow?

 
I've put it back to normal, and will fiddle behind the scenes...

ooo-er

Albert Johanneson

| 14,477 posts


9th Feb 2007 at 7:06 pm

Albert Johanneson - Outside-left

Outside-left

 
Quote: Completely_Underwhelmed
mine keeps getting stuck with only one post. also in firefox!

mine us currently like this too.

LoonyPandora

| 17,916 posts


9th Feb 2007 at 7:41 pm

LoonyPandora - Daft Cow?

Daft Cow?

 
Anyone who is getting stuck with one post - clear your caches, that will sort it out.

Shoutbox in the gallery should now work too

Dr Namgge

| 14,541 posts


9th Feb 2007 at 8:21 pm

 
:-[ how do you clear your caches?
A Random Link
I don't give a f*ck you f*cking f*ck!

Quote:
You should try being me, I injure myself on an hourly basis in stupid and childish ways. I nearly gave myself a heart attack this morning when I stood on a glove.

LoonyPandora

| 17,916 posts


9th Feb 2007 at 8:25 pm

LoonyPandora - Daft Cow?

Daft Cow?

 
In Firefox it's Preferences -> Advanced -> Network (at least on the Mac version)

I have no idea where it is in IE...

LoonyPandora

| 17,916 posts


10th Feb 2007 at 4:44 pm

LoonyPandora - Daft Cow?

Daft Cow?

 
Quote: Surfer_Rosa
It has no filter for swearing!

This makes me too pleased


I'll soon change that

Gary

| 3,774 posts


10th Feb 2007 at 5:01 pm

Gary - I is not evil.

I is not evil.

 
But there's formatting now, so it can be bypassed!

Not that anyone here would of course...
[http://imagegen.last.fm/Apnet/recenttracks/3/se_osiris.gif]

I like an escalator because an escalator can never break, it can only become stairs. There would never be an "Escalator temporarily out of order" sign, only an "Escalator temporarily stairs. Sorry for the convenience."
- Mitch Hedberg

Gary

| 3,774 posts


15th Feb 2007 at 8:57 pm

Gary - I is not evil.

I is not evil.

 
If more than two BBcode italic tags are used, it breaks.

"Testing [i]just the one[/i]"
works fine.
"Testing [i]one[/i] two [i]three[/i]"
doesn't.
[http://imagegen.last.fm/Apnet/recenttracks/3/se_osiris.gif]

I like an escalator because an escalator can never break, it can only become stairs. There would never be an "Escalator temporarily out of order" sign, only an "Escalator temporarily stairs. Sorry for the convenience."
- Mitch Hedberg

LoonyPandora

| 17,916 posts


16th Feb 2007 at 7:40 pm

LoonyPandora - Daft Cow?

Daft Cow?

 
Works now

PHP doesn't do regexes as nicely as Perl. It sucks.

Will

| 6,984 posts


17th Feb 2007 at 10:43 am

 
Doesn't PHP use the same regex syntax as perl if you use the right functions? Works fine for me..

LoonyPandora

| 17,916 posts


17th Feb 2007 at 8:53 pm

LoonyPandora - Daft Cow?

Daft Cow?

 
Quote: Will
Doesn't PHP use the same regex syntax as perl if you use the right functions? Works fine for me..


Just because it's Perl compatible doesn't mean it's exactly the same. [tt]preg_replace[/tt] will match as much of a string as possible, meaning if you have multiple tags, it will match everything between the first opening tag, and the last ending tag.

In Perl, you can use the [tt]//g[/tt] modifier at the end of your regex to make it match as many times as possible, meaning it 'correctly' matches multiple times (correct, as in it's what I want it to do)

[tt]preg_replace[/tt] doesn't support the [tt]//g[/tt] modifier, and you have to do some workarounds to get an effect that's similar. So I read here anyway:

Quote:
By calling pcre_exec() multiple times with appropriate arguments, you can mimic Perl's /g option, and it is in this kind of implementation where \G can be useful.



In the end, I didn't bother and did it a different way - it's not as good, because it's case sensitive, and the url tags probably won't work if there is more than one in the message because of the same [tt]//g[/tt] problem.

function parseBBCode() {[br] $text = $this-&gt;text;[br] [br] $bbcodes = array();[br] $bbcodes[] = array("[b]","&lt;b&gt;" ;[br] $bbcodes[] = array("[i]","&lt;i&gt;" ;[br] $bbcodes[] = array("[u]","&lt;u&gt;" ;[br] $bbcodes[] = array("[/b]","&lt;/b&gt;" ;[br] $bbcodes[] = array("[/i]","&lt;/i&gt;" ;[br] $bbcodes[] = array("[/u]","&lt;/u&gt;" ;[br][br] foreach ($bbcodes as $bbcode) {[br] $text = str_replace($bbcode[0],$bbcode[1],$text);[br] }[br][br] $text = preg_replace("/\[url=(http\:\/\/)?(.*)\](.*)\[\/url\]/si","&lt;a href=\"http:\/\/\\2\" target=\"_blank\" rel=\"external\" class=\"external\"&gt;\\3&lt;/a&gt;",$text);[br][br] $this-&gt;text = $text;[br]}[br]

If you know of a PHP function that is better than [tt]preg_replace[/tt] for my needs, let me know

LoonyPandora

| 17,916 posts


17th Feb 2007 at 9:12 pm

LoonyPandora - Daft Cow?

Daft Cow?

 
Quote: Radical_Edward
Yo, not sure if you know, but their needs to be a word break after about 15 characters otherwise it forces the shoutbox to side scroll - however, since I'm guessing you set it to not use scroll bars, its not instantly apparent, unless you use a scroll whell while hovering over the shout box.


I'd commented that out for some reason... no idea why... It's back on now!

Will

| 6,984 posts


17th Feb 2007 at 9:35 pm

 
I don't really use any particularly complex regexes; only preg_match_all for screenscraping webpages and collating bits into RSS feeds.

Everyone seems to say how good Perl is for regexes, but PHP is fine for my use. I tried to get into Perl once, but found that PHP was simpler and more geared towards web use than Perl. Yes, i admit: i'm lazy so i use the easiest language.

Hmm, it's pretty stupid that PHP supports some modifiers and not others. There's probably no real reason why they can't implement it...

LoonyPandora

| 17,916 posts


17th Feb 2007 at 11:15 pm

LoonyPandora - Daft Cow?

Daft Cow?

 
No worries - doesn't matter what language you use really, PHP was designed for web use, so it stands to reason that it's 'better' for it.

Perl was designed for manipulating text, which is why it's the daddy for regexes. Since so much stuff is basically just 'text' (even images are) - Perl can be used everywhere.

It is a bit silly that PHP doesn't support it, but hey ho - It does the business, in the end

Will

| 6,984 posts


17th Feb 2007 at 11:25 pm

 
Quote: LoonyPandora
No worries - doesn't matter what language you use really

Oh, but it does. Programming something entirely in assembly gives you much more cred than making it in Visual Basic...

LoonyPandora

| 17,916 posts


17th Feb 2007 at 11:55 pm

LoonyPandora - Daft Cow?

Daft Cow?

 
hehe, it's not about cred - it's about getting the job done. People who program in assembly are just making a lot more work for themselves, and whoever has to maintain the code after them.

Will

| 6,984 posts


18th Feb 2007 at 12:15 am

 
Course it's about cred! Writing a sucky webserver on a TI-84 is a lot cooler than running a fully fledged one on a boring standard Dell PC.

Getting the job done is only second-rate. Why else do you think linux is a mess?


 
 
Πανδώρα: Beefy cheesemas to all, and to all a gravy brie
Rayanne Graff: Happy Easter.
IGH: Just who was The Brigadier
ratammer: squeak
IGH: Wibble
Vel: *sigh*
Emma: Hi VR...
Princess Psycho: Hi I am back in the UK so how are everyone been keeping. Has Fluffy had that little accident yet?
Claire: SHOUTBOX OF VRRRRRR
Rayanne Graff: Merry Christmas and a Happy New Year.
Lucozade Lover: Happy New Year!
Crinkle-Cut Beatroot: Happy new year <3
Claire: BOXSHOUT
Rayanne Graff: Happy Easter.
Emma: So… Posting a new thread is Fission Mailing… so I’m putting this here.
Emma: I know there aren’t many people looking at this anymore… but I have made the decision to stop paying for the VR hosting and to let the domain lapse.
Emma: I think it will be going offline around the end of May
Emma: It’s been almost 10 years since James passed away… and I feel like it’s time.
Emma: A lot of the regulars can be found on the VR veterans group on Facebook - if you see this and you’re not in there, come join us.

 

Page: