vBulletin Modifications

custom array problem

Welcome to vBHackers.com! - vBHackers Updates:

Go Back   vBulletin Modifications > General vBulletin Section > General vBulletin Support

Reply
 
LinkBack Thread Tools
Old 05-21-2005, 07:23 PM   #1
Junior Member
Join Date: Aug 2004
Mousee is on a distinguished road

Default custom array problem

I've been coding my own Search Module modification for vbCMPS which
allows not only for full customization of the search module from the admincp, but also allows Users to modify which search engines they want to see on the 'portal' page and which they don't. They also have the option to disable it entirely as well.
Anyways, most of it has been really easy to do, however I've hit a 'snag' sort of.
So to understand that, I'll explain a bit:

I would like to make a drop-down list in the UserCP that shows all of the
current Search Engines in the database. The table for the 'search engines' is setup as follows:
You must first be a registered member to view any code.
Where -
searchengines = title of the search engine
value = html code for the search engine
defaultvalue = totally useless table, will probably remove it later :tongue:
optioncode = yes or no value ('yesno')
displayorder = the order in which the engine is displayed in the list (I probably won't use this either)
sengineid = Unique ID assigned by the database (like the user table is setup)

My first problem is that I don't know how to call up my list (array) of search engines from the database, and display them in a drop-down table WITH the little catch that I want (for instance) another drop-down menu next to it to show wether the selected search engine is enable or disabled.
That's my biggest problem at the moment anyways. Have been digging through various code for a few days now with no luck, so if someone would be so kind as to give me a few tips on that it would be most appreciated :wink:


My second problem is as follows:
What I've done so far, is setup a new column in the user table named 'sengineids', which will list only the id's of the search engines they have selected as 'enabled'. Unfortunately I don't fully understand how to write the code that can utilize that, tho I'm sure it's possible to use it.
So if someone could throw a location at me of where an example of such could be found, that would be awesome :wink:

Many thanks for any help on this matter.. and yes I don't program my own
vbulletin code very often, so forgive me if some of the above sounds a bit stupid, cause no doubt it is :tongue:
__________________




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Old 05-22-2005, 03:19 PM   #2
vBulletin Guru
Arnoud's Avatar
Join Date: Nov 2004
Real Name: Arnoud Kuipers
Location: Europe, Flanders
Arnoud is on a distinguished road

Default

For your second problem there is an easy fix:
Change the table from:
You must first be a registered member to view any code.
to
You must first be a registered member to view any code.
Where active is a small INT.




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-26-2005, 11:19 AM   #3
Junior Member
Join Date: Aug 2004
Mousee is on a distinguished road

Default

Many thanks Deaths, that works nicely

Also looking into my code further, I think the problem is just that the php code doesn't like being called into an html drop-down menu, since the actual code resides inside of that. So sometime soon I'll get around to putting the drop-down list into the function itself, and then just do away with the html (template) code entirely.
It seems to make sense anyways, heh.

Oh and I found some other problems in my code for the sql query, so that would be another problem :p




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-26-2005, 12:55 PM   #4
vBulletin Guru
Arnoud's Avatar
Join Date: Nov 2004
Real Name: Arnoud Kuipers
Location: Europe, Flanders
Arnoud is on a distinguished road

Default

For the dropdown, you could use the while(); function.

Inside it you can use
You must first be a registered member to view any code.
(note the "." before the "=")
And use that to construct your downdown.

Read a little on PHP.net, or download my vBMA hack and look for the dropdown part in stickets.php about the while function.




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Big problem!! (val()'d code on line 3) mant3ra General vBulletin Support 1 07-09-2006 02:24 AM
Weird skin problem. stivo General vBulletin Support 2 03-17-2006 04:41 AM
Array problem Maxx General vBulletin Support 6 12-20-2005 03:59 PM
TV FXP hack edit problem zen General vBulletin Support 0 07-20-2005 01:28 PM


All times are GMT -3. The time now is 12:32 PM.


SEO by vBSEO 3.2.0 ©2008, Crawlability, Inc. (Patent Pending)