Disable URL checking for 1.6 - eSyndiCat User Forums
eSyndiCat User Forums esyndicat directory software esyndicat support

Go Back   eSyndiCat User Forums > eSyndiCat Directory Software [FREE] > Modifications

Modifications Simple to complex modifications, made by users or by our team, applied to logic or presentation, all kinds of modifications are discussed and requested here.

Reply
 
Thread Tools Display Modes
Old 07-29-2010   #1
Alex B.
Tech Support
 
Alex B.'s Avatar
 
Join Date: Oct 2008
Posts: 1,069
Alex B. is on a distinguished road
Default Disable URL checking for 1.6

Instructions on how to avoid validation of URL on submission and editing listings

Open the file ./suggest-listing.php
Find the code:
PHP Code:
        /** reciprocal listing checking **/

        
if ($config->get('reciprocal_check') && valid_url($_POST['reciprocal']))

        {

            
$listing['recip_valid'] = check_reciprocal($_POST['reciprocal']);

        }



        
/** checking for correct url **/

        
$listing['header'] = 200;

        if (
$config->get('listing_check') && $valid_url)

        {

            
$listing['header'] = get_listing_header($_POST['url']);

        }



        if (
$config->get('listing_check') && ($listing['header'] != 200) && ($listing['header'] != 301) && ($listing['header'] != 302))

        {

            
$error true;

            
$msg "<li>".$gDirLang['error_broken_listing']."</li>";

        }

        

        if ((
$config->get('reciprocal_check')) && ($listing['recip_valid'] != 1))

        {

            
$error true;

            
$msg "<li>".$gDirLang['error_no_backlink']."</li>";

        } 
Replace it with:

PHP Code:
        $listing['recip_valid'] = check_reciprocal($_POST['reciprocal']);
        
$listing['header'] = get_listing_header($_POST['url']); 
Find this code:

PHP Code:
        $valid_url false;

    

        
/** check URL **/

        
if (!$_POST['url'] || !valid_url($_POST['url']))

        {

            
$error true;

            
$msg "<li>".$gDirLang['error_url']."</li>";

            

            
$valid_url true;

        }

        else

        {

            
$listing['domain'] = get_domain($_POST['url']);

        } 
and replace it with:
PHP Code:
$listing['domain'] = get_domain($_POST['url']); 
also remove this code:
PHP Code:
            /**    gets pagerank **/

            
if ($config->get('pagerank') && $valid_url)

            {

                
$listing['pagerank'] = getPageRank($_POST['url']);

            } 
Open ./edit-listing.php
PHP Code:
/** check URL **/

    
if (!$listing['url'])

    {

        
$error true;

        
$msg .= $gDirLang['error_url'];

    }

    else

    {

        
$domainIsChanged    false;

        
$listing['domain']        = get_domain($listing['url']);



        
// account has changed the domain (changing domain means also change of the url itself)

        
if($original_listing['domain'] != $listing['domain'])

        {

            
$domainIsChanged true;

        }



        
/** check if listing  already exists (and if changed whether new value for the url or domain already exists) **/

        
if ($domainIsChanged && $config->get('duplicate_checking'))

        {

            
$check    = ($config->get('duplicate_checking_type') == 'domain') ? $listing['domain'] : $listing['url'];

            
$status    $Listing->checkDuplicate(sql($check), $config->get('duplicate_checking_type'));

            if (
'banned' == $status)

            {

                
$error true;

                
$msg .= $gDirLang['error_banned'];

            }

            elseif (
$status)

            {

                
$error true;

                
$msg    .= $gDirLang['error_listing_present'];

            }

        }

    } 
