Change url protect links

All support enquiries for other DaddyScripts' scripts go in here...

Change url protect links

Postby thi » Sun Mar 08, 2015 3:52 pm

Please help me change new url protect hide link
ex http://daddyscripts.com/index.php?ID=60namehidelinks
change new to http://daddyscripts.com/namehidelinks
thanks support!
thi
Newbie Member
 
Posts: 4
Joined: Tue Mar 03, 2015 6:51 pm

Re: Change url protect links

Postby SamEA » Fri Mar 13, 2015 2:47 pm

Hi,

Short url configuration should be in. /config.php
SamEA,
DaddyScripts' Admin & Developer.

Require a PHP or general IT freelancer? Don't hesitate to PM me.
User avatar
SamEA
Site Admin
 
Posts: 1165
Joined: Sat Feb 19, 2011 7:51 pm

Re: Change url protect links

Postby thi » Sat Mar 21, 2015 4:03 am

Can you help me edit short url
ex
http://daddyscripts.com/protect/index.p ... hide-links (default url config)
change new url
http://daddyscripts.com/protect/name-hide-links (remove number radom and remove "index.php?ID="
thanks so much!
thi
Newbie Member
 
Posts: 4
Joined: Tue Mar 03, 2015 6:51 pm

Re: Change url protect links

Postby SamEA » Sat Mar 21, 2015 8:20 am

Apologies for the delay in getting back to you.

Open ./config.php and change the following code from:

Code: Select all
$shorturl = false;


to

Code: Select all
$shorturl = true;


However, this will form a link similar to the one you requested, but with the random number. The random number is implemented to allow more than one user to have the same title. DLP is not designed to be used without the random number. Nevertheless, you can remove the random number by the following steps:

1) In ./index.php remove:

Code: Select all
$fancyurl = rand(0, 999) . $title;


2) Replace
Code: Select all
$rand2    = ("$fancyurl");


with

Code: Select all
$rand2    = $title;


3) Now, move the following the code:

Code: Select all
$rand2    = $title;
$filename = "./files/" . $rand2 . ".dlp";


under

Code: Select all
$todaydate   = getdate();


4) Replace
Code: Select all
echo "<div class=\"error\"><img src=\"./img/error.png\">Please fill in all the fields below:</div>";
    } else {


with
Code: Select all
 echo "<div class=\"error\"><img src=\"./img/error.png\">Please fill in all the fields below:</div>";
    } else if (file_exists($filename)) {
   echo "<div class=\"error\"><img src=\"./img/error.png\">Sorry, but the short url with that title has already been taken. Please choose another title and try again.</div>";
   }else{


5) Remove
Code: Select all
if (file_exists($filename)) {
            die("An unusual error occured. Please navigate BACK using your browser and re-submit your links again.");
        } else {


6) Replace
Code: Select all
<div class="success"><img src="./img/success.png">Your new URL is <?
            echo $scripturl . $short . $rand2;
?></div>
<?
        }
    }
}


with

Code: Select all
<div class="success"><img src="./img/success.png">Your new URL is <?
            echo $scripturl . $short . $rand2;
?></div>
<?
    }
}
SamEA,
DaddyScripts' Admin & Developer.

Require a PHP or general IT freelancer? Don't hesitate to PM me.
User avatar
SamEA
Site Admin
 
Posts: 1165
Joined: Sat Feb 19, 2011 7:51 pm


Return to Other DS Scripts!

Who is online

Users browsing this forum: No registered users and 2 guests

cron