Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #11  
Old 07-28-2005, 08:25 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Boofo
schema=scheme?
Whoops! Schema is german, sorry for that
Reply With Quote
  #12  
Old 07-28-2005, 08:34 AM
Lionel Lionel is offline
 
Join Date: Dec 2001
Location: Delray Beach, Florida
Posts: 3,277
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok thanks. I am putting only a few, because I have hundreds of data

PHP Code:
CREATE TABLE `soundtracks` (
`
songidsmallint(5unsigned NOT NULL auto_increment,
`
titlevarchar(100NOT NULL default '',
`
urlvarchar(100NOT NULL default '',
`
playssmallint(5) default '0',
`
activeint(2NOT NULL default '0',
`
useridint(11NOT NULL default '0',
`
usernamevarchar(225NOT NULL default '',
`
rated_qtyint(5NOT NULL default '0',
`
ratingint(5NOT NULL default '0',
`
announceint(2NOT NULL default '0',
`
genrevarchar(50NOT NULL default '',
PRIMARY KEY (`songid`)
TYPE=MyISAM AUTO_INCREMENT=68 ;
-- 
-- 
Dumping data for table `soundtracks`
-- 
INSERT INTO `soundtracksVALUES (3'Chov''Chov.mp3'2214'haitiwebs'151'Carimi');
INSERT INTO `soundtracksVALUES (2'Solda Jah''09 - Solda Jah.mp3'3614'haitiwebs'3150'Jah Nesta');
INSERT INTO `soundtracksVALUES (4'Kidnapping''Kidnapping.mp3'1714'haitiwebs'151'Carimi');
INSERT INTO `soundtracksVALUES (5'Mwen sou''Mwen sou.mp3'1414'haitiwebs'000'Carimi');
INSERT INTO `soundtracksVALUES (6'Pitit sa''Pitit sa.mp3'2314'haitiwebs'130'Carimi');
INSERT INTO `soundtracksVALUES (7'Por favor''CARIMI -por favor.mp3'4214'haitiwebs'150'Carimi');
INSERT INTO `soundtracksVALUES (8'Two ta''Two ta - 06.mp3'814'haitiwebs'000'Jah Nesta');
INSERT INTO `soundtracksVALUES (9'Chasse ? l''enfant''Chasseenfant- 03.mp3'1514'haitiwebs'000'Jah Nesta'); 
And the crazy thing I am doing:

PHP Code:
  $extra1songsquery $DB_site->query("SELECT songid, title, url FROM soundtracks WHERE title='$extra1' AND active=1");
 while(
$extra1songrow $DB_site->fetch_array($extra1songsquery)) 
        {    
           
$clip1=$extra1songrow['title'];
    
$clip1id=$extra1songrow['songid'];
    
$clip1url=$extra1songrow['url'];
    
$extra1="<a href=\"showproduct.php?product=$product&do=main&mysong=$clip1id\">$clip1</a>"
        } 
 
$extra2songsquery $DB_site->query("SELECT songid, title, url FROM soundtracks WHERE title='$extra2' AND active=1");
 while(
$extra2songrow $DB_site->fetch_array($extra2songsquery)) 
        {    
           
$clip2=$extra2songrow['title'];
    
$clip2id=$extra2songrow['songid'];
    
$clip2url=$extra2songrow['url'];
    
$extra2=" &middot; <a href=\"showproduct.php?product=$product&do=main&mysong=$clip2id\">$clip2</a>"
        } 
 
$extra3songsquery $DB_site->query("SELECT songid, title, url FROM soundtracks WHERE title='$extra3' AND active=1");
 while(
$extra3songrow $DB_site->fetch_array($extra3songsquery)) 
        {    
           
$clip3=$extra3songrow['title'];
    
$clip3id=$extra3songrow['songid'];
    
$clip3url=$extra3songrow['url'];
    
$extra3=" &middot; <a href=\"showproduct.php?product=$product&do=main&mysong=$clip3id\">$clip3</a>"
        } 
 
$extra4songsquery $DB_site->query("SELECT songid, title, url FROM soundtracks WHERE title='$extra4' AND active=1");
 while(
$extra4songrow $DB_site->fetch_array($extra4songsquery)) 
        {    
           
$clip4=$extra4songrow['title'];
    
$clip4id=$extra4songrow['songid'];
    
$clip4url=$extra4songrow['url'];
    
$extra4=" &middot; <a href=\"showproduct.php?product=$product&do=main&mysong=$clip4id\">$clip4</a>"
        } 
 
$extra5songsquery $DB_site->query("SELECT songid, title, url FROM soundtracks WHERE title='$extra5' AND active=1");
 while(
$extra5songrow $DB_site->fetch_array($extra5songsquery)) 
        {    
           
$clip5=$extra5songrow['title'];
    
$clip5id=$extra5songrow['songid'];
    
$clip5url=$extra5songrow['url'];
    
$extra5=" &middot; <a href=\"showproduct.php?product=$product&do=main&mysong=$clip5id\">$clip5</a>"
        } 
 
$extra6songsquery $DB_site->query("SELECT songid, title, url FROM soundtracks WHERE title='$extra6' AND active=1");
 while(
$extra6songrow $DB_site->fetch_array($extra6songsquery)) 
        {    
           
$clip6=$extra6songrow['title'];
    
$clip6id=$extra6songrow['songid'];
    
$clip6url=$extra6songrow['url'];
    
$extra6=" &middot; <a href=\"showproduct.php?product=$product&do=main&mysong=$clip6id\">$clip6</a>"
        } 

how I am displaying it now:

Quote:
<span class="smallfont">$extra1$extra2$extra3$extra4$ext ra5$extra6</span>
and the result attached (I have 2 now, still testing)

Thanks.
Attached Images
File Type: jpg audio.jpg (6.0 KB, 0 views)
Reply With Quote
  #13  
Old 07-28-2005, 08:41 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK. Now if you could also post example Values for extra1, etc. and what should be the output then, I might be able to help you
Reply With Quote
  #14  
Old 07-28-2005, 08:45 AM
Lionel Lionel is offline
 
Join Date: Dec 2001
Location: Delray Beach, Florida
Posts: 3,277
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Values for extras are exactly the same as in title.
we put in a different song title in each one of the 6 extras textboxes. Then we query db. If title matches any extra, then we grab the info for that title.
Reply With Quote
  #15  
Old 07-28-2005, 08:47 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Please read post #5 again (mind that '=' is changed to '.='), i think that is your solution.
Reply With Quote
  #16  
Old 07-28-2005, 08:58 AM
Lionel Lionel is offline
 
Join Date: Dec 2001
Location: Delray Beach, Florida
Posts: 3,277
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MarcoH64
Please read post #5 again (mind that '=' is changed to '.='), i think that is your solution.
Phew! Thanks Marco. I would have never figured out that one. As a rule, when do we put a dot? LOL, looks like I will have to go back to some other scripts I made and start putting dots all over.
Reply With Quote
  #17  
Old 07-28-2005, 09:01 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

= is an assignment, .= is a concatenation
$foo = 'bar';
$foo = 'bar';
results is $foo being 'bar';

$foo = 'bar'
$foo .= 'bar'
results in $foo being 'barbar'
Reply With Quote
  #18  
Old 07-28-2005, 09:03 AM
Lionel Lionel is offline
 
Join Date: Dec 2001
Location: Delray Beach, Florida
Posts: 3,277
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Got it. Thanks. Not bad after 6 hours for just one dot :-)
Reply With Quote
  #19  
Old 07-28-2005, 09:04 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm ... lol.
SCNR
Reply With Quote
  #20  
Old 07-28-2005, 09:06 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Examples:
PHP Code:
$line '';
foreach (array(
'line1\n''line2\n') AS $text)
{
 
$line $text;

$line will now contain
Code:
line2
, since that was the last assignment.

2nd example:
PHP Code:
$line '';
foreach (array(
'line1\n''line2\n') AS $text)
{
 
$line .= $text;

$line will now contain:
Code:
line1
line2
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 02:52 PM.


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.04865 seconds
  • Memory Usage 2,332KB
  • 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
  • (4)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete