Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
[SOLVED] Bbcodes into torrent descriptio
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / Torrent Trader / v3 Support

Unknown User
2019-07-14 18:00:52
The problem is badly coded reg_expression.
Unknown User
2019-07-15 17:59:00
I've just installed a fresh tt v3.0 and cannot seem to replacate your issue  I left an unclosed bold tag in torrent description and it's telling me I did not enter anything not turning anything invisible
Unknown User
2019-07-15 18:12:06
Post this as description :P

[center][b]





This is for serph
2019-07-15 18:34:22
at home it's more than 24hrs I'm trying to solve a problem of alignment, I put [align = center or left or right I lose my description of the torrent or forum or comment, you can tell me if my line is 100% good, thank you

I also test on an original comic and as soon as ja, adding my lines on function ca makes my description disappear.

It looks like your problem in bulk.


   // [align=?]Text[/align]
      $s = preg_replace("/\[align=(left|right|center)\](.*?)\[\/align\]/i", "<div align='\\1'>\\2</div>", $s);

   // [align=(center|left|right|justify)]text[/align]
      $s = preg_replace("/\[align=([a-zA-Z]+)\]((\s|.)+?)\[\/align\]/i","<div style=\"text-align:\\1\">\\2</div>", $s);
 
   // [left]Left[/left]
      $s = preg_replace("/\[left\]((\s|.)+?)\[\/left\]/", "<div align=left>\\1</div>", $s);
      $s = preg_replace("/\[LEFT\]((\s|.)+?)\[\/LEFT\]/", "<div align=left>\\1</div>", $s);
 
   // [right]Right[/right]
      $s = preg_replace("/\[right\]((\s|.)+?)\[\/right\]/", "<div align=right>\\1</div>", $s);
      $s = preg_replace("/\[RIGHT\]((\s|.)+?)\[\/RIGHT\]/", "<div align=right>\\1</div>", $s);

   //
Center

      $s = preg_replace("/\[center\]((\s|.)+?)\[\/center\]/", "<center>\\1</center>", $s);
      $s = preg_replace("/\[CENTER\]((\s|.)+?)\[\/CENTER\]/", "<center>\\1</center>", $s);


[color=rgb(184, 49, 47)]RESOLU[/color]
Unknown User
2019-07-15 18:45:12
The parser for bbcodes is coded like dogshit.
2019-07-15 18:54:51
"shadows, post: 66936, member: 20311":

The parser for bbcodes is coded like dogshit.

I am interested in a solution and not a critic (n)
Unknown User
2019-07-15 19:02:09
This is a fix. And it doesn't change the fact it's a dogshit.
+ bbcodes are not cached which means on every page refresh + X queries are loaded -.-
    // [align=?]Text[/align]
      $s = preg_replace("#\[align=(left|center|right|justify)\](.*?)\[/align\]#si ", "<div style=\"text-align: $1;\">$2</div>", $s);
2019-07-15 19:13:41
solution:

      $s=str_replace("
", "<div style=\"text-align: center\">", $s);
      $s=str_replace("
", "</div>", $s);


[USER=20311]shadows[/USER] ?
Unknown User
2019-07-15 19:18:58
regex expression is faster on load + that's a very bad practice where you will need to repeat 3 times same thing for right and left and center side which will load 3-time queries if someone uses it in post.
2019-07-15 19:38:11
"shadows, post: 66941, member: 20311":

regex expression is faster on load + that's a very bad practice where you will need to repeat 3 times same thing for right and left and center side which will load 3-time queries if someone uses it in post.


no, considering the tag is already defined i do not have to do the other two
Unknown User
2019-07-15 19:43:12
"spiritblue, post: 66942, member: 401":

no, considering the tag is already defined i do not have to do the other two

Not really. You hardcoded [align=center] so you will need to repeat it 2 more times or use regex via str_split();
Unknown User
2019-07-15 19:45:16
[USER=20311]@shadows[/USER] i put that in the description and i get this (btw i like the pun lol )

[ATTACH]5111[/ATTACH]

still no error just posts it
test.png
test.png
Unknown User
2019-07-15 19:47:21
"serph, post: 66944, member: 1398":

[USER=20311]@shadows[/USER] i put that in the description and i get this (btw i like the pun lol )

[ATTACH]5111[/ATTACH]

still no error just posts it

yeah, that's because i used some mod from here for center bbcode. It was the fault of regular expression. So I rewrote them all
Unknown User
2019-07-15 20:07:27
You care to post you're findings incase it helps other people out ?
Unknown User
2019-07-15 20:08:13
They should just follow the pattern of post #7
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 1
  • Members: 0
  • Guests online: 1
  • Comments: 3
  • Messages: 1,728