View Full Version : How to recreate the news module?
HumanNature
07-20-2004, 07:18 PM
Hi, I have been reading the vbacmsp guide but I canīt not undestand exactly how to do what I want to do :(
I will try to easy explain me xd
What I want to do is "just" to make modules exactly like the news module but with different templates for each one.
For example I want add a module to show a post that I have posted in a forum that I can specify (like the news module) and I want this thread to be shown in my homepage but without the "writing by" without the "reply" without the "print and send buttons" and with other template changes. Really the only thing that I want to do is to edit the template, but the problem is that I donīt want to loose the news module, I want to have the news module and my "edited news module"
Is this posible?
Thanks in advance and sorry about my english :D
HumanNature
07-21-2004, 03:48 PM
:D Well Please someone tell me if this isnīt posible or if this is very difficult or if this is a silly post(xd) or if it is imposible to understood what I want to do :p
Brian
07-21-2004, 03:54 PM
It's possible, but would require a little work.
HumanNature
07-21-2004, 04:21 PM
:( thatīs bad...
StewardManscat
07-21-2004, 08:41 PM
I am not sure I understand the question, but it leads me to something that is simmering in the back of my tiny brain.
First, just leaning on the vb gurus here, I think think we could have each forum quite different, using the inherited styles and template system. But getting the original content (modules, blocks) onto each forum stumps me. With only one kick at the php cat (php_include_start), how does one avoid a humungeous source file, most of which is never needed (assume 200 lines of code for six different forums). How do you ensure only the particular 200 lines you want for the current forum are executed, and none of the others? And even so, isn't interpretation eventually going to get bogged down? Seems like we are herding everything through a very small funnel.
I think if there is a cool solution, I should ask over at vbulletin.org. But I bet somebody here might know.
But suppose there is no nice solution. Then, I think, this is what the fellow who posted this thread is getting at. Clone the news module.
We'd have to remove everything that checked for news options, since there is only one section in the cmps control panel for that. We could group those into variables at the top of the file to make life pleasant. By changing them there, we'd effectivley control which forum we were working off, and the other stuff, like templates and smilies etc.
I hope this makes sense to someone, it's a choice I need to make soon, and one that I do not have the experience and knowledge to make without glistening nervously.
To create customized forum sections, where the non-forum content is generated or pulled from anywhere else (usually involving php code), shall we use door number one (vb style/templates and a fix for php_start), dooor number two (yeah vbcmps!), or is there a thrid and more deluxe door still, in this mansion which is vb?
Hope this wasn't too obtuse. Please and thank you.
HumanNature
07-21-2004, 10:00 PM
Hi Iīm working on it. My knowledge oh php and sql betwen 1 and 10 is 2, but I will tell you what Iīm doing.
1) Duplicate de "news.php" file and rename it to "newsedit.php" and add it to your modules folder.
2) Create a module call "newsedit" that uses the "newsedit.php" and the same templates that "news" module.
3) Now you have to take the templates of vbadvanced that have a "news" is his name and remane them changing the "news" for "newsedit" and remaining the rest of the name in your templates manager.
4) Enter in this templates and change all the "news" that you find for "newsedit"
5) Now go to "edit Module" and change the name of the templates that you have customized to his new "newsedit" denomination.
6) Edit the "newsedit.php" and at the top of the page writte all the variables that are in the page and give them a value as long as this time we donīt have administration menu to do it.
This way I have my new module working althought Iīm not sure if it will work 100% fine.
I also have erased a lot of code o the newsedit.php (as long as the only thing that I want to display is the post) and a lot of the data base queries and still works xddd I canīt believe it.
This way you can clonate the "news" module a thousand times with just changing "news" for "whatyouwant"
HumanNature
07-21-2004, 10:09 PM
I am not sure I understand the question, but it leads me to something that is simmering in the back of my tiny brain.
I just want to have better control o what Iīm showing in my homepage and how Iīm showing it. If I talk about cinema I want to be able to shown the post in the homepage with a cinema-template (not the vbtemplates, just the template of the post that Iīm showing) but if I talk about photos I want to be able to shown the photo with a photo-customized template, and this simply thing is imposible without clonating the news module (or I donīt know how to do it)
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.