The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Details »» | |||||||||||||||||||||||||
Although I'm not quite ready for a release, I thought I'd announce this hack and get some feedback while I'm still in the development stages.
What does it do? Well, take a look first: http://www.noows.com/showthread.php?s=&threadid=1042 It allows you to associate a predefined fill-in-the-blanks form with a forum. Every thread can have form data associated with it, much like every thread can have a poll. Actually, with this hack, every thread can have both! In my case, I run a small guild/gaming site where players of EverQuest want to display their in-game character information. Many players have multiple characters, etc, which really doesn't make extending the membership profiles easy or practical. How does it work? ... Create a new thread/post as usual, associate a poll if the user wants. Once submitted, the thread starter or forum moderators, will have access to an 'edit form' button (same style/position as the existing 'new thread'/'post reply' buttons in the header/footer of every thread). By clicking on the 'edit form' button, the user is presented with a fill in-the-blanks form. formprefix field gets added to the forum table. A new table, called {formprefix} gets added to your vBulletin database. (in my case, 'eqchar') formid field gets added to the thread table. When the user wants to edit a form, form.php processes form_edit_{eqchar}. For those viewing the thread, showthread.php processes form_show_{eqchar}. Most of the work with this hack will be customizing the form_edit_ and form_show_ templates, as well as your table. Of course, once released I'd hope others would develop and share templates/table structures to truely make this a plug & play hack. Your custom table must contain an integer field named 'id'. After that, fields are labled as followed: text_{yourname}, num_{yourname}, and sel_{yourname}. Text type is self-explanatory. Num type ensures the user entered numeric data, or sets value to 0. Sel type is for drop down box selections. It's just a text field, but some extra processing is done to set the selector ("selected") to the current db value if the form is edited. These same db field names are used as $formvars[text_{yourname}] within your templates to display the database values. I'll probably add options for radio buttons and checkboxes. I seriously doubt I'll support binaries, as posts support this just fine. Sorry for the default theme look, will change eventually. I just migrated from PHP-Nuke - what can PHPNuke do that vBulletin doesn't do better? I'm already looking into writing a SIMPLE home page/weblog for vBulletin. I want one-two files that I can drop in on top of vBulletin and go. Show Your Support
|
Comments |
#12
|
|||
|
|||
Can you not just drop these from the template? I haven't checked but I thought almost everything was optional via templates. I'm sure you could also do a work around using phpinclude (which means you not buggering source code).
I'm trying to do quite a lot of stuff from phpinclude, which if you know what variables are available to you, can be pretty useful. I'm still trying to find out if I can get the 'name' of the $styleid available to use in phpinclude (which would be dam useful!!!!). Say you didn't want to use a different replacement set, or template set for you character profiles: Maybe you could just set a new style set for that forum which uses the same temp/rep set. Call it something like "CharaterProfile" if you had this as a variable to reference in phpinclude you could do something like: if ($styleid[name]?? == "CharaterProfile") { $Varible_for_Edit_GIF = $styleid[name] . "edit.gif"; } (First you may need to pass the styleid to submit.php - but you can do this via appending &styleid=X in the template - or you could just append your own varibiable - which if present runs another script in phpinclude etc etc) or something along those lines. If you get away from useing the 'replacement sets' to alter 'replacement variable' and set them from phpinclude you have a lot more flexibility. You can run switch() statements relating to forum: name, number, styleid etc etc then create you replaceables as variable to drop into templates. Hope this may help you in what you are after - or maybe I'm on the wrong track. PS - Anyone know with variable holds or how I could get hold of the NAME of styleid in phpinclude I'd be really greatful. Cheers |
#13
|
|||
|
|||
As I started to get this ready for release, I realized my 'eqchar' form and table were too long for a simple example. So, for those following this thread, here's your opportunity! I'm looking for ideas for a simple, general purpose form. I'd like to keep this to 5-10 fields MAXIMUM, so people aren't overwelmed when it comes to customizing the SQL and templates.
At least one field should use a drop down selector. Please provide values for the selector. |
#14
|
|||
|
|||
sure thing. I will have a example for you later tonight.
Im going to leave out the posting addys and such, but it will give you a basic idea of what i was thinking of. |
#15
|
|||
|
|||
http://vmudwnload.tripod.com/vbexample.html
Now, keep in mind none of the functions work other than the reset. We are currently searching server options, so i wasnt able to get everything patted down for posting links, or testing it fully out in PhP land, plus Im not completely sure how you have the hack set up for posting anyways..(my guess is postpoll..some of new thread...vbform...etc...so its a basic shell, hanging on good ol tripod...lol.. Take a look and see what you think. make sure you have your other browser window the (one that pops up when you click on the link) on full view to get a better picture of how it should look. Tripod has a way of making things look screwed up..I did the code on Arachnophilia, and had it all nice and neat, and "beautified". I dropped it into tripods HTML..and it litterally butchered it...lol... |
#16
|
|||
|
|||
Any news Zamtil?
|
#17
|
|||
|
|||
Quote:
|
#18
|
|||
|
|||
was that stat cateragory suggestion useful? lol
I dont know why i made it up to tell you the truth, due in part a person will be able to select what they want added in there anyways... The select option will be used though correct? |
#19
|
|||
|
|||
Firstly let me say this is a great idea.
It would be great if somehow the process was cut in half. Allowing admins to designate profile forums and then instead of the user having to start a new thread then go and click on "Edit Form" if the script new that the new thread was in the "Profile Forum" to just bring up the "Edit Form" template instead. I think the process of having to do the two things will confuse some users. However, this hack is greatly needed and will certainly help in many ways. Thanks Zamtil |
#20
|
|||
|
|||
Quote:
On the other hand, most of my users want to use the message body for attaching pictures or doing their own weblog, so skipping the message creation part altogether isn't practical. I haven't forgotten about this hack, but with all the problems people had getting my Image Gallery hack to work over the weekend, I'm a little gunshy about getting this one ready. I considered the ImageGallery hack the simple one to install, and I think I wrote 20 messages troubleshooting it over the weekend. =( |
#21
|
|||
|
|||
Hi Zamtil,
From what you have said I guess this hack is going to require adding numerous addition fields to existing table am I correct in this?? If this is so - and is one of the reasons why it is difficult to install and probably require a fair bit of time 'bug fixing' - then one way of significantly cutting down the required fields would be to do something like this: When you are creating a 'customised field' in a submit form you prefix the variable 'name' with 'custom'. So as an example I would have : variable name: Custom_Name , variable value: some holiday variable name: Custom_Introduction, variable value: blah blah variable name: Custom_Description, variable value: blah blah variable name: Custom_Available Dates variable value: July5 variable name: Custom_Cost variable value: ?500 variable name: Custom_Contact variable value: e-mail@home.com $Custom_Check = "custom"; $Custom_Field_Seporater = "field split here"; $Values_Seporater = "values split here"; foreach($HTTP_POST_VARS AS $key => $value) { $Custom_Field = substr_count($key , $Custom_Check); if($Custom_Field) { $key = str_replace($Custom_Check , "", $key); $Custom_Data .= $Custom_Field_Seporater . $Values_Seporater . $key . $Values_Seporater . $value; } } // You now have all the custom fields as a string with certain 'seporaters' which can be used to get the information back in the required format for processing later. The string $Custom_Data then gets put in the 'additional content' field in the table. To get the information back you can do something like this: // Get the string from the 'additional content' field then: $Fields_and_values = explode($Custom_Field_Seporater, $Custom_Data); foreach ($Fields_and_values AS $Extract_Info) { $Data = explode($Values_Seporater, $Extract_Info); $Custom_Field [$Data[1]] = $Data[2]; $Custom_Field [$Data[1]][name] = $Data[1] } I should now have an array $Custom_Field which holds the names and values of my custom defined fields which I can put into my related template as variables to be parsed. This way obviously limits on search capabilities and stuff, but significantly reduces the problems you would have with adding lots of new table field and associated problems. Its also pretty flexible as all the 'custom' data is only ever stored in one field, you don't have to bother with adding new fields to a table everytime you want to add something another value into your submit form. You may be able to move quite a lot of the 'hacking' into the phpinclude file, which would also be helpful for upgrades etc. As I don't know how your code works for this I may be barking up the wrong tree, but I thought I'd give you my input in the off chance it would be of use. Cheers |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|