Poll

Is is possible and useful?

Yes
10 (83.3%)
No
2 (16.7%)

Total Members Voted: 12

Voting closed: March 22, 2003, 09:28:27 AM

Author Topic: .  (Read 59894 times)

0 Members and 2 Guests are viewing this topic.

Offline Apollo13

  • Addicted member
  • ******
  • Posts: 1.093
    • View Profile
.
« on: March 22, 2003, 09:28:27 AM »
.
« Last Edit: September 08, 2019, 11:15:55 AM by Apollo13 »

Offline Xwall

  • Full Member
  • ***
  • Posts: 100
    • View Profile
    • http://www.xwall.tk
The same
« Reply #1 on: March 22, 2003, 10:34:40 AM »
I think the same  :D  V@no rocks   :!:

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
a question 2 v@no
« Reply #2 on: March 22, 2003, 01:25:39 PM »
Quote from: Cr@zy Sash
well he is a gib php progger. And thats why i think a board is no problem 4 him.

o my....!
slow down, guys! I'm not a programmer at all. The only programming language I know on 99% is Basic and Assembler on already dead 8 bit computer - ZX Spectrum (used to be most popular PC in Russia).
I found out that PHP language exist just last year, and 1 month later I found 4images, but I start learning PHP only by looking at 4images code 6 month ago...
and what I do here is just copy/past already exist code ( ofcourse not only from 4images ;) ) and just adopt it to work in the place I want it to...

but about BBCode in comments that makes 4images looks like board -> u are right... see, I just experimenting on my site, adding as much as I can, see how it looks like, so, basicaly the termin for that should be "kitch" (not sure if I spell it correctly)

So, if u want, I can post compleate package of my BBCode ;)
The Editor I "borowed" from phpBB board (yes, right, from this board ;) )
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Maweryk

  • Sr. Member
  • ****
  • Posts: 253
    • View Profile
a question 2 v@no
« Reply #3 on: March 24, 2003, 09:06:04 AM »
@V@no: PLEASE can you post complete package of your BBCode??

Thanks!

Cheers,

Markus

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
a question 2 v@no
« Reply #4 on: March 24, 2003, 09:24:19 AM »
Quote from: Maweryk
@V@no: PLEASE can you post complete package of your BBCode??

