Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 08-07-2003, 05:50 AM
DannyBoy8406's Avatar
DannyBoy8406 DannyBoy8406 is offline
 
Join Date: Apr 2003
Location: VA
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default SQL help....

alright....i posted this somewhere else, but now i realize it should have gone in here.....sorry, I'm new at this and just learning my way around here.....

I installed the "Member Photo Gallery" hack and to post member's photos you have to run an SQL query:

INSERT INTO photogallery VALUES (xxx, 'full-photo-URL', 'thumb-photo-URL', '');


xxx is replaced by the user id of the member.....




what query would you run to change a member's picture or delete it from the table?

When I try to put in a different photo, this is what I get...

Code:
Database error in vBulletin Control Panel 2.2.9:

Invalid SQL: INSERT INTO photogallery VALUES (5, 'http://www.wb-devotions.com/avatar.php?userid=5&dateline=1060140488', 'http://www.wb-devotions.com/avatar.php?userid=5&dateline=1060140488', '');

mysql error: Duplicate entry '5' for key 1

mysql error number: 1062
Reply With Quote
  #2  
Old 08-07-2003, 10:40 AM
ImportPassion ImportPassion is offline
 
Join Date: Mar 2002
Location: Gilbert, AZ
Posts: 605
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't know what that table looks like, but try

PHP Code:
INSERT INTO photogallery VALUES (NULL,5'http://www.wb-devotions.com/avatar.php?userid=5&dateline=1060140488''http://www.wb-devotions.com/avatar.php?userid=5&dateline=1060140488'''); 
Reply With Quote
  #3  
Old 08-07-2003, 11:20 PM
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Location: CA University
Posts: 1,696
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I would uninstall that hack and install mine, just being it is far more convienant.

(no running queries each time if you want to add a photo)

https://vborg.vbsupport.ru/showthrea...threadid=49565
Reply With Quote
  #4  
Old 08-08-2003, 05:16 AM
g-force2k2 g-force2k2 is offline
 
Join Date: Mar 2002
Location: Everywhere you wanna be..
Posts: 1,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i would suggest using Velocd's as well even though i haven't seen the code i can assure that its more proficient.

As for your sql error its because there's already a value for the 5th user.

in that case you have two options...

you can either update the query or you can deleted the column and then reinsert it...

i don't know the specifications but if you can give me the table layout i can help you with the queries.

but i would go with the third option and use Velocd's hack...

regards,
g-force2k2
Reply With Quote
  #5  
Old 08-08-2003, 06:05 AM
DannyBoy8406's Avatar
DannyBoy8406 DannyBoy8406 is offline
 
Join Date: Apr 2003
Location: VA
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

here's the query i ran to setup the table...

Code:
CREATE TABLE photogallery (
  userid int(10) unsigned NOT NULL default '0',
  photo_full varchar(100) NOT NULL default '',
  photo_thumb varchar(100) NOT NULL default '',
  comments mediumtext NOT NULL,
  PRIMARY KEY  (userid)
) TYPE=MyISAM;
thx for helping BTW..
Reply With Quote
  #6  
Old 08-08-2003, 06:30 AM
g-force2k2 g-force2k2 is offline
 
Join Date: Mar 2002
Location: Everywhere you wanna be..
Posts: 1,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hey k thanks for the info give me a minute and i'll create a file for you to use in combination with the hack...

regards,

g-force2k2
Reply With Quote
  #7  
Old 08-08-2003, 06:57 AM
g-force2k2 g-force2k2 is offline
 
Join Date: Mar 2002
Location: Everywhere you wanna be..
Posts: 1,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

don't know if it will be a 100% efficient but i tested it on my localhost and no parse errors were returned...

as for its functionality let me know if i have to fix anything

upload file to admin folder and then call the file by

yourforumurl/admin/photoadmin.php

regards,
g-force2k2
Attached Files
File Type: php photoadmin.php (1.9 KB, 6 views)
Reply With Quote
  #8  
Old 08-08-2003, 06:44 PM
DannyBoy8406's Avatar
DannyBoy8406 DannyBoy8406 is offline
 
Join Date: Apr 2003
Location: VA
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

working like a dream! thanks alot man!!!!
Reply With Quote
Reply

Thread Tools
Display Modes

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 01:45 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04680 seconds
  • Memory Usage 2,241KB
  • Queries Executed 14 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (1)postbit_attachment
  • (8)postbit_onlinestatus
  • (8)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_postinfo_query
  • fetch_postinfo
  • 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
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_attachment
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete