Customizing SMF > Modifications and Packages
Slashdot style urls
shads:
--- Quote ---// Do the code if necessary.
if (strstr($message, '[') || strstr($message, '://') || strstr($message, '@') || strstr($message, '/me'))
{
$shadow_directions = array('left' => '270', 'right' => '90', 'top' => '0', 'bottom' => '180');
$message = preg_replace($codefromcache, $codetocache, $message);
$message = preg_replace('/<a href="http\:\/\/([-a-z0-9\.]+)[^>]*>([^<]+)<\/a>/i','$0 [$1]',$message);
// Tables need to be done twice or they won't work properly.
if (strpos($message, '<table>') !== false)
{
for ($i = 0; $i < 2; $i++)
$message = preg_replace(
array(
'~((?:<table>|</tr>|\[/tr\])(?:\s|\xA0|<br />| )*(?:<tr>|\[tr\])|</td>|\[/td\])(?:\s|\xA0|<br />| )*\[td\](?:\s|\xA0|<br />| )*(.*?)(?:\s|\xA0|<br />| )*\[/td\](?:\s|\xA0|<br />| )*((?:</tr>|\[/tr\])(?:\s|\xA0|<br />| )*(?:<tr>|\[tr\]|</table>)|<td(?: valign="top")?>|\[td\])~i',
'~(<table>|</tr>|\[/tr\])(?:\s|\xA0|<br />| )*\[tr\](?:\s|\xA0|<br />| )*(.*?)(?:\s|\xA0|<br />| )*\[/tr\](?:\s|\xA0|<br />| )*(</table>|<tr>|\[tr\])~i'
),
array(
'$1<td valign="top">$2</td>$3',
'$1<tr>$2</tr>$3'
), $message
);
}
}
--- End quote ---
Thats a part my subs.php with the mod installed.
I think nothing happen when I installed it. No errors too.
Would this make urls more spiderable?
Jim Yarbro:
no idea if it makes it more spiderable. look at my example page, and look at the link for smf. it just takes the domain out of the url and puts it next to the link.
shads:
Thanks cheschire its now working 8)
Jim Yarbro:
no prob dood
Navigation
[0] Message Index
[*] Previous page
Go to full version