in /includes/function.php find function format_text(...){...}
replace with this:
Code: [Select]
function format_text($text, $html = 0, $word_wrap = 0, $bbcode = 0, $bbcode_img = 0, $smiles = 0) {
  $text = trim($text);
  if ($word_wrap && $text != "") {
    $text = preg_replace("/([^\n\r ?&\.\/<>\"\\-]{".$word_wrap."})/i", " \\1\n", $text);
  }

  if ($html == 0) {
    $text = str_replace("&lt;", "&amp;lt;", $text);
    $text = str_replace("&gt;", "&amp;gt;", $text);
    $text = str_replace("<", "&lt;", $text);
    $text = str_replace(">", "&gt;", $text);
  }
  $text = str_replace("\n", "<br />", $text);
  $text = replace_url($text);

  if ($bbcode == 1) {
/*    $search_array = array(
      "/(\[)(list)(=)(['\"]?)([^\"']*)(\\4])(.*)(\[\/list)(((=)(\\4)([^\"']*)(\\4]))|(\]))/siU",
      "/(\[)(list)(])(.*)(\[\/list\])/siU",
      "/(\[\*\])/siU",
      "/(\[)(url)(=)(['\"]?)(www\.)([^\"']*)(\\4])(.*)(\[\/url\])/siU",
      "/(\[)(url)(=)(['\"]?)([^\"']*)(\\4])(.*)(\[\/url\])/siU",
      "/(\[)(url)(])(www\.)([^\"]*)(\[\/url\])/siU",
      "/(\[)(url)(])([^\"]*)(\[\/url\])/siU",
      "/(\[)(code)(])(\r\n)*(.*)(\[\/code\])/siU",
      "/javascript:/si",
      "/about:/si"
    );
    $replace_array = array(
      "<ol type=\"\\5\">\\7</ol>",
      "<ul>\\4</ul>",
      "<li>",
      "<a href=\"http://www.\\6\" target=\"_blank\">\\8</a>",
      "<a href=\"\\5\" target=\"_blank\">\\7</a>",
      "<a href=\"http://www.\\5\" target=\"_blank\">www.\\5</a>",
      "<a href=\"\\4\" target=\"_blank\">\\4</a>",
      "<pre>Code:<hr size=1>\\5<hr size=1></pre>",
      "java script:",
      "about :"
    );
*/
$search_array = array(
"/\[b\](.*?)\[\/b\]/si",
"/\[i\](.*?)\[\/i\]/si",
"/\[u\](.*?)\[\/u\]/si",
"/\[email\](.*?)\[\/email\]/si",
"/\[email=(.*?)\](.*?)\[\/email\]/si",
"/\[code\](.*?)\[\/code\]/si",
"/\[quote\](.*?)/si",
"/\[\/quote\]/si",
"/\[url=(.*?)\](.*?)\[\/url\]/si",
"/\[url\](.*?)\[\/url\]/si",
"/\[sub\](.*?)\[\/sub\]/si",
"/\[sup\](.*?)\[\/sup\]/si",
"/\[color=(.*?)\](.*?)\[\/color\]/si",
"/\[size=(.*?)\](.*?)\[\/size\]/si",
"/\[tt\](.*?)\[\/tt\]/si",
"/\[s\](.*?)\[\/s\]/si",
"/\[move\](.*?)\[\/move\]/si",
// "/\[align=(.*?)\](.*?)\[\/align\]/si",
"/\[align=(.*?)\](.*?)\[\/align\](.<br \/>)?/si",
"/\[font=(.*?)\](.*?)\[\/font\]/si",
"/\[shadow=(.*?)\,(.*?)\,(.*?)\](.*?)\[\/shadow\]/si",
"/\[glow=(.*?)\,(.*?)\,(.*?)\](.*?)\[\/glow\]/si",
"/\[quote=(.*?)\](.*?)/si",
"/\[\/quote\]/si"
);
$replace_array = array(
"<b>\\1</b>",
"<i>\\1</i>",
"<u>\\1</u>",
"<a href=mailto:\\1>\\1</a>",
"<a href=mailto:\\1>\\2</a>",
"<blockquote><span class=\"12px\">code:</span><hr><pre>\\1</pre><hr></blockquote>",
"<blockquote><span class=\"12px\">quote:</span><hr>\\1",
"<hr></blockquote>",
"<a href=\"\\1\" target=_blank>\\2</a>",
"<a href=\\1 target=_blank>\\1</a>",
"<sub>\\1</sub>",
"<sup>\\1</sup>",
"<font color=\"\\1\">\\2</font>",
"<font style=\"font-size: \\1px\">\\2</font>",
"<tt>\\1</tt>",
"<s>\\1</s>",
"<marquee>\\1</marquee>",
"<div align=\"\\1\">\\2</div>",
"<font face=\"\\1\">\\2</font>",
"<font style=\"Filter: Shadow(color=\\1, Direction=\\2); Width=\\3px;\">\\4</font>",
"<font style=\"Filter: Glow(color=\\1, Strength=\\2); Width=\\3px;\">\\4</font>",
"<blockquote><span class=\"12px\"><b>\\1</b> wrote:</span><hr>\\2",
"<hr></blockquote>"
);
/*   $text = preg_replace("/\[img\](.*?)\[\/img\]/si", "<img src=\"\\1\" border=\"0\">", $text);
$text = preg_replace("/\[img=(.*?)\,(.*?)\](.*?)\[\/img\]/si","<img src=\"\\3\" height=\"\\2\" width=\"\\1\">",$text);
$text = preg_replace("/\[img height=(.*?)\ width=(.*?)\](.*?)\[\/img\]/si","<img src=\"\\3\" height=\"\\1\" width=\"\\2\">",$text);
$text = preg_replace("/\[img width=(.*?)\ height=(.*?)\](.*?)\[\/img\]/si","<img src=\"\\3\" width=\"\\1\" height=\"\\2\">",$text);
$text = preg_replace("/\[flash=(.*?)\,(.*?)\](.*?)\[\/flash\]/si","<object classid=\"clsid: D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\\1 height=\\2><param name=movie value=\\3><param name=play value=true><param name=loop value=true><param name=quality value=high><embed src=\\3 width=\\1 height=\\2 play=true loop=true quality=high></embed></object>",$text);
*/
    $text = preg_replace($search_array, $replace_array, $text);
    if (!$bbcode_img)  {
//    $text = preg_replace("/(\[)(img)(])(\r\n)*([^\"]*)(\[\/img\])/siU", "<a href=\"\\5\" target=\"_blank\">\\5</a>", $text);
  $text = preg_replace("/\[img\](.*?)\[\/img\]/si", "<a href=\"\\1\" target=\"_blank\">\\1</a>", $text);
$text = preg_replace("/\[img=(.*?)\,(.*?)\](.*?)\[\/img\]/si","<a href=\"\\3\" target=\"_blank\">\\3</a>",$text);
$text = preg_replace("/\[img height=(.*?)\ width=(.*?)\](.*?)\[\/img\]/si","<a href=\"\\3\" target=\"_blank\">\\3</a>",$text);
$text = preg_replace("/\[img width=(.*?)\ height=(.*?)\](.*?)\[\/img\]/si","<a href=\"\\3\" target=\"_blank\">\\3</a>",$text);
$text = preg_replace("/\[flash=(.*?)\,(.*?)\](.*?)\[\/flash\]/si","<a href=\"\\3\" target=\"_blank\">\\3</a>",$text);
    }else{
//      $text = preg_replace("/(\[)(img)(])(\r\n)*([^\"]*)(\[\/img\])/siU", "<img src=\"\\5\">", $text);
  $text = preg_replace("/\[img\](.*?)\[\/img\]/si", "<img src=\"\\1\" border=\"0\">", $text);
$text = preg_replace("/\[img=(.*?)\,(.*?)\](.*?)\[\/img\]/si","<img src=\"\\3\" height=\"\\2\" width=\"\\1\">",$text);
$text = preg_replace("/\[img height=(.*?)\ width=(.*?)\](.*?)\[\/img\]/si","<img src=\"\\3\" height=\"\\1\" width=\"\\2\">",$text);
$text = preg_replace("/\[img width=(.*?)\ height=(.*?)\](.*?)\[\/img\]/si","<img src=\"\\3\" width=\"\\1\" height=\"\\2\">",$text);
$text = preg_replace("/\[flash=(.*?)\,(.*?)\](.*?)\[\/flash\]/si","<object classid=\"clsid: D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\\1 height=\\2><param name=movie value=\\3><param name=play value=true><param name=loop value=true><param name=quality value=high><embed src=\\3 width=\\1 height=\\2 play=true loop=true quality=high></embed></object>",$text);
    }
  }
$text = str_replace("[hr]", "<hr>", $text);
  $text = smilies($text);
  $text = str_replace("\\'", "'", $text);

  return replace_badwords($text);
}


