The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Some code modifications I am trying to figure out
I have taken to modifying the source code within various files such as newthread.php to make my forums do what I like. For example, I've changed the ban system to allow bans as low as 1 hour long, as well as giving the moderators the ability to input the length of the ban rather than choose from a list of predefined lengths.
Normally to make this work I dig around files looking for whatever makes things work, then tinker with the code until I get it to do what I want. Sometimes I can't figure out which files do what I want. -One of the things I'm stuck on is this nasty message: The message you have entered is too short. Please lengthen your message to at least 1 characters. My forums are relaxed and our rules allow for users to simply quote or blankpost without adding anything to the discussion. Right now the members have to put effort into blankposting by adding a broken image, changing the color of their text, or typing , and these methods aren't perfect. (Broken image shows up in quote, colored text shows up on highlight or different theme, alt-code shows up as box in chrome). I want users to be able to just press quote and reply, or to just press reply and post a blank message. I spent some time reading through newreply.php, and I think I might get by with a line like: $newpost['message'] = 'blank.png'; But I feel like that wouldn't work well and I'd rather just remove whatever code generates an error when a message is empty. I couldn't find what file has this code, any suggestions? -Another thing I am trying to figure out is a suggestion by one of my members: "On threads where there are unread posts, can we get the little piece of paper on the top left corner of each post to be highlighted? It would be nice to have some clear visual distinction between read and unread without checking the time." If I figure out what part of code decides if a post is "new" or "old", I could probably put in an if statement that changes the icon to a new highlighted one, but I have no idea where this code would be located. -Another request by a member: "When you choose to add someone as a friend, it asks you if you want to send them a friend request, in addition to saving their contact information. I feel that this is unnecessary, as everyone's intentions were probably to send them a friend request in the first place. Is it possible to just skip this and just send a request to the person without having to click that extra button?" If someone could tell me which file to dig through I'm sure I could figure the rest of this one out on my own -One member asked for more noticeable notifications. I think https://vborg.vbsupport.ru/showthread.php?t=232032 would be great for the member, but most members would prefer it the way it is now. How can I add this as an option in site display options so that some members can have one style and others can use the new one? That's all I can think of right now. I'll update with more as I think of them! |
#2
|
||||
|
||||
- doing a search in phrases for the too short message gives me the error phrase "tooshort" Doing a search through the files for that phrase gives me a list of 8 files (actually more, but results for "usernametooshort" came up also)you would have to edit to modify the action. Hopefully you have an editor that will allow you to search all files in a directory and then you will get them all.
- there is a View First Unread button on the top of the thread that takes you right to the first unread post. Isn't that what he wants? - can't do it with just a link. You need to modify the code. Look at the form actionrofile.php?do=doaddlist&list=&userid=2 That should tell you were to look. - You can offer different styles to users. So, an easy way is to have one style with one type of notification, the other with the original. |
#3
|
|||
|
|||
-I'm not sure how to search for specific files. My webhost is justhost and I use their filemanager, so all I can do is search filenames. I'll keep an eye out for tooshort, but I'm still unsure as to how I should go about this.
-I'll mention that and see if that's enough. -I don't understand? I don't really know php, I've just sort of taught myself what to do by looking at the code and figuring out how it works (a semester of java helped me get the idea of how things work). I don't know how to look at forms and the ?do= thing has always been frustrating because I can't figure out how to get to the things related to it. This reminds me, I wanted to set up a code that posts new threads when we submit an item to the main website's database. I figured it would be easy by just looking at how reports/infractions are auto-posted, but I couldn't locate the code for these because it was one of those ?do= things. It's not needed anymore because we compromised with new threads being submitted to the front page database, but it would be nice to know for future ideas. -That would be easy in some situations, but I already have to modify our three templates every time I change something. I don't want to add a fourth just for this, as there are a lot of template modifications. (Such as limiting what guests can view like memberlist and activity). Thanks for the quick response! |
#4
|
||||
|
||||
- don't you use a text editor to edit your files? I use BBEdit and I can search for terms in a directory. I can't imagine how anybody who codes can do without that feature.
- look at profile.php and go to where it says 'do' is doaddlist - around line 619. That is where the code is to add the user. Actually, if you want a one-click solution, the link in the member page goes directly to do=addlist which is around line 454, so perhaps that is where you want to start. - Make it a child style with just those couple of templates changed. That really is the easiest way to do this. (Or else probably write a few plugins to render some other templates you'd have to create and replace the main templates with the new ones if they chose to use notification style b, but like I said, the two separate style solution is going to be easier.) |
#5
|
|||
|
|||
-Like I said, I just find the files in filemanager and edit them from there. I can't search for words in other files, just titles of files and searching once I open a file. Is there a guide I can read to show me how to do things more efficiently? I basically opened the public_html in filemanager, went into the forum folder, and then mess around with the php files.
-I'll look into that and see what happens. -I'll look into child styles, but I really would prefer having a checkbox in forum display options for the bigger notifications. Like, right next to "show images". The member was glad with the information about new posts! Thanks again for helping me. |
#6
|
||||
|
||||
- Not really. I'm saying from experience that if you are going to get into coding, it really helps to be able to search for a word in all files in a directory. You want to know whenever that phrase comes up and you want to do something instead. How else will you find all instances you have to change - by just opening up all files and doing a search in that particular file? If you want to just open up the files and search for the code, then that is fine. I know there are other users who do it that way. But, personally, I would not be able to use that method. I would not be able to guess every file I would have to look at and I'm not a new user to vbulletin.
- I suppose you could create a Custom Profile Fields and then put a condition in all those templates - if fieldx == 'yes', show this code, else show that code, type of thing. You can try that on your test site and see how that works out. |
#7
|
|||
|
|||
Apart from using an editor or IDE as Lynne is suggesting you're preparing a hell of work and mistakes for yourself when you want to upgrade vBulletin.
Instead of editing the files directly find the hook nearest to the place you want to do damage and use it to create a plugin (= a PHP code that's run on the hook line). |
#8
|
|||
|
|||
Sorry for the delayed response. I've been away on personal business. Unfortunately the development administrator has not looked into this yet (I'm nowhere near as proficient as him, I focus more on running the site and PR type stuff).
I still feel completely lost on allowing blankposting. I looked into BBEdit and it looks to be mac only. I'm on a PC, are there any alternatives? Quote:
Edit: One more slight issue we've run into. For certain things (such as hide tags and QR images) we have noticed that hidden content can be found by quoting a post. I've narrowed it down to the newpost_quote template, and in styles where I remove the {vb:raw pagetext} from the template the vulnerability is removed (at the cost of quoting). I think the best solution would just be to add some command in the code to parse all BB code. I just don't know enough PHP to know what command to use. Here's an example of what I mean (I know parsebbcode() isn't real). Code:
ORIGINAL: [QUOTE={vb:raw originalposter}]{vb:raw pagetext}[/QUOTE] FIX: [QUOTE={vb:raw originalposter}]parsebbcode({vb:raw pagetext})[/QUOTE] |
#9
|
|||
|
|||
I don't understand why people have stopped helping me :/
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|