Jamroom Logo Jamroom 5 Core
is now Open Source!
User Support Forum Archive (Read Only)
Jamroom Developers:
Invalid YouTube ID - please enter a valid ID
jamesd116



Joined: 05 Jun 2006
Posts: 1559
Location: Rochester Pa

Posted: 06/25/09 07:49 
When working with the you tube module on the main page in the main directory what part of this code needs to come out to get rid of the need for the you tube id

Code
        // Error Checking - YouTube ID is required
        if (strlen($_post['ad_id']) === 0) {
            setFormHighlight('ad_id');
            jrSetFormNotice('error',$language['adClassified'][6]);
            jrLocation('adClassified.php?mode=create');
        }

        // We need to grab the YouTube ID from the URL they entered
        // URL will be like: http://www.youtube.com/watch?v=84sZMS95yYM
        // We need "v"
        if (isset($_post['ad_id']) && strstr($_post['ad_id'],'http')) {
            // They entered the FULL UL
            $_tmp = parse_url($_post['ad_id']);
            parse_str($_tmp['query'],$_tmp);
            // This will get us "v=84sZMS95yYM" - run through
            if (isset($_tmp['v']) && strlen($_tmp['v']) > 0) {
                $_post['ad_id'] = $_tmp['v'];
            }
            else {
                setFormHighlight('ad_id');
                jrSetFormNotice('error',$language['adClassified'][6]);
                jrLocation('adClassified.php?mode=create');
            }
        }
        else {
            // See if they gave us just the YouTube ID
            // We safeBaseName the value to prevent someone from entering a full path
            $_post['ad_id'] = safeBaseName(trim($_post['ad_id']));
        }



_________________
One day the court system will learn that a childs mother is not the only option...... Question is will it be too late by that time...
Back to top
SteveX
Ultrabubble


Joined: 30 Aug 2005
Posts: 8792
Location: Ultrabubble

Posted: 06/25/09 10:01 
Getting rid of the first part will remove the check for the id, but it looks like the id is needed for all of this code to work.


_________________
Kulshi Mezian!

"Stranger from another planet, welcome to our hole. Just strap on your guitar and we'll play some rock and roll"

Ultrabubble create things.
Back to top
jamesd116



Joined: 05 Jun 2006
Posts: 1559
Location: Rochester Pa

Posted: 06/25/09 21:20 
well how do I bypass gtting this error

Quote:
Invalid YouTube ID - please enter a valid ID



_________________
One day the court system will learn that a childs mother is not the only option...... Question is will it be too late by that time...
Back to top
SteveX
Ultrabubble


Joined: 30 Aug 2005
Posts: 8792
Location: Ultrabubble

Posted: 06/26/09 03:35 
You can just delete the first section and there will be no error notification, but the ad_id is needed for all of this code. What it does is to see if the id is given as part of a url, or just as an id.


_________________
Kulshi Mezian!

"Stranger from another planet, welcome to our hole. Just strap on your guitar and we'll play some rock and roll"

Ultrabubble create things.
Back to top
jamesd116



Joined: 05 Jun 2006
Posts: 1559
Location: Rochester Pa

Posted: 06/26/09 04:58 

SteveX:
You can just delete the first section and there will be no error notification, but the ad_id is needed for all of this code. What it does is to see if the id is given as part of a url, or just as an id.


I tried to delete that and then I got a connection error


_________________
One day the court system will learn that a childs mother is not the only option...... Question is will it be too late by that time...
Back to top
SteveX
Ultrabubble


Joined: 30 Aug 2005
Posts: 8792
Location: Ultrabubble

Posted: 06/26/09 05:33 
If it fails, the id check sends you to the create form immediately, so further errors are not reported as they are not reached.


_________________
Kulshi Mezian!

"Stranger from another planet, welcome to our hole. Just strap on your guitar and we'll play some rock and roll"

Ultrabubble create things.
Back to top
Display posts from previous:   
User Support Forum Archive (Read Only)
Jamroom Developers

 
Solutions
• Social Media Platform
• Social Networking Software
• Musician Website Manager
• Community Builder
Products
• Jamroom Core
• Jamroom Addons
• Jamroom Modules
• Jamroom Marketplace
Support
• Support Forum
• Documentation
• Support Center
• Contact Support
Community
• Community Forum
• Member Sites
• Developers
Company
• About Us
• Contact Us
• Privacy Policy
©2003 - 2010 Talldude Networks, LLC.