View Full Version : Where to start, beginning a custom css (no html tables) hack.
christopher_c
04-24-2004, 05:16 PM
I've just started using VB (after trying out phpbb and ipb) mainly because it allows me so much more control over the templates. What I dislike about VB (and all forums for that matter) is the over use of html tables & poorly placed html code. Namely, I don't want the search engine spiders to see 600 lines of junk html code + navigation + .... before they get to the beef of a post. For that reason I've been using the VB style manager to rewrite the html with new css designed content to replace the tables.
As I've been getting aquainted with the vb system, I've started also wondering how much "reinventing of the wheel" I'm doing here. For that reason I thought I'd look into what is already available. Some of the things I'm interested in doing are:
1) Setting up individual components of VB so that I can include them in other parts of my website (outside of the /forum/ base directory). Ideally what I'd like to be able to do is either use a php (include"") statement or a function call to insert that code. For instance, say on a given page on my site I wanted to include the navbar's user CP code. I want to do a insert_user_cp() and have it display something like:
<div class="userCP">
.....VB generated info about user.....
</div>
Does this type of functionality exist yet?
Problems I've encountered
1. GENERIC_SHELL does not seem to affect pages. Namely, when I insert some custom code into it, it doesn't display on individual pages. For instance, I have to repeat the same absolute div to include a floating logo on each of forum_display, forum_home, etc. templates.
2. Inability to include php code. For instance, at the bottom of the forum_display template, I'd like to add the line <? include"/home/....../logo.php" ?>, however this doesn't work. Do I need to manipulate the VB files themselves to make this happen, or is there something I'm missing to create PHP includes.
Thanks,
Chris
13th_Disciple
04-24-2004, 06:13 PM
the generic shell, i believe is just that.. a basic template of the forumhome, i think.. it isn't used.. it is there as a replacement if you need a basic, unmodified template to redo a hack or replace the entire template.. to use includes, look at the phpinclude_start template.. look at the example within that template.. you will then see how to use the vB includes system..
the css system is pretty solid within vB.. and I think you will have decent luck when you start the heavy modifying you are looking at doing.. to get to the css info, go to stlye manager, then check out All Style Options to see replacement info in header, footer, phpinclude_start, phpinclude_end, and headinclude.. below that, you will see all of the available css options..
btw, nice first post..
Zachery
04-24-2004, 06:27 PM
vBulletin 3 is fully XHTML complient or as close as possible, and its fairly well written code IMO. The generic Shell is a generic shell, if you want to effect mosdt o the forums you should be editing the header and footer templates. However, this is NOT the place for discussion of templates, that is what vBulletintemplates is for, and No you cannot execute phpcode in the templates you need to either hack this into a signle file or multiple files OR use the phpinclude_start / end templates.
christopher_c
04-24-2004, 06:34 PM
2. Inability to include php code. For instance, at the bottom of the forum_display template, I'd like to add the line <? include"/home/....../logo.php" ?>, however this doesn't work. Do I need to manipulate the VB files themselves to make this happen, or is there something I'm missing to create PHP includes.
Got it :) Thanks 13th.
I've already started digging quite deeply into the VB style manager and it's robust. At this point I'm just modifying the forum to look the way I want, I'll worry about exporting it to other sections of my sites later (yes I've got multiple VB license :P).
Some of the other stuff I'm definitely going to do (please let me know if this has been done already) is as follows:
Remove any session information for known search engine robots. Which function would I need to look into in order to do this?
Rewrite the forum urls from dynamic to static & add a custom mysql call to create a more person friendly URL. i.e. /forum/green/turnips-4.htm . I'll then use mod_rewrite to rewrite the url back to the appropriate thread (i.e. /forum/showthread.php?t=4)
PS. Sorry if this was posted in the wrong forum. If it would be better elsewhere, could a moderator please move it.
Zachery
04-24-2004, 06:46 PM
Got it :) Thanks 13th.
I've already started digging quite deeply into the VB style manager and it's robust. At this point I'm just modifying the forum to look the way I want, I'll worry about exporting it to other sections of my sites later (yes I've got multiple VB license :P).
Some of the other stuff I'm definitely going to do (please let me know if this has been done already) is as follows:
Remove any session information for known search engine robots. Which function would I need to look into in order to do this?
Rewrite the forum urls from dynamic to static & add a custom mysql call to create a more person friendly URL. i.e. /forum/green/turnips-4.htm . I'll then use mod_rewrite to rewrite the url back to the appropriate thread (i.e. /forum/showthread.php?t=4)
PS. Sorry if this was posted in the wrong forum. If it would be better elsewhere, could a moderator please move it.
Are you using vB2 or vB3? For vB3 Sessions wont appear to anyone unles they are nessary and DONT appear to spiders at all.
Spiders can already spider the forums fine with how vBulletin displays things so mod_rewirte is not really nessary. :) but it can be done.
christopher_c
04-24-2004, 06:53 PM
>> Are you using vB2 or vB3? <<
vB3 & that's good to know about the spiders and sessions. Which
>>Spiders can already spider the forums fine with how vBulletin displays things so mod_rewirte is not really nessary. but it can be done.<<
hehe, yah I'm a stickler for this stuff, I'd prefer to rewrite it to a static url instead of a dynamic one. Which function would I be modifying in order to rewrite the urls, do you know off hand? I haven't looked but I"m assuming somewhere within the session.php file.
I've got some neat ideas planned for integrating this forum and so far I'm very pleased with it.
Zachery
04-24-2004, 06:54 PM
I think someone has already released a mod for it, and i know very little about codeing :) so asking me is like asking a tree ;)
filburt1
04-24-2004, 06:55 PM
vBulletin 3 is fully XHTML complient or as close as possible, and its fairly well written code IMO. The generic Shell is a generic shell, if you want to effect mosdt o the forums you should be editing the header and footer templates. However, this is NOT the place for discussion of templates, that is what vBulletintemplates is for, and No you cannot execute phpcode in the templates you need to either hack this into a signle file or multiple files OR use the phpinclude_start / end templates.
It is not CSS-compliant, however, as I found out. Unfortunately the fix is very simple but I am doubtful if it would be made official: underscores are not allowed in CSS class names.
Zachery
04-24-2004, 06:57 PM
It is not CSS-compliant, however, as I found out. Unfortunately the fix is very simple but I am doubtful if it would be made official: underscores are not allowed in CSS class names.
I said XHTML not CSS :) which last time i checked they are two differnt standards
christopher_c
04-24-2004, 07:26 PM
>>It is not CSS-compliant<<
So far it's going pretty well modifying only within the style manager. Basically I'm chopping out all the html table code and replacing it with custom css code & using that phpinclude_start + the footer to reinclude the absolute elements.
What I expect is going to be somewhat more difficult to include the code chunks outside the VB forum directory.
As an aside, what is VB policy on using the same forum on multiple sites. I know that you cannot do multiple installs but also that parking is ok. What about a situation where you sites hosted on the same server make mysql calls to pull parts of the same forum. For instance, say the main forum is about "Trees who don't code". :P Could I query and include and maniupluate only a section of that main forum on say noncoding-walnut-trees.com?
Zachery
04-24-2004, 07:27 PM
>>It is not CSS-compliant<<
So far it's going pretty well modifying only within the style manager. Basically I'm chopping out all the html table code and replacing it with custom css code & using that phpinclude_start + the footer to reinclude the absolute elements.
What I expect is going to be somewhat more difficult to include the code chunks outside the VB forum directory.
As an aside, what is VB policy on using the same forum on multiple sites. I know that you cannot do multiple installs but also that parking is ok. What about a situation where you sites hosted on the same server make mysql calls to pull parts of the same forum. For instance, say the main forum is about "Trees who don't code". :P Could I query and include and maniupluate only a section of that main forum on say noncoding-walnut-trees.com?
Your best to email support@vbulletin.com for an exact anwser :)
sabret00the
04-24-2004, 08:03 PM
this has already been done and was showcased on .com to the b3est of my knowledge.
13th_Disciple
04-24-2004, 08:51 PM
using multiple domains, as kind of a parked, or redirect, i would think, isn't an issue.. if it is, then that would suck for a bunch of us, I believe..
the templates are the key to it all, chris.. getting to know them wil be the best thing you could do, and as I can see, you are becoming familiar with them already.. would be very interested on how it goes with the mod_rewrite function from dynamic to static URLs.. One thing that will certainly help you in all of that, would be to become part of something like a google adsense ad program.. it is small and very non-intrusive if you put a small ad in say your footer.. from what I have seen on my site, every time a new thread is created, the adsense form that is then generated for that page calls the google spider and it indexes that page..
and the fact that you aren't supposed to speak of templates here is quite annoying, but if you do have template questions, they are supposed to be asked at http://www.vbulletintemplates.com
I personally hate that "rule".. but threads have been known to get closed due to them being based on a template question or mod..
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.