Welcome, Guest. Please Login or Register.
May 15, 2025, 07:18:39 PM
Home Help Search Log in Register
News: SMF is the next generation in forum software, almost completely re-written from the ground up, make sure you don't fall for cheap imitations that suffer from feature bloat!

YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  new tags « previous next »
Pages: [1] Reply Ignore Print
Author Topic: new tags  (Read 2705 times)
Anguz
YaBB God
*****
Posts: 641


llama me?!

WWW
new tags
« on: December 06, 2003, 11:41:57 PM »
Reply with quote

I thought that it'd be good to have a couple more tags for the messages: [time] and [sort][/sort]

[time] would be replaced with a timestamp when saved to the database... this can be very useful when editing a message several times to make updates or things like that

[sort] would sort the enclosed lines alphanumerically... this can be useful when writting lists of things (urls, names, etc) and save yourself the trouble of putting them in order
« Last Edit: December 07, 2003, 01:30:51 AM by Anguz » Logged

My Mods: Avatar & Sig Size Control, No Show Msg Subject, Msg URL Composer, Built-in Avatar Rand, Built-in Sig Rand, Remove New-lines Excess, Show All Stars, Search Bar, Smart URLs
[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:new tags
« Reply #1 on: December 07, 2003, 06:05:53 AM »
Reply with quote

Quote from: Anguz on December 06, 2003, 11:41:57 PM
[time] would be replaced with a timestamp when saved to the database... this can be very useful when editing a message several times to make updates or things like that

I've thought about adding this to SMF more than once.

-[Unknown]
Logged
Anguz
YaBB God
*****
Posts: 641


llama me?!

WWW
Re:new tags
« Reply #2 on: December 07, 2003, 08:41:26 PM »
Reply with quote

I wrote this from what I read in Subs.php, I didn't test it at all, but maybe they'd work, what do you think?

<edit file>
Sources/Subs.php
</edit file>

<search for>

   // Check if all quotes are closed
</search for>

<add before>
   $message = str_replace('[time]',timeformat(time()),$message);
</add before>

<search for>
function doparsecodesmilies($message,$enableSmilies = 1)
</search for>

<add before>
function bbsort($match){
   $arr=explode("\n",$match);
   $arr=sort($arr);
   $match='';
   foreach($arr as $e){
      $match.=$e."\n";
   }
   return $match;
}

</add before>

<search for>
      $codefromcache = array(
</search for>

<add after>
         '/\[sort\](.+?)\[\/sort\]/ise',
</add after>

<search for>
      $codetocache = array(
</search for>

<add after>
         bbsort('\\1'),
</add after>
« Last Edit: December 07, 2003, 09:31:27 PM by Anguz » Logged

My Mods: Avatar & Sig Size Control, No Show Msg Subject, Msg URL Composer, Built-in Avatar Rand, Built-in Sig Rand, Remove New-lines Excess, Show All Stars, Search Bar, Smart URLs
Anguz
YaBB God
*****
Posts: 641


llama me?!

WWW
Re:new tags
« Reply #3 on: December 07, 2003, 08:45:26 PM »
Reply with quote

the [sort] tag could even have a modifier to make it descending, with ascending as default...

[sort] for ascending
[sort-] for descending

it could even be used to randomize the list hehe...

[sort?] to randomize

;D

it'd only take a little modification to the regex in $codefromcache array and the bbsort() function
« Last Edit: December 07, 2003, 09:29:27 PM by Anguz » Logged

My Mods: Avatar & Sig Size Control, No Show Msg Subject, Msg URL Composer, Built-in Avatar Rand, Built-in Sig Rand, Remove New-lines Excess, Show All Stars, Search Bar, Smart URLs
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  new tags « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.011 seconds with 17 queries.