PDA

View Full Version : Form in new posting pages that provides variables to use in postbit


LostForWords
06-13-2011, 07:24 AM
This is a rather odd request I expect yet arguably relatively simple - unfortunately I'm awful at anything more complex than basic HTML design so PHP is beyond me. I would need this mod for V 3.8 and whilst I'd love it if I could have it free, I would be willing to pay for the mod so do get in contact.

A little background information:

I'm creating a creative writing site with a variety of different roleplaying games. For each game I dedicate a whole set of subforums with a unique skin. We then provide custom profile fields for members to fill out for their character in said game. We use these profile fields to code the postbit - so it looks like the member is logged into a different character account when they post (For example replacing the username with profilefield7 [which is the player's character's name] for example).

This works fantastically, however when members want more than one character then we have to create second, third, fourth accounts for them so they can play in the game across the different characters. I'd rather avoid doing this. It means people's post counts get split across accounts and we'll have loads of "character" accounts which we really don't want.

Basically the mod I have in mind would consist of a drop down menu in the new posting templates (new thread, edit and new reply to be precise). Members can select one of four options through this drop down. The postbit would be coded to look differently depending on what drop-down selection the player choses.

So for example: Profilefield10 and profilefield11 has the character name and character avatar of the first character and profilefield12 and profile13 has the same of the second character. A player has filled in all necessary profile fields and wants to make a post with their second character. They make their post and in the drop down menu select the second option - when they enter their post, only profilefield12 and profilefield13 are displayed in the postbit.

Basically within the postbit I'd need some sort of <if> variable which would probably look something like this: (Please excuse my poor comprehension of PHP - I hope I can illustrate what I mean enough so that you can understand).

<if post-dropdownmenu selected First Choice / 1 > <display profilefield10> <display profilefield11> </if> <if post-dropdownmenu selected Second Choice / 2 <display profilefield12> <display profilefield13> </if>

If you see what I mean?

Now I think this is achievable. vB is a great piece of kit and fully moddable so I'd love to get some help with this, even if it's just a point in the right direction.

It doesn't need to be complex. It doesn't need to change across forums. It doesn't need to know what the character names are. All it needs is a selection of 'one' 'two' 'three' and 'four' which creates a variable which can be read within the postbit and it can appear according to how the dropdown has selected.

BirdOPrey5
06-16-2011, 04:14 PM
This would be a pretty involved mod but the user of custom profile fields simplifies it somewhat. The fact you want a drop down box wold mean adding a new field to the post table in the database, which is a line I never crossed for mods I've made, but in theory not that hard.

But of course my mind is programmed to look for alternatives to database alteration at any cost so let me bring this possibility up...

Your users have 4 different "names..." If these names are stores in a custom profile field what if each user had to start (or end) each post they make with 1 of the 4 names.

Then a php plugin could read the post, extract which of the 4 usernames it matches, and set a variable from 1 to 4.

Then in the postbit template you'd have all your possible postbuts enclosed in IF conditions...


<if condition="$postbittype == 1">
postbit 1 here
</if>

<if condition="$postbittype == 2">
postbit 1 here
</if>

<if condition="$postbittype == 3">
postbit 1 here
</if>

<if condition="$postbittype == 4">
postbit 1 here
</if>



I'm not offering to make the mod because it would be of very limited use, just trying to give some ideas since you said you were open to a point in the right direction.