Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by Zamtil (Guest)
Developer Last Online: Jan 1970 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 06-22-2001 Last Update: Never Installs: 0
 
No support by the author.

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

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 06-26-2001, 08:19 AM
chilliboy
Guest
 
Posts: n/a
Default

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
Reply With Quote
  #13  
Old 06-27-2001, 03:50 PM
Zamtil
Guest
 
Posts: n/a
Default

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.
Reply With Quote
  #14  
Old 06-27-2001, 09:46 PM
ToraTora! ToraTora! is offline
 
Join Date: Nov 2001
Posts: 255
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #15  
Old 06-28-2001, 12:32 AM
ToraTora! ToraTora! is offline
 
Join Date: Nov 2001
Posts: 255
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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...
Reply With Quote
  #16  
Old 06-29-2001, 09:04 AM
chilliboy
Guest
 
Posts: n/a
Default

Any news Zamtil?
Reply With Quote
  #17  
Old 06-29-2001, 09:59 PM
Zamtil
Guest
 
Posts: n/a
Default

Quote:
Originally posted by chilliboy
Any news Zamtil?
My forums got slammed the last couple days.. some game server down time, everyone headed for the boards. Anyways, I'm going to release my image gallery hack tonight.. packaging it up now. I'll try to do forms sometime this weekend.
Reply With Quote
  #18  
Old 06-29-2001, 10:04 PM
ToraTora! ToraTora! is offline
 
Join Date: Nov 2001
Posts: 255
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #19  
Old 07-01-2001, 12:05 PM
VirtueTech VirtueTech is offline
 
Join Date: Oct 2001
Posts: 189
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #20  
Old 07-03-2001, 06:17 PM
Zamtil
Guest
 
Posts: n/a
Default

Quote:
Originally posted by VirtueTech
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.
Yeah I'm not real happy with the creation process either. I really don't want to hack up 3-4 vBulletin files though, and try to make it a guided process: New Thread->New Poll->New Form.

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. =(
Reply With Quote
  #21  
Old 07-03-2001, 07:01 PM
chilliboy
Guest
 
Posts: n/a
Default

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
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:42 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05016 seconds
  • Memory Usage 2,296KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (4)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_imicons
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete