Posts: 929
Threads: 57
Joined: Mar 2009
Reputation:
1
Good, Thanks
vBulletin/Wordpress/Magento/MyBB
Developer and Designer
Posts: 17,759
Threads: 589
Joined: Nov 2008
Reputation:
121
Can you post a screen shot.
I'm not here often, shoot a PM or whatever if you want my discord.
Posts: 2,226
Threads: 113
Joined: Mar 2009
(2009-07-06, 04:14 PM)T0m Wrote: Can you post a screen shot.
Screenshot ??
Its just uses this fasion to view the links.
Google: Google Earth
Posts: 17,759
Threads: 589
Joined: Nov 2008
Reputation:
121
btw that is google maps not google earth..
I'm not here often, shoot a PM or whatever if you want my discord.
Posts: 2,226
Threads: 113
Joined: Mar 2009
(2009-07-06, 07:53 PM)T0m Wrote: btw that is google maps not google earth..
FYI its an example more than the reality.
Posts: 38
Threads: 5
Joined: Jun 2009
Reputation:
0
2009-07-24, 09:26 AM
(This post was last modified: 2009-07-24, 10:33 AM by sushruth.)
Hello guys..
I finally decided to make this as code edits and NOT a plugin.. keeping in mindeverything that conflicts the plugin...
See Below :
Edits :
- Find the lines below in inc/class_parser.php
/*
options = array(
allow_html
allow_smilies
allow_mycode
nl2br
filter_badwords
me_username
shorten_urls
)
*/
Now, Add the code below after the found lines
function urltitlefind($link, $text='')
{
// Ensure $link is a valid URL
$url = $link;
$fp = @fopen($url, 'r');
if (!$fp) {
$title = (!$text ? $link : $text);
return "(Broken Link)";
}
// Grab <title>*</title> from the first "chunk" of data
$title = url_grab_title($fp);
// No <title> tag in first chunk...
if (!$title) {
$title = (!$text ? $link : $text);
return "<a href='$url'>::Link (no title found)::</a>";
}
// User gave me some text to append to the link title
if ($text) {
$title .= ': '. $text;
}
return $title;
}
function url_grab_title($fp)
{
// How many bytes to grab in one chunk.
// Most sites seem to have <title> within 512
$chunk_size = 512;
$chunk = fread($fp, $chunk_size);
$chunk = preg_replace("/(\n|\r)/", '', $chunk);
// Look for <title>(.*?)</title> in the text
if (preg_match('/<title>(.*?)<\/title>/i', $chunk, $matches)) {
return $matches[1];
}
return null;
}
- Now, Find the code below in the same file
$name = $url;
Replace this with the code below :
$name = urltitlefind($url);
- For Link Checking
Files on the following websites will be checked :
Quote:rapidshare.com
megaupload.com
megashares.com
sendspace.com
rapidshare.de
mediafire.com
- Find the code below in the Same file
$fullurl = strtr($fullurl, array('$' => '%24', '^' => '%5E', '`' => '%60', '[' => '%5B', ']' => '%5D', '{' => '%7B', '}' => '%7D', '"' => '%22', '<' => '%3C', '>' => '%3E', ' ' => '%20'));
Add the code below after the found code
if(strstr($fullurl,"rapidshare.com")){
$var = file_get_contents($fullurl);
$checked = $checked + 1;
if(strpos($var,"FILE DOWNLOAD")){
$status = " <font color=\"green\">(file found!)<br></font>";
$working = $working + 1;
}
if(strpos($var,"The file could not be found")){
$status = " <font color=\"red\">(file not found!)<br></font>";
}
if(strpos($var," deleted.")){
$status = " <font color=\"red\">(file deleted!)<br></font>";
}
} elseif (strstr($fullurl,"megaupload.com")){
$var1 = file_get_contents($fullurl);
$checked = $checked +1;
if(strpos($var1,"Please enter")){
$status = " <font color =\"green\">(file found!)<br></font>";
$working = $working + 1;
}
if(strpos($var1,"Unfortunately, the link you have clicked is not available.")){
$status = " <font color =\"red\">(file not found!)<br></font>";
}
} elseif (strstr($fullurl,"megashares.com")){
$var2 = file_get_contents($fullurl);
$checked = $checked +1;
if(strpos($var2,"Filename:")){
$status = " <font color =\"green\">(file found!)<br></font>";
$working = $working + 1;
}
if(strpos($var2,"Welcome to Megashares")){
$status = " <font color =\"red\">(file not found!)<br></font>";
}
if(strpos($var2,"have the correct URL")){
$status = " <font color =\"red\">(file not found!)<br></font>";
}
} elseif (strstr($fullurl,"sendspace.com")){
$var3 = file_get_contents($fullurl);
$checked = $checked +1;
if(strpos($var3,"404 Page Not Found")){
$status = " <font color =\"red\">(file not found!)<br></font>";
} elseif(strpos($var3,"Sorry, the file you requested is not available.")){
$status = " <font color =\"red\">(file not found!)<br></font>";
} else {
$status = " <font color =\"green\">(file found!)<br></font>";
$working = $working + 1;
}
} elseif(strstr($fullurl,"rapidshare.de")){
$var5 = file_get_contents($fullurl);
$checked = $checked + 1;
if(strpos($var,"You want to download the file ")){
$status = " <font color=\"green\">(file found!)<br></font>";
$working = $working + 1;
}
if(strpos($var,"File not found.")){
$status = " <font color=\"red\">(file not found!)<br></font>";
}
if(strpos($var," deleted.")){
$status = " <font color=\"red\">(file deleted!)<br></font>";
}
} elseif (strstr($fullurl,"mediafire.com")){
$var4 = file_get_contents($fullurl);
$checked = $checked +1;
if(strpos($var4,"Sharing")){
$status = " <font color =\"green\">(file found!)<br></font>";
$working = $working + 1;
}
if(strpos($var4,"Invalid Quickkey.")){
$status = " <font color =\"red\">(file not found!)<br></font>";
}
if(strpos($var4,"I want to upload")){
$status = " <font color =\"red\">(file not found!)<br></font>";
}
} else {
$status = "";
}
- Find this code in the Same File :
$link = "<a href=\"$fullurl\" target=\"_blank\">$name</a>";
Replace this with :
$link = "<a href=\"$fullurl\" target=\"_blank\">$name</a> -".$status;
Preview :
This will replace any links inserted without a given title, that is like http://www.google.com/ to its title as text, that is, it will be shown as Google
Posts: 871
Threads: 102
Joined: Mar 2009
Reputation:
9
2009-07-26, 05:53 PM
(This post was last modified: 2009-07-26, 05:54 PM by Solstice.)
Do not find this code
$fullurl = strtr($fullurl, array('$' => '%24', '^' => '%5E', '`' => '%60', '[' => '%5B', ']' => '%5D', '{' => '%7B', '}' => '%7D', '"' => '%22', '<' => '%3C', '>' => '%3E', ' ' => '%20'));
truth is that file, or someone will have already changed the file
Posts: 38
Threads: 5
Joined: Jun 2009
Reputation:
0
(2009-07-26, 05:53 PM)Walkman 5.0 Wrote: Do not find this code
$fullurl = strtr($fullurl, ...... (trimmed for space)
truth is that file, or someone will have already changed the file
Hey.. it could also be a partial find...
like... find it after the [$name = urltitlefind($url);] code. got it ?
Posts: 2,120
Threads: 154
Joined: Mar 2008
Reputation:
111
Thanks, I've been looking for something like this since I was one for vB. Nice job.
Posts: 38
Threads: 5
Joined: Jun 2009
Reputation:
0
No probs Ooka.. if you have any requirements or anything for mybb to be done to posts, urls, ect.. let me know.. i just need ideas.. but remember. i can do it only if i know
|