if u want also the editor, download this package, put .js file in 4images root folder, and .html into themplates folder (backup the old template first).
(I hope I didnt change anything else in .php files....dont remmember :? )

P.S. since the editor is actualy phpBB editor, it has same bug as on this forum:
1. type some text
2. select part of it
3. delete that selected text
4. press any BBCode button
5. press any smile
after that it will erase entire text u typed...  8O
I have reported this but to phpBB bugs, they fixed it...but where and how to get the fix????  :?
http://www.phpbb.com/bugs/bug.php?op=show&bugid=1550
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline PuCK

  • Newbie
  • *
  • Posts: 25
    • View Profile
    • http://www.acidarts.net
a question 2 v@no
« Reply #5 on: March 24, 2003, 10:19:19 AM »
I get a blank page. replacing the above :?

Offline Maweryk

  • Sr. Member
  • ****
  • Posts: 253
    • View Profile
a question 2 v@no
« Reply #6 on: March 24, 2003, 10:55:12 AM »
Thanks v@no. Everything works fine, but I cannot see any smiles, so that I cannot say anything about the bug.
How can I add the smiles like on your website?

Thanks again.

Markus

Offline Xwall

  • Full Member
  • ***
  • Posts: 100
    • View Profile
    • http://www.xwall.tk
Smiles
« Reply #7 on: March 24, 2003, 11:55:26 AM »
I have the same problem, I canīt see any smiles.  :oops:

