View Full Version : Uncheck Auto Parse by default
SloppyGoat
11-30-2002, 05:35 PM
Is there a way to have Auto Parse URL's unchecked by default, or disabled altogether, in a particular forum? Keep in mind, I don't want this to be global.
Dean C
11-30-2002, 08:22 PM
You can do it by default yes.... with no hacking :D (I can help you with that if you like)
But in a particular forum would require hacking :)
- miSt
SloppyGoat
12-01-2002, 09:18 PM
Any idea how to do it? I only want it disabled, or unchecked by default, in one forum.
Dean C
12-03-2002, 03:29 PM
In one forum would require hacking..
Let me look into it :D...
Dean C
12-03-2002, 03:34 PM
Ok here it is
Not tested but should work :D
In newreply.php
replace this:
if (!isset($parseurl)) {
$parseurlchecked="CHECKED";
}
with this:
if (!isset($parseurl)) and ($forum[forumid]!=x]) {
$parseurlchecked="CHECKED";
} else {
$parseurlchecked="";
Repeat these steps in newthread.php too :D
Remember to replace x to the forumid of the forum you want the parseurl box to be not checked in :D
Let me know if it works
Regards
- miSt
SloppyGoat
12-03-2002, 03:49 PM
Thanks! I'll give it a try when I get home. I'll let ya know how it works. Mucho gracias! :classic:
SloppyGoat
12-04-2002, 03:21 AM
Hmmmmmm....that doesn't seem to work, unless I did something wrong. The forum ID is just the name of the forum, right?
Parse error: parse error in newreply.php on line 464
How do you learn php coding anyway? It makes no sense to me. :confused: :lick:
Dean C
12-04-2002, 04:03 PM
Yes thats my poor PHP coding..
I'm sure one of our local geniuses will help fix that code i posted :)
- miSt
SloppyGoat
12-04-2002, 09:10 PM
Oh! I think I see what you mean now. The forum ID is at the end of the url to that forum? I'll try that instead... :confused:
Nope, that didn't work either. DOH! :nervous:
Help!!!! :disappointed:
NTLDR
12-04-2002, 09:48 PM
Try using $threadinfo['forumid'] and not $forum[forumid]
SloppyGoat
12-05-2002, 03:13 AM
Like this???
if (!isset($parseurl)) and ($threadinfo['forumid']!=22]) {
$parseurlchecked="CHECKED";
} else {
$parseurlchecked="";
That doesn't seem to work either. I tried it with and without the single quote around forumid, too. :disappointed:
The error is in that first line somewhere. That's line 464, anyway.
Dean C
12-06-2002, 03:37 PM
Try this:
if (!isset($parseurl) and ($threadinfo['forumid']!=22]) {
$parseurlchecked="CHECKED";
} else {
$parseurlchecked="";
SloppyGoat
12-06-2002, 04:36 PM
Ah, maybe too many parenthesis? I'll try it. :o
NTLDR
12-06-2002, 04:48 PM
That won't work as the is a ) missing.
This is what it should look like:
if (!isset($parseurl) and ($threadinfo[forumid]!=X])) {
Assuming $threadinfo[forumid] is the correct variable.
Dean C
12-06-2002, 05:36 PM
But why is there an extra bracket NTDLR on the end of the line?
I'm still learning php so please feel free to explain it to me :D
- miSt
NTLDR
12-06-2002, 05:50 PM
To match up with the one at the start ;)
if (!isset($parseurl) and ($threadinfo[forumid]!=X])) {
The colours shows where the brackets match up :)
SloppyGoat
12-07-2002, 05:05 AM
I get the same error. This is what I used....
if (!isset($parseurl) and ($threadinfo[forumid]!=22])) {
$parseurlchecked="CHECKED";
} else {
$parseurlchecked="";
Damnit! This isn't turning out to be an easy thing to do, I guess. :p
Dean C
12-07-2002, 12:05 PM
Yes NTDLR but look at your post you didn't have the correct number of brackets :) Lol i hope im right there
Try this:
if ((!isset($parseurl) and ($threadinfo[forumid]!=22])) {
$parseurlchecked="CHECKED";
} else {
$parseurlchecked="";
Regards
- miSt
SloppyGoat
12-07-2002, 05:18 PM
Ok, I'll try this. :D I'll let ya know. ;)
Dean C
12-07-2002, 06:54 PM
Lol please do :)
- miSt
NTLDR
12-07-2002, 07:30 PM
Originally posted by Mist
Yes NTDLR but look at your post you didn't have the correct number of brackets :)
Yep your right, all that vBcode and brackets all over the place sure is confusing, I hope I made the point about brackets matching up though :)
SloppyGoat
12-07-2002, 08:16 PM
Nope, there must be something else wrong. Same thing. :confused: Damn, php is some confusing sh*t, ain't it? LOL
Dean C
12-08-2002, 06:09 PM
Lol i got the syntax right :)
Hmmm...
Sloppygoat - post up the errors your getting :)
- miSt
SloppyGoat
12-09-2002, 11:18 AM
It's the same error as before. It just says "Parse error in line 464" in newreply.php", when I replace that section....no matter what I do. I've tried a bunch of combo's now and kept track of all of them. Here's what hasn't worked....
if (!isset($parseurl)) and ($threadinfo[forumid]!=22]) {
$parseurlchecked="CHECKED";
} else {
$parseurlchecked="";
if (!isset($parseurl)) and ($forum[forumid]!=22]) {
$parseurlchecked="CHECKED";
} else {
$parseurlchecked="";
if (!isset($parseurl) and ($threadinfo[forumid]!=22])) {
$parseurlchecked="CHECKED";
} else {
$parseurlchecked="";
if (!isset($parseurl) and ($forum[forumid]!=22])) {
$parseurlchecked="CHECKED";
} else {
$parseurlchecked="";
if ((!isset($parseurl) and ($threadinfo[forumid]!=22])) {
$parseurlchecked="CHECKED";
} else {
$parseurlchecked="";
if ((!isset($parseurl) and ($forum[forumid]!=22])) {
$parseurlchecked="CHECKED";
} else {
$parseurlchecked="";
SloppyGoat
12-12-2002, 10:53 PM
Bump! Anyone else have any ideas? I gotta find someone who can figure this one out. It's driving me crazy. :(
SloppyGoat
12-18-2002, 02:41 AM
Damnit! Someone's gotta know this one. :(
Boofo
12-18-2002, 03:15 AM
Try this:
if (!isset($parseurl) and ($threadinfo['forumid']!=22])) {
$parseurlchecked='CHECKED';
} else {
$parseurlchecked='';
filburt1
12-18-2002, 03:24 AM
No offense but has anybody heard of the phpinclude template? No hacking required.
Boofo
12-18-2002, 03:42 AM
But don't you start getting a load on the server doing it that way? Because it adds it to every page instead of just where he needs it.
SloppyGoat
12-18-2002, 06:37 PM
I'd much rather have a hack to do this, since it is only needed in one thread, and should be a small and simple change....if I just knew exactly how to do it. :ermm:
Thanks Boofo, I'll give that a try too.
Dean C
12-18-2002, 07:00 PM
Yes filburt... not everyone loves the phpinclude template as much as you hehe ;)
Boofo
12-19-2002, 09:30 PM
Mist, where's the bee? I like the bee much better. ;)
SloppyGoat
12-20-2002, 04:18 AM
Originally posted by Boofo
Try this:
if (!isset($parseurl) and ($threadinfo['forumid']!=22])) {
$parseurlchecked='CHECKED';
} else {
$parseurlchecked='';
Nope, same parse error in line 464. :cry: Could I be using the wrong forumid or something? This is what it says at the end of the url in the main directory of that particular forum, so I assumed that's the id I should use? (forumdisplay.php?s=&forumid=22) Of course, the reply id changes depending on which thread you're replying to.....and I've been testing this on the newreply.php each time.
[edit]
I also tested it in newthread.php, just out of curiosity, and I get the same error there too. (different line number, of course)
Boofo
12-20-2002, 04:23 AM
Try this. I forgot the bracket.
if (!isset($parseurl) and ($threadinfo['forumid']!=22])) {
$parseurlchecked='CHECKED';
} else {
$parseurlchecked='';
}
SloppyGoat
12-20-2002, 04:30 AM
Nope. Damn! Man, this isn't turning out to be the easiest hack, but I just know it's something pretty simple like what you guys are suggesting. I'm sure we're on the right track, anyway.
Boofo
12-20-2002, 04:31 AM
Ok, give me the place you are trying to insert it at and I will try it here.
Dean C
12-20-2002, 08:28 AM
Make sure you are replacing the right code snippet again and try this:
if ((!isset($parseurl) and ($threadinfo['forumid']!=22])) {
$parseurlchecked='CHECKED';
} else {
$parseurlchecked='';
}
Boofo forgot the bracket again... i have no idea why your getting these errors..
- miSt
Boofo
12-20-2002, 03:45 PM
Mist, you have 1 too many brackets now. You need a right bracket for every left one. You have 4 left brackets and 3 right ones. :)
SloppyGoat
12-20-2002, 04:23 PM
Originally posted by Boofo
Ok, give me the place you are trying to insert it at and I will try it here.
replace: (starts on line 464 in my newreply.php)
if (!isset($parseurl)) {
$parseurlchecked="CHECKED";
}
with:
All the suggested code so far....except the one above, which I'll try when I get home tonight. :lick:
Dean C
12-20-2002, 04:56 PM
Ahhh i think i might have it this time!
Replace this:
if (!isset($parseurl)) {
$parseurlchecked="CHECKED";
}
with this:
if ((!isset($parseurl)) and ($threadinfo['forumid']!=22])) {
$parseurlchecked="CHECKED";
}
I dont think an else is possible (possible brainwave hehe) :)
That shouldn't give you a parse error and boofo i don't have an extra bracket do i? You missed out the one on the left which I highlighted
- miSt
Boofo
12-20-2002, 05:01 PM
I think this is what it should be without the else.
if (!isset($parseurl) and ($threadinfo['forumid']!=22])) {
$parseurlchecked='CHECKED';
}
Dean C
12-20-2002, 05:03 PM
Hehe i must have had the brainwave at the same time as you :)
- miSt
Boofo
12-20-2002, 05:04 PM
Originally posted by Mist
if ((!isset($parseurl)) and ($threadinfo['forumid']!=22])) {
$parseurlchecked="CHECKED";
}
That shouldn't give you a parse error and boofo i don't have an extra bracket do i? You missed out the one on the left which I highlighted
- miSt [/B]
You still have too many. First count all the brackets thast face left and then count all the brackets that face right. They should be the same amount. You have the right amount this time but I don't think you need to have 2 of them at the start. I could be all wrong on this. :)
Boofo
12-20-2002, 05:06 PM
Originally posted by Mist
Hehe i must have had the brainwave at the same time as you :)
- miSt
They say great minds think alike. ;)
Dean C
12-20-2002, 06:16 PM
oooopseeee..
if ((!isset($parseurl) and ($threadinfo['forumid']!=22])) {
$parseurlchecked="CHECKED";
}
Im blind to that extra bracket!
Yes great minds do think alike :p
- miSt
SloppyGoat
12-20-2002, 08:21 PM
Ok,I'll try the last one then. Although I don't know php at all, I can't see how this one works, when I could kind of understand the first ones. :confused:
I'll let ya know what happens. ;)
Boofo
12-20-2002, 09:11 PM
Originally posted by Mist
oooopseeee..
if LL!issetL$parseurlR and L$threadinfo['forumid']!=22]RR {
$parseurlchecked="CHECKED";
}
Im blind to that extra bracket!
Yes great minds do think alike :p
- miSt
Ok, I will put an L where you have left brackets and an R where you have right brackets. You have 4 left brackets and 3 right brackets. Do you see what I mean?
It should be like this:
if L!issetL$parseurlR and L$threadinfo['forumid']!=22]RR {
$parseurlchecked="CHECKED";
}
NTLDR
12-20-2002, 09:20 PM
This threads been buggin me loads, so here we go, proper working coded, checked, double checked and tested on localhost:
if (!isset($parseurl)) {
if ($foruminfo[forumid]!=22) {
$parseurlchecked="CHECKED";
} else {
$parseurlchecked = '';
}
}
Boofo
12-20-2002, 09:23 PM
It takes a Master to put all of us Grasshoppers in our place. Good job, sir. :)
Dean C
12-20-2002, 09:36 PM
hehe thanks NTDLR ;)
But why doesn't my code work ?
- mist
SloppyGoat
12-20-2002, 09:52 PM
Originally posted by NTLDR
This threads been buggin me loads, so here we go, proper working coded, checked, double checked and tested on localhost:
if (!isset($parseurl)) {
if ($foruminfo[forumid]!=22) {
$parseurlchecked="CHECKED";
} else {
$parseurlchecked = '';
}
}
YES!!!! It works!!! Thank you so much!!! You're a master! I'm simply ecstatic!!!! :banana:
SloppyGoat
12-20-2002, 09:54 PM
Ok, one thing that puzzles me...why did my reply go up here? I replied after you posted the alternate code! :rolleyes:
NTLDR
12-20-2002, 09:59 PM
Thinking about I I expect we were using and and should have been using or. In the end if I can't get it to work like I want I give up and do it the way I posted!
SloppyGoat
12-20-2002, 10:01 PM
Ok, I guess I forgot to set my time zone here. DOH!
[edit] But it's still above the last post! WTH? Is the clock screwed up here? It's 10:58PM here now. :cross-eyed:
NTLDR
12-20-2002, 10:02 PM
*lol* After all this we used the wrong "and" this code also works:
if ((!isset($parseurl)) && ($foruminfo[forumid]!=2)) {
$parseurlchecked="CHECKED";
} else {
$parseurlchecked = '';
}
SloppyGoat
12-20-2002, 11:09 PM
Originally posted by NTLDR
*lol* After all this we used the wrong "and" this code also works:
if ((!isset($parseurl)) && ($foruminfo[forumid]!=2)) {
$parseurlchecked="CHECKED";
} else {
$parseurlchecked = '';
}
So, all it needed was "&&" instead of "and"? :knockedout:
BTW, any idea how to do this in editpost.php too? I'm sure this is the line that needs to be changed, right?
$parseurlchecked="CHECKED";
Do I just use part of that code in this case?
[edit]
Ok, I tried the same code replacement. It worked just fine! WooooHOOOO!!!!! :D
Dean C
12-21-2002, 05:45 AM
geez lol you learn something every day :)
- miSt
NTLDR
12-21-2002, 06:50 PM
Originally posted by SloppyGoat
So, all it needed was "&&" instead of "and"? :knockedout:
Due to the order of precedence in PHP I guess, as thats the olny difference between "and" and "&&" and "or" and "||".
PHP has the following order of precedence (Left being highest):
++ (Increment), -- (Decrement), /, *, %, +, -, <, <=, =>, >,
==, ===, !=, &&, ||, =, +=, -=, /=, *=, %=, .=,
and, xor, or
SloppyGoat
12-21-2002, 07:49 PM
It's Greek to me, but maybe I'll be forced to understand it eventually. LOL :D
Thanks again to all who've put forth the effort to help me out here. You're good people. I'm still relatively new to vB, and I really appreciate you sharing your knowledge. ;)
NTLDR
12-21-2002, 08:00 PM
Glad to share the knowlage :D *remembers what it was like not to know how to add a template!*
Boofo
12-21-2002, 08:26 PM
We can "ADD" templates in vBulletin now? Damn!
SloppyGoat
12-26-2002, 03:53 AM
Yep, right in the CP too. ;)
Velocd
12-26-2002, 04:03 AM
Heh, what a funny thread. It's funny to see how long it took you guys to notice that one particular bracket, which I spotted erroneous from the first page ;)
($threadinfo['forumid']!=22]))
:p
SloppyGoat
12-26-2002, 01:08 PM
Well! Where were YOU? LOL :D
SloppyGoat
04-11-2003, 01:57 AM
In case you don't feel like reading this entire thread, I'll sum it up for you. This is a hack to exclude autoparsing url's in a single forum....not globally.
Ok, a new interesting, but horrible issue has developed with this hack. My quickreply box ignores this code.
if (!isset($parseurl)) {
if ($foruminfo[forumid]!=22) {
$parseurlchecked="CHECKED";
} else {
$parseurlchecked = '';
}
}
I assume it's because of this line in the replybox template:
<input type="hidden" name="parseurl" value="yes">
[edit] Nope, actually, I just tried setting it to no, and it still parsed.
[edit2] But if I remove that line, it stops parsing globally. Hmmmm
Does anyone know how I can edit this to exclude just one of my forums, but not all? Can someone help stop the madness, please? :confused:
notorious
05-13-2003, 12:20 PM
i have looked at this code and instead of just one forum how would i use it so it was gobal and so that all the auto parse codes was unchecked
SloppyGoat
05-13-2003, 08:34 PM
I could be wrong, but try replacing this
$parseurlchecked="CHECKED";
with this
$parseurlchecked = ''; (That is two single quotes - not one double. Not sure if it matters.)
Or, this is a way that it could be done globally without hacking. Although, I haven't tried it.
'newthread' and 'newreply' templates (I'd guess the edit template too)
Edit the following code in those templates. (Should be pretty self explanitory)
<input type="checkbox" name="parseurl"
value="yes" $parseurlchecked> <b>Automatically parse URLs:</b>
automatically adds http://and around internet addresses.
Boofo
05-13-2003, 09:13 PM
Wouldn't it be?
if (!isset($parseurl)) {
$parseurlchecked = '';
} else {
$parseurlchecked="CHECKED";
}
SloppyGoat
05-13-2003, 09:28 PM
No, I don't think so. There is no "else" in the original lines. ;)
if (!isset($parseurl)) {
$parseurlchecked="CHECKED";
}
notorious
05-17-2003, 11:16 AM
this is the way my php is set up
i did as SloppyGoat said
and changed this
<br><input type="checkbox" name="email" value="yes" $emailchecked >
<b>Email Notification
to this
<br><input type="checkbox" name="email" value="yes" $email>
<b>Email Notification
thx for your help
SloppyGoat
05-17-2003, 02:31 PM
I thought you were trying to disable autoparsing? Not email notification. Oh well, if it works, it works. https://vborg.vbsupport.ru/external/2003/10/1.gif
SloppyGoat
05-19-2003, 08:25 AM
How can I make this apply to my quick reply box??? It doesn't work with it.
MrNoname
11-17-2010, 04:53 AM
Work great! Thanks so much!
And this is for VBB4. Working good!
if (!isset($checked['parseurl']))
{
if ($foruminfo[forumid]!=19)
{
$checked['parseurl'] = 'checked="checked"';
}else
{
$checked['parseurl'] = '';
}
}
SloppyGoat
11-17-2010, 05:09 AM
It works on the later version too, eh? Glad to hear it works! I haven't updated yet, so haven't had a chance to see. The only thing is, WYSIWYG mode will always parse, so you have to set your default to standard editor and tell people not to use the WYSIWYG editor.
I'd still love it if someone could figure out a way to fix that too. It took me a long time to figure this out. I finally got a programmer buddy of mine to help, along with some people here. Between the people here and him, it's been working great every since! I released it as an official version (without support) somewhere here, a long time ago.
Here it is...
https://vborg.vbsupport.ru/showthread.php?t=202666
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.