TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,913
  • Total Topics: 21,308
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 584
  • Total: 585
  • @rjen

Bloc contains downloadlinks

Started by Kim, October 06, 2009, 09:57:49 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

IchBin

Aeva definitely parses the post for URL and stuff for video's. It could very well be causing an issue.

Kimmen

#31
Yes, the tags gets added as soon as i post the topic. When i press modify, the tags are already there.


Edit: i tried to post a link somewhere else in the forum, i get the same thing. All links in my forum has tags when i go for modify post.

JPDeni

Farkle.

Let me see what I can do. There's probably some simple way that a real programmer would be able to take it out, but I'll see if I can come up with something.

Kimmen

Ok, Aeva is the problem for sure.

I have another private forum where i have this mod installed, and it gives the same behavior. Whenever a link is posted, the mod automatic add url tags to it, so that the normal link which should look like this:

(http://www.theoaps.com/index.php?topic=212.0)

Now looks like this instead:

([url=http://www.theoaps.com/index.php?topic=212.0]http://www.theoaps.com/index.php?topic=212.0[/url])

:buck2:

JPDeni

This should fix it. You'll have to change the first few lines again.


global $db_prefix, $scripturl;

$board = 2; // change this to the number of the Drop Report board
$number_to_display = 5; // change this to how many you want to display
$img_dir = 'images';  //change this to the name of the directory where your game images are
$member_color = '000000'; //hex number for the color of members' names

$query = db_query(
    "SELECT mes.body, mes.posterTime, mes.ID_MEMBER, mem.realName
     FROM {$db_prefix}messages as mes, {$db_prefix}topics as top, {$db_prefix}members as mem
     WHERE top.ID_BOARD = $board
     AND top.ID_FIRST_MSG = mes.ID_MSG
     AND mes.ID_MEMBER = mem.ID_MEMBER
     ORDER BY mes.posterTime DESC
     LIMIT $number_to_display", __FILE__, __LINE__);

echo '<table border=1 style="margin-left:auto; margin-right:auto;">';
echo '<tr><td>Icon</td><td>Name</td><td>LINK</td><td>LINK</td><td>Username</td><td>Time/date</td></tr>';
while ($row = mysql_fetch_assoc($query))
{
  $lines = array();
  $lines = explode("<br />", $row['body']);
  echo '<tr><td><img src="' . $img_dir . '/' . $lines[0] . '"></td>';
  echo '<td>' . $lines[1] . '</td>';
  $link1 = $lines[2];
  $fix = strpos($link1,']') + 1;
  $link1 = substr($link1,$fix);
  $link1 = str_replace('[/url]','',$link1);
  $link1 = '<a href="' . $link1;
  $link1 = str_replace(') ','">',$link1);
  $link1 = $link1 . '</a>';
  echo '<td>' . $link1 . '</td>';
  $link2 = $lines[3];
  $fix = strpos($link2,']') + 1;
  $link2 = substr($link2,$fix);
  $link2 = str_replace('[/url]','',$link2);
  $link2 = '<a href="' . $link2;
  $link2 = str_replace(') ','">',$link2);
  $link2 = $link2 . '</a>';
  echo '<td>' . $link2 . '</td>';
  echo '<td><a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '" style="color:#' . $member_color . '">' . $row['realName'] . '</a></td>';
  echo '<td>' . timeformat($row['posterTime']) . '</td></tr>';
}
echo '</table>';

Kimmen

JPDeni, what can i say?

THANKS !  :-* :-*

You made it. It works like a charm now. Super  :up:


Greets
Kimmen

JPDeni


IchBin

Quote from: JPDeni on October 29, 2009, 04:14:48 PM
Farkle.

Let me see what I can do. There's probably some simple way that a real programmer would be able to take it out, but I'll see if I can come up with something.
Quote from: JPDeni on October 29, 2009, 04:46:53 PM
I'm glad it worked for you. :)

So much for the "real programmer" statement Deni! ;) Had no doubt you'd figure it out. :up:

JPDeni

:) Well, I think it's likely that there's some really spiffy way to do it, rather than the clumsy way I did it, but it works.

This website is proudly hosted on Crocweb Cloud Website Hosting.