http://www.4homepages.de/forum/viewtopic.php?t=4133
I use your emoticons Mod and works well but i canīt see smiles in bbcode.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Smiles
« Reply #8 on: March 24, 2003, 12:35:33 PM »
Quote from: Xwall
I have the same problem, I canīt see any smiles.  :oops:

http://www.4homepages.de/forum/viewtopic.php?t=4133
I use your emoticons Mod and works well but i canīt see smiles in bbcode.

ah, I guess I edded another function ;)
ok, right after the smiles code from the link above, add this function:
Code: [Select]
function get_smiles_text() {
  $smilesfrom = get_smiles();
  $val_old = "";
  $i = 0;
  foreach ($smilesfrom as $key => $val) {
  if ($val_old != $val) {
  $smiles_text .= "<a href=\"javascript:emoticon('$key')\"><img src=\"".TEMPLATE_PATH."/smiles/$val.gif\" alt=\"$key\" border=\"0\"></a> ";
}
$val_old = $val;
$i++;
if ($i > 18) {
$smiles_text .= "<a href=\"smiles.php\" onclick=\"window.open('smiles.php', '_4imagessmilies', 'HEIGHT=110,resizable=yes,scrollbars=yes,WIDTH=180');return false;\" target=\"_4imagessmilies\">&nbsp;&nbsp;&nbsp;All Emoticons</a>";
return $smiles_text;
}
}
return $smiles_text;
}


also, redownload the package, I included smiles.php that needed for popup when u click on "all smiles", just put along with .js file in 4images root folder.

P.S.
Quote from: Maweryk
but I cannot see any smiles, so that I cannot say anything about the bug.

u dont have to install anything, to feel the bug, just do those steps right here, on this forum, Unless its specific for system configuration I have (WindowsXp + IE6)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Xwall

  • Full Member
  • ***
  • Posts: 100
    • View Profile
    • http://www.xwall.tk
