Advertisement:

Author Topic: Slashdot style urls  (Read 26906 times)

Offline Jim Yarbro

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,592
  • a.k.a. Cheschire
    • Warpstorm
Slashdot style urls
« on: March 09, 2004, 01:22:31 PM »
Link to Mod

This mod is designed to make all links that appear in the message board posts to have a slashdot style [website.com] tag after the link, allowing the reader to know where the link is going so they dont feel maliciously redirected.
Just because SMF isn't as bloated as you want it from the start doesn't mean it can't be. -[Unknown]

^ This means keep Simple Machines SIMPLE, and let people make ****** as complex as they want on their own. Stop making ****** so complex in the core!!

Offline shads

  • Semi-Newbie
  • *
  • Posts: 36
Re: Slashdot style urls
« Reply #1 on: November 26, 2004, 06:12:38 AM »
its not working on my site
are there any requirements for it to run?
i inserted it in the subs.php but nothing happen
help me pls

Offline Jim Yarbro

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,592
  • a.k.a. Cheschire
    • Warpstorm
Re: Slashdot style urls
« Reply #2 on: December 07, 2004, 09:53:11 AM »
this wasnt developed for SMF 1.0. I will work on a new version in a few days.
Just because SMF isn't as bloated as you want it from the start doesn't mean it can't be. -[Unknown]

^ This means keep Simple Machines SIMPLE, and let people make ****** as complex as they want on their own. Stop making ****** so complex in the core!!

Offline shads

  • Semi-Newbie
  • *
  • Posts: 36
Re: Slashdot style urls
« Reply #3 on: December 08, 2004, 07:13:22 PM »
cool I cant wait   8)

Offline Jim Yarbro

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,592
  • a.k.a. Cheschire
    • Warpstorm
Re: Slashdot style urls
« Reply #4 on: December 09, 2004, 08:52:17 AM »
I just installed it on my site (http://nrrds.com) and it worked just fine. copy and paste your subs.php in code tags WITH the mod installed please

example: http://nrrds.com/forum/index.php?topic=2.0
Just because SMF isn't as bloated as you want it from the start doesn't mean it can't be. -[Unknown]

^ This means keep Simple Machines SIMPLE, and let people make ****** as complex as they want on their own. Stop making ****** so complex in the core!!

Offline shads

  • Semi-Newbie
  • *
  • Posts: 36
Re: Slashdot style urls
« Reply #5 on: December 09, 2004, 09:33:02 AM »
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 />|&nbsp;)*(?:<tr>|\[tr\])|</td>|\[/td\])(?:\s|\xA0|<br />|&nbsp;)*\[td\](?:\s|\xA0|<br />|&nbsp;)*(.*?)(?:\s|\xA0|<br />|&nbsp;)*\[/td\](?:\s|\xA0|<br />|&nbsp;)*((?:</tr>|\[/tr\])(?:\s|\xA0|<br />|&nbsp;)*(?:<tr>|\[tr\]|</table>)|<td(?: valign="top")?>|\[td\])~i',
                  '~(<table>|</tr>|\[/tr\])(?:\s|\xA0|<br />|&nbsp;)*\[tr\](?:\s|\xA0|<br />|&nbsp;)*(.*?)(?:\s|\xA0|<br />|&nbsp;)*\[/tr\](?:\s|\xA0|<br />|&nbsp;)*(</table>|<tr>|\[tr\])~i'
               ),
               array(
                  '$1<td valign="top">$2</td>$3',
                  '$1<tr>$2</tr>$3'
               ), $message
            );
      }
   }

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?

Offline Jim Yarbro

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,592
  • a.k.a. Cheschire
    • Warpstorm
Re: Slashdot style urls
« Reply #6 on: December 09, 2004, 10:03:03 AM »
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.
Just because SMF isn't as bloated as you want it from the start doesn't mean it can't be. -[Unknown]

^ This means keep Simple Machines SIMPLE, and let people make ****** as complex as they want on their own. Stop making ****** so complex in the core!!

Offline shads

  • Semi-Newbie
  • *
  • Posts: 36
Re: Slashdot style urls
« Reply #7 on: December 09, 2004, 08:34:30 PM »
Thanks cheschire its now working  8)

Offline Jim Yarbro

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,592
  • a.k.a. Cheschire
    • Warpstorm
Re: Slashdot style urls
« Reply #8 on: December 10, 2004, 03:59:57 AM »
no prob dood
Just because SMF isn't as bloated as you want it from the start doesn't mean it can't be. -[Unknown]

^ This means keep Simple Machines SIMPLE, and let people make ****** as complex as they want on their own. Stop making ****** so complex in the core!!