replace with:
PHP Code:
$listing['domain'] = get_domain($listing['url']); 
Open ./admin/suggest-listing.php
Find this code:
PHP Code:
$valid_url valid_url($_POST['url']);



    if(
$valid_url)

    {

        
$listing['url'] = $_POST['url'];

    }



    if (
$url_required && !$valid_url)

    {

        
$error    true;

        
$msg    $gDirLang['error_url'];

    }

    else

    {

        
$_POST['url'] = $listing['url'] = sql($listing['url']);

        
$listing['domain']        = '';

        
$listing['header']        = '200';

        
$listing['pagerank']     = -1;

        
$listing['recip_valid'] = 0;

        

        
/** get pagerank **/

        
if ($config->get('pagerank'))

        {

            
// if local install

            
if(0!==strpos($_SERVER['REMOTE_ADDR'], "192.168."))

            {

                
$listing['pagerank'] = getPageRank($_POST['url']);

            }

        }



        
/** get domain name **/

        
$listing['domain'] = get_domain($_POST['url']);



        
/** check broken url **/

        
$listing['header'] = 200;



        if (
$config->get('listing_check') && !$config->get('broken_visitors'))

        {

            
$listing['header'] = get_listing_header($_POST['url']);



            
$correct_headers explode(','$config->get('http_headers'));

            if (!
in_array($listing['header'], $correct_headers))

            {

                
$error true;

                
$msg $gDirLang['error_broken_listing'];

            }        

        }

    }

/** check reciprocal listing**/

    
if ($valid_url && valid_url($_POST['reciprocal']) && $config->get('reciprocal_check') && !$config->get('reciprocal_visitors'))

    {

        if (
$config->get('reciprocal_domain'))

        {

            if (
get_domain($_POST['reciprocal']) != get_domain($_POST['url']))

            {

                
$error true;

                
$msg 'Reciprocal listing seems to be placed on different domain.';

            }

        }



        
$listing['recip_valid'] = check_reciprocal($_POST['reciprocal']);

        if (!
$listing['recip_valid'])

        {

            
$error true;

            
$msg $gDirLang['no_backlink'];

        }

        else

        {

            
$listing['reciprocal']    = $_POST['reciprocal'];

        }

    } 
replace it with:
PHP Code:
$listing['url'] = $_POST['url'];
$_POST['url'] = $listing['url'] = sql($listing['url']);
        
$listing['domain']        = '';

        
$listing['header']        = '200';

        
$listing['pagerank']     = -1;

        
$listing['recip_valid'] = 0;
        
$listing['domain'] = get_domain($_POST['url']);
        
$listing['reciprocal']    = $_POST['reciprocal']; 
Remove this code:
PHP Code:
    if ($config->get('duplicate_checking') && !$config->get('duplicate_visitors'))

    {

        
$x $config->get('duplicate_domain');

        
$forcheck '';

        if(
$x)

        {

            
$forcheck $listing['domain'];

            
$field 'domain';

        }

        elseif(
$valid_url)

        {

            
$forcheck $_POST['url'];    

            
$field 'url';

        }



        if (!empty(
$forcheck) && $Listing->exists("`".$field."`='".$forcheck."'"))

        {

            
$error true;

            
$msg $gDirLang['error_listing_present'];

        }

    } 
Open ./admin/edit-listing.php
Find this code:
PHP Code:
    if (!$temp['url'] || ($temp['url'] == 'http://') || !valid_url($temp['url']))

    {

        
$error true;

        
$msg 'Please input correct listing URL.';

    }

    else

    {

        
$temp['domain'] = get_domain($temp['url']);

    } 
Replace with:
PHP Code:
$temp['domain'] = get_domain($temp['url']); 
Open ./admin/util.php
FInd this code:
PHP Code:
function valid_url($aUrl)
{
    return 
preg_match('/^https?:\/\/[a-z0-9-]{2,63}(?:\.[a-z0-9-]{2,})*(?::[0-9]{0,5})?(?:\/|$)\S*$/',$aUrl);

replace with:
PHP Code:
function valid_url($aUrl)
{
    return 
true;

__________________
Best Regards, Alex B.
HELPDESK
Alex B. is offline   Reply With Quote
Old 11-06-2011   #2
snowdrop
 
Join Date: Jul 2011
Posts: 4
snowdrop is on a distinguished road
Default version 2.3

how is this modified for version 2.3? thanks
snowdrop is offline   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:09 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Testimonials | Articles | Support | Documentation | Privacy Policy | License | Affiliates | Contact Us | SEO Resources