a question 2 v@no
« Reply #9 on: March 24, 2003, 01:09:01 PM »
I have a problem i canīt show the emoticons.  :(

My functions.php
http://xwall.metropoliglobal.com/xxx/xxx/functions.phps

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
a question 2 v@no
« Reply #10 on: March 24, 2003, 01:12:29 PM »
Quote from: Xwall
I have a problem i canīt show the emoticons.  :(

My functions.php

wait i put the adress[/code]

ah, ok...I think I edited more files then I though... 8O
find in detail.php
Code: [Select]
     "lang_bbcode" => $lang['bbcode'],
add after:
Code: [Select]
     "smiles_text" => get_smiles_text(),
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Xwall

  • Full Member
  • ***
  • Posts: 100
    • View Profile
    • http://www.xwall.tk
a question 2 v@no
« Reply #11 on: March 24, 2003, 01:21:51 PM »
upps
Fatal error: Call to undefined function: get_smiles() in /home/xxx/htdocs/xxx/xxx/functions.php on line 1340

Offline Maweryk

  • Sr. Member
  • ****
  • Posts: 253
    • View Profile
a question 2 v@no
« Reply #12 on: March 24, 2003, 01:22:15 PM »
Now I get following error:  8O

Fatal error: Call to undefined function: get_smiles() in /raid/domains/de/r/XXXXX/htdocs/XXXX/includes/functions.php on line 1270

Can anybody help??

Thanks!

Markus

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
a question 2 v@no
« Reply #13 on: March 24, 2003, 01:23:05 PM »
gee.....I'm the trouble maker...am I?.. (I see u still having problem)
ok, here is compleate smiles code I have:
Code: [Select]
//--------------------------
//--------Smiles------------
//--------------------------
function smilies($text,$enablesmilies = 1) {
  global $smileyfromcache, $smileytocache;
  $imagesdir = TEMPLATE_PATH."/smiles";
  if(gettype($smileyfromcache) != "array") {
$smilesfrom = get_smiles();
foreach ($smilesfrom as $key => $val) {
 $smileyfromcache[] ='/(((>[^<]*)|(^[^<]*))([\s\n\r]|^|<br( \/)?[>]))('.str_replace('|','\|', quotemeta(str_replace("<", "&lt;", str_replace(">", "&gt;", str_replace("\/", "\\\/", $key))))).')/s';
 $smileytocache[] = "\\1<img src=\"$imagesdir/$val.gif\" alt=\"\" border=\"0\">";
}
  }
  if ($enablesmilies) {
$text = parsesmilies($text);
  }
  return $text;
}
function parsesmilies($text) {
  global $smileyfromcache, $smileytocache;
  $oldtext = "";
  while($oldtext != $text) {
$oldtext = $text;
$text = preg_replace($smileyfromcache, $smileytocache, $text);
  }
  return $text;
}
function get_smiles(){
/* $smilesfrom = array(
":)" => "smiley",
":angry:" => "angry",
";)" => "wink",
":D" => "cheesy",
";D" => "grin",
":(" => "sad",
":o" => "shocked",
":O" => "shocked",
"8)" => "cool",
":P" => "tongue",
":p" => "tongue",
"???" => "huh",
":-[" => "embarassed",
":-X" => "lipsrsealed",
":-x" => "lipsrsealed",
":-'(" => "cry",
":-\\" => "undecided",
"::)" => "rolleyes",
":kiss:" => "kiss",
":laugh:" => "laugh"
  );*/
$smilesfrom = array(
":D" => "icon_biggrin",
":)" => "icon_smile",
":(" => "icon_sad",
":oops:" => "icon_redface",
":o" => "icon_surprised",
"8O" => "icon_eek",
":?" => "icon_confused",
"8)" => "icon_cool",
":lol:" => "icon_lol",
":x" => "icon_mad",
":P" => "icon_razz",
":p" => "icon_razz",
":cry:" => "icon_cry",
":evil:" => "icon_evil",
":twisted:" => "icon_twisted",
":roll:" => "icon_rolleyes",
":wink:" => "icon_wink",
"(?)" => "icon_question",
":idea:" => "icon_idea",
":arrow:" => "icon_arrow",
":neutral:" => "icon_neutral",
":mrgreen:" => "icon_mrgreen"
  );

return $smilesfrom;
}
function get_smiles_text() {
  $smilesfrom = get_smiles();
  $val_old = "";
  $i = 0;
  foreach ($smilesfrom as $key => $val) {
  if ($val_old != $val) {
  $smiles_text .= "<a href=\"javascript:emoticon('$key')\"><img src=\"".TEMPLATE_PATH."/smiles/$val.gif\" alt=\"$key\" border=\"0\"></a> ";
}
$val_old = $val;
$i++;
if ($i > 18) {
$smiles_text .= "<a href=\"smiles.php\" onclick=\"window.open('smiles.php', '_4imagessmilies', 'HEIGHT=110,resizable=yes,scrollbars=yes,WIDTH=180');return false;\" target=\"_4imagessmilies\">&nbsp;&nbsp;&nbsp;All Emoticons</a>";
return $smiles_text;
}
}
return $smiles_text;
}
//------End Smiles-------
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline PuCK

  • Newbie
  • *
  • Posts: 25
    • View Profile
    • http://www.acidarts.net
a question 2 v@no
« Reply #14 on: March 24, 2003, 01:24:40 PM »
Quote from: V@no
Quote from: Maweryk
@V@no: PLEASE can you post complete package of your BBCode??


in /includes/function.php find function format_text(...){...}

..

if u want also the editor, download this package, put .js file in 4images root folder, and .html into themplates folder (backup the old template first).
(I hope I didnt change anything else in .php files....dont remmember :? )

P.S. since the editor is actualy phpBB editor, it has same bug as on this forum:
1. type some text
2. select part of it
3. delete that selected text
4. press any BBCode button
5. press any smile
after that it will erase entire text u typed...  8O
I have reported this but to phpBB bugs, they fixed it...but where and how to get the fix????  :?
http://www.phpbb.com/bugs/bug.php?op=show&bugid=1550


My pages go blank when I do this. Really strange...