DragonPrime - LoGD Resource Community
Welcome Guest
  • Good evening, Guest.
    Please log in, or register.
  • November 16, 2018, 12:21:43 AM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1]   Go Down
  Print  
Author Topic: Chat-Emote /X: "/X The Sun is shinning" -> "The Sun is shining"  (Read 4495 times)
0 Members and 1 Guest are viewing this topic.
Eliwood
Member
Codemeister
****
Offline Offline

Posts: 275


View Profile WWW
« on: May 28, 2005, 09:31:03 AM »

With this Mod, Users can write "/X The Sun is shinning"and the commentary is going to be "The Sun is shining"

Open common.php and scroll to the addcommentary-function, search:
Code:
if (substr($commentary,0,1)!=":" &&
substr($commentary,0,2)!="::" &&
substr($commentary,0,3)!="/me" &&
$session['user']['drunkenness']>0) {
//drunk people shouldn't talk very straight.
Replace with
Code:
if (substr($commentary,0,1)!=":" &&
substr($commentary,0,2)!="::" &&
substr($commentary,0,3)!="/me" &&
substr($commentary,0,2)!="/X" &&
$session['user']['drunkenness']>0) {
//drunk people shouldn't talk very straight.

Search
Code:
if ($talkline!="sagt" // do an emote if the area has a custom talkline and the user isn't trying to emote already.
&& substr($commentary,0,1)!=":"
&& substr($commentary,0,2)!="::"
&& substr($commentary,0,3)!="/me")

Replace with:
Code:
if ($talkline!="sagt" // do an emote if the area has a custom talkline and the user isn't trying to emote already.
&& substr($commentary,0,1)!=":"
&& substr($commentary,0,2)!="::"
&& substr($commentary,0,2)!="/X"
&& substr($commentary,0,3)!="/me")

Scroll to the function viewcommentary and Search:
Code:
if (substr($ft,0,2)=="::") $ft = substr($ft,0,2);
    else

Add:
Code:
if (substr($ft,0,2)=="/X") $ft = substr($ft,0,2);
   else
Search
Code:
if ($ft=="::" || $ft=="/me" || $ft==":")
   {
      $x = strpos($row[comment],$ft);
      if ($x!==false)
         {
            if ($linkbios)
               $op[$i] = str_replace("&","&",HTMLEntities(substr($row[comment],0,$x)))
               ."`0<a href='$link' style='text-decoration: none'>\n`&$row[name]`0</a>\n`& "
               .str_replace("&amp;","&",HTMLEntities(substr($row[comment],$x+strlen($ft))))
               ."`0`n";
            else
               $op[$i] = str_replace("&amp;","&",HTMLEntities(substr($row[comment],0,$x)))
               ."`0\n`&$row[name]`0\n`& "
               .str_replace("&amp;","&",HTMLEntities(substr($row[comment],$x+strlen($ft))))
               ."`0`n";
         }
   }

Add befor:
Code:
      /*
      Landschafts-Emote by Eliwood
      */
            if ($ft=="/X")
               {
                  $x = strpos($row[comment],$ft);
                  if ($x!==false)
                     {
                        if ($linkbios)
                           $op[$i] = str_replace("&amp;","&",HTMLEntities(substr($row[comment],0,$x)))
                           ."`0\n`& "
                           .str_replace("&amp;","&",HTMLEntities(substr($row[comment],$x+strlen($ft))))
                              ."`0`n";
                        else
                           $op[$i] = str_replace("&amp;","&",HTMLEntities(substr($row[comment],0,$x)))
                           ."`0\n`& "
                           .str_replace("&amp;","&",HTMLEntities(substr($row[comment],$x+strlen($ft))))
                              ."`0`n";
                     }
               }
      /*Landschaft-Emote Ende*/

Replace
Code:
if ($ft=="::" || $ft=="/me" || $ft==":")
with
Code:
elseif ($ft=="::" || $ft=="/me" || $ft==":")

Its testet only with the Version 0.9.7+jt ext. GER (3), and maybe, yours function are a little bit other.

(Sorry for my badly Enlish Wink )
Logged

Daenerys LotGD-Remake using PHP7 and a modern, headless approach.
Sichae
iMod God
SVN Users
Mod God
*
Offline Offline

Posts: 3458


If ya didn't get it by now... you're hopeless...


View Profile WWW
« Reply #1 on: May 28, 2005, 12:34:51 PM »

Very nice. Smiley
Logged

If you didn't understand anything in the above post, don't try to attempt anything suggested.

Copyright
Guest
« Reply #2 on: August 24, 2005, 02:49:36 AM »

its really nice!
I will make a German translation of it  Grin


*checks the first post again*

Lol, i've seen, that the comments are already German  Roll Eyes
Logged
Eliwood
Member
Codemeister
****
Offline Offline

Posts: 275


View Profile WWW
« Reply #3 on: August 24, 2005, 09:00:12 AM »

its really nice!
I will make a German translation of it  Grin


*checks the first post again*

Lol, i've seen, that the comments are already German  Roll Eyes

Hehe Grin And what would you like to translate?
Its don't give an output  Smiley
Logged

Daenerys LotGD-Remake using PHP7 and a modern, headless approach.
Copyright
Guest
« Reply #4 on: August 25, 2005, 02:52:02 AM »

that's why I already translated it Grin

How to install it in German? See first post Wink

=> It was a joke  Roll Eyes
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Play LoGD on Dragonprime

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
40 Guests, 1 User
Maverick
Home Forums News Downloads Login Register Advanced Search