vBulletin Modifications

Help - Reading from database

Welcome to vBHackers.com! - vBHackers Updates:

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

Reply
 
LinkBack Thread Tools
Old 11-15-2006, 09:02 AM   #1
vB Newbie
Join Date: Apr 2006
Se7eN is on a distinguished road

Default Help - Reading from database

hi u all

Here's what i'm trying to do:
In a Mobile Phone Forum i want to users to choose a mobile phone on registration, that will be shown on their 'postbit_legacy' every time they post a message.

to do this i've divided my project in 3 steps:


1st - Create a table on MySQL database
I've created a table on my database called mobilephone with 3 fields: userid, model, image
2nd - Add form to register template and write to database code on register.php:

on register template i've added

You must first be a registered member to view any code.
on register.php file i've added

You must first be a registered member to view any code.
3rd - Read from database the model chosen by the user on register and display it on postbit_legacy
Now is when the problems start...

I've tryed to use this code:

You must first be a registered member to view any code.
on global.php

and this code:

You must first be a registered member to view any code.
on postbit_legacy template

Resuming:

the 1st and 2nd steps are working fine, cause i can see the information added on the database

The 3rd step isn't working, because the image is not visible on postbit_lecacy...

I've verified that there's no variable read on load...

So what i'n doing wrong here? What code should i use to get that info from database?

this is only on test mode, so the images are on the root of the forum, and that leads me to another question:

the database has this information

userid...........model...........image
1................6630..........6630.gif
6................6680..........6680.gif

should i add a field on the database with the path to the images, or may i put the path on 'postbit_legacy' template before the variable?

=============

any help or tip is welcome
if any of u know another way to do this, please don't be shy... post it here...


Thanks in advanced

Se7eN




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Old 11-15-2006, 02:00 PM   #2
vBulletin Guru
Nick R's Avatar
Join Date: May 2006
Real Name: Nick
Location: Cyberspace, UK
Nick R is on a distinguished road

Default

Wouldn't it just be easier to use vB's custom profile fields and then all you would need to do is either use $post[fieldX] in the template or maybe $post[mobile] with a little but of code in a hook?




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-15-2006, 08:33 PM   #3
vB Newbie
Join Date: Apr 2006
Se7eN is on a distinguished road

Default

Quote:
Originally Posted by rogersnm View Post
Wouldn't it just be easier to use vB's custom profile fields and then all you would need to do is either use $post[fieldX] in the template or maybe $post[mobile] with a little but of code in a hook?
plzz explain in detail how i do that


thanks


Se7eN




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-16-2006, 10:58 AM   #4
vBulletin Guru
Nick R's Avatar
Join Date: May 2006
Real Name: Nick
Location: Cyberspace, UK
Nick R is on a distinguished road

Default

ACP > User Profile Fields > Add New User Profile Field > and so on ;)




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-17-2006, 01:58 PM   #5
vB Newbie
Join Date: Apr 2006
Se7eN is on a distinguished road

Default

Quote:
Originally Posted by rogersnm View Post
ACP > User Profile Fields > Add New User Profile Field > and so on ;)
Thanks! That really worked out!!
I'm newbie on vB and PHP... :/

There's only one question:
How do i change the name of the field?

i have '$post[field8]' but i would like to have '$post[mobile]'...

i've tried "Replacement Variable Manager" by replacing 'field8' by 'mobile' but it doesn't work...

Once again, rogersnm plzzz save me

Thank you for your help

Se7eN




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-17-2006, 02:24 PM   #6
vBulletin Guru
Nick R's Avatar
Join Date: May 2006
Real Name: Nick
Location: Cyberspace, UK
Nick R is on a distinguished road

Default

well it's kinda pointless but make a new plugin with the location postbit_display_complete with the code:
Quote:
$post['mobile'] = $post['field8'];




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
database error ! candyman General vBulletin Support 15 09-07-2006 02:08 PM
MOVING a site and DATABASE MONKEY_MAN General vBulletin Support 25 08-10-2006 01:50 PM
database question world32 General vBulletin Support 7 07-02-2006 07:02 AM
Database problem Key-Hack General vBulletin Support 4 01-08-2006 03:25 PM
Database backup script cLord vBulletin Modification Requests 2 04-30-2004 05:53 PM


All times are GMT -3. The time now is 02:35 PM.


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