The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
New Posts Code not working in header
In vba cmps I moved this block of code to my header template. It was from the welcome block and was redundant.
The $newposts does not work on my vba pages or my regular forum pages. It just says "New posts: " without a number. Why would this be? I think it needs to call a php file but I'm not sure how to do that. Can someone please help enlighten me? Code:
<a href="$vboptions[bburl]/search.php?$session[sessionurl]do=getnew">$vbphrase[new_posts]</a>: $newposts |
#2
|
||||
|
||||
You will have to also use the relevant php code, it's best to utilize the plugin system for this. Give this a shot..
In Admin CP go to Plugins & Products > Add New Plugin. Leave the top box at vbulletin In Hook Location choose global_start from the dropdown For the title put something like New Posts Put this in the Plugin PHP Code box: PHP Code:
|
#3
|
|||
|
|||
This seems like it may be kinda advanced for me. I'm intrigued. Is there some background reading on understanding this?
|
#4
|
||||
|
||||
Well, it's pretty straight forward. You nailed it with your first post when you assumed it was calling php code from a file, so you are on the right path. As for a background on it, you can google php how to or sql tutorials and find many results that are helpful.
As for this modification, if you follow the instructions it should do what you ask. If there is a part you need help with in here, let me know the details and I will point you in the right direction. |
#5
|
|||
|
|||
Your instruction worked perfectly, thanks!
I guess I want to understand why I am doing what I am doing as opposed to just copying and pasting (which is fine by me!). It took me a couple of months to get the hang of templating and I'm just getting into how much it allows me to customize. I can actually understand what I'm doing. Things like adding a plugin is totally new territory for me. Where did you get that code from? I assume you pulled it from another location. Is there VB documentation on this? I know that I can read up on PHP and MYSQL, but I think learning it in the context of VB would be a good step for me. Thanks again! |
#6
|
||||
|
||||
Yes, that is correct I pulled that code straight out of the /modules/welcomeblock.php file. The thing to remember is that each template calls variables from an associated php file, sometimes trying to figure out which file can be a pain however. This is where turning on Debug Mode can be handy because it will allow you to see each template associated with it's related php file.
The (newly implemented) plugin system was designed so we can just add specific code to designated areas according to where they fit. As to where before you had to manually edit the .php file and then re-upload it. It also gives you an option to turn it off and on which is another great tool when it comes to testing. Mostly it's a matter of digging and experimenting at first, ensuring that you backup every single existence of every change so you can put things right back to the way they are in the event it doesn't work. You can also have a look through some of the tutorials in the Article forums for some how to's that will help you gain a better understanding of vB and how it works. |
#7
|
|||
|
|||
Cool, thanks for the tips. I look forward to digging some more.
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|