TinyPortal

Development => Block Codes => Topic started by: Kimmen on October 06, 2009, 09:57:49 PM

Title: Bloc contains downloadlinks
Post by: Kimmen on October 06, 2009, 09:57:49 PM
Hey TP, long time no see  :)

I am in a pressured situation and need a blockcode snippet for a site.
Site is hidden for public, but i use TP: V 1.0 Beta 4 and SMF 1.1.10

I want a block in the middle that contains download links. I want this to work with forums, so if i make a post in forums, it shows in the block automaticly. It should look something like this

Icon | Name | link to download | Patches | Name of the user that posted it

I want it to behave like last forumposts, that i decide how many should show and not.

Can this be done?

greets
Kimmen
Title: Re: Bloc contains downloadlinks
Post by: IchBin on October 06, 2009, 10:38:18 PM
I don't get what you mean when you say, "I want this to work with forums, so if i make a post in forums, it shows in the block automaticly."

If you post something in the forums you want something to appear in the downloads block? I don't get how that is related. Or are you saying you just want the latest download shown when a new item is added? I do believe there is already a recent downloads item built in for blocks, but I don't think it displays the way you want it to. Anway, I'm sure once we are more clear on what you want, we can get something working for you.
Title: Re: Bloc contains downloadlinks
Post by: Kimmen on October 06, 2009, 10:46:53 PM
Sorry, i will do my best to explain what i want.

I want a selected board in the forum where i can write in the following information:

Icon | Name | Download link | Link to patches | Name of user that posted this


Now, when i post this inside forum, an upperblock will automatic display this on the frontpage. I am not using Download in my own server, i get my links from other sites, such as filefront etc. Im not hosting it on my server at all. Just to make that clear.

Title: Re: Bloc contains downloadlinks
Post by: JPDeni on October 06, 2009, 11:28:33 PM
IchBin, I think this would be like that game result thing I wrote a while back where the post is formatted in a specific way in a specific forum and in either the first post of every topic in the forum or every post in a specific topic. Those who post the information would have to have it formatted, like one value on each line in a specific order. Possibly the Icon and the User Name could come from the post itself (depending on what icon is desired).

One problem, of course, is that if somebody doesn't format the post correctly, the block will be messed up.
Title: Re: Bloc contains downloadlinks
Post by: Kimmen on October 06, 2009, 11:53:10 PM
You are right Deni, thanks.

Don't worry about other people messing it up, i will give them the template so it wont get messed up.
Title: Re: Bloc contains downloadlinks
Post by: Kimmen on October 09, 2009, 11:21:41 AM
bump
Title: Re: Bloc contains downloadlinks
Post by: JPDeni on October 09, 2009, 02:04:55 PM
I don't have enough information. If you look at my previous post, you'll see

Quote
in either the first post of every topic in the forum or every post in a specific topic.

and

Quote
Possibly the Icon and the User Name could come from the post itself (depending on what icon is desired).

Both of those options are part of the code and I can't start working on it until I know what you want.

So....

Is the information going to come from the first post in each topic in a specific board? Or is it going to be every post in a specific topic?

Do you want the icon to be the one associated with the post or is there going to be a place to enter the information?

Most of all, you say you will give them a template. I have to see what that template is going to be before I can start writing code.
Title: Re: Bloc contains downloadlinks
Post by: Kimmen on October 09, 2009, 03:20:18 PM
Sorry deni, i will give more info about that.

1: I want first post of every topic in the selected forumboard to be where it gets the infos from.
2: Icon needs to be specified, so i would need a place to fill in the image


Template / layout could be something like this:





Icon|Name|LINK|LINK|Username|Time/date|
(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Ficons.iconarchive.com%2Ficons%2F3xhumed%2Fmega-games-pack-25%2FCall-of-Duty-World-at-War-2-icon.jpg&hash=da1343580ab9e266cf10984cb8f283817543c3e4)Call of Duty - World at WarSpecific content to the game (http://link%20here)Specific extra content to the game (http://link%20here)KimmenToday at 02:07:04 PM OR October 08, 2009, 03:17:58 PM


- Time / date + username could be retrieved from forum?

Icon|   Name|   LINK|   LINK|   Username|   Time/date|

I want this to be framed and the rest to be listed under. I dont want it to repeat it self.




Is this ok?

Greets
Kimmen
Title: Re: Bloc contains downloadlinks
Post by: JPDeni on October 09, 2009, 03:46:18 PM
I'm afraid not. :) It does help for down the line to know how you want it displayed. But for most of it, I need to know the way the the information is going to be added to the post. In order to write the code, I need to know where to look for the information.

Show me a sample post. Yes, time/date and username can be retrieved from the post. But I need to know the order that things are in and what sort of labels might be there.
Title: Re: Bloc contains downloadlinks
Post by: Kimmen on October 09, 2009, 05:09:13 PM
Icon, is just an image, i would need a field to post (http://picture)
For name, i would need a text field so i can write in the name.
For both Links: I just need a field to post a link in : [url=http://LINK HERE]DESCRIPTION HERE[/url]
For username and date/time, you can try retrieve from forums somewhere.
All of this should be written as a topic / first post from a special board in the forum.



And displayed in the block, like i showed in the other post  :)
Title: Re: Bloc contains downloadlinks
Post by: JPDeni on October 09, 2009, 06:31:22 PM
Oh. You're talking about them entering it on a form?

Okay. Let's take it from the top. I need a full explanation of what you want. Leave out no detail. Because this is not even a little bit what I thought you were asking for.
Title: Re: Bloc contains downloadlinks
Post by: Kimmen on October 10, 2009, 12:04:08 AM
Deni, please try to understand, ive tried so hard to make myself clear on what i need and i get abit frustrated now, because i can't explain this any better than i have. I even had other people trying to read my posts in order to understand me, and they do get it. Please understand, i am not good when it comes to coding and make solutions to what i want, and therefore, i cant give you any solution on how to code this, that i guess only you are capable of doing. I am a plummer myself, and i can't ask my customers how to do my work, i can only try understand what is problem and then work my way from there, but i will try explain again, sorry if i am a burden here, i don't wanna force anything on you, i just ask for help. anyways, lets give it a new go !



To take the easy explanation first. I want to give my community easy access to download patches, mods and guides etc from my website in a easy way. To do so, i need an upperblock on my frontpage, where my users can click and go. I want the upperblock to display it like this:





Icon|Name|LINK|LINK|Username|Time/date|
(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Ficons.iconarchive.com%2Ficons%2F3xhumed%2Fmega-games-pack-25%2FCall-of-Duty-World-at-War-2-icon.jpg&hash=da1343580ab9e266cf10984cb8f283817543c3e4)Call of Duty - World at WarSpecific content to the game (http://link%20here)Specific extra content to the game (http://link%20here)KimmenToday at 02:07:04 PM OR October 08, 2009, 03:17:58 PM



I remember what you did to display the clanwar statistics, which you will find here: http://www.tinyportal.net/index.php/topic,24676.100.html

Here is how it looked like in the block on the frontpage:
(https://www.tinyportal.net/index.php?action=dlattach;topic=24676.0;attach=19959;image)

I don't recall specific what code i used in forums, but i guess it was this one:
  echo '<tr>';
  echo '<td>' . $game_img . '</td>';
  echo '<td>' . $clan1_img . ' ' . $clan1_name . '</td>';
  echo '<td>' . $score . '</td>';
  echo '<td>' . $clan2_img . ' ' . $clan2_name . '</td>';
  echo '<td>' . $date . '</td>';
  echo '<td>' . $mapname . '</td>';
  echo '</tr>';


- When i filled in that info, and posted it in forums, i got what you can see on the image above, displayed on my frontpage.


I want to able to decide myself how many rows should be displayed in the block, i guess you can code that in the script i need to have in the upperblock, that decides my layout. And if you don't understand this, look at the example from the clanwar stats you made:

global $db_prefix;

$topic = 6; // 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 = 'flags';  //change this to the name of the directory where your clan and game images are
$query = db_query(
    "SELECT mes.body
     FROM {$db_prefix}messages as mes
     WHERE ID_TOPIC = $topic
     ORDER BY posterTime DESC
     LIMIT $number_to_display", __FILE__, __LINE__);
$color[0] = 'red';
$color[1] = 'green';
echo '<table border=1>';
while ($row = mysql_fetch_assoc($query))
{
  $lines = array();
  $lines = explode("<br />", $row['body']);
  $game_img = '<img src="' . $img_dir . '/' . $lines[0] . '">';
  $score = $lines[2];
  $score_array = array();
  $score_array = explode('-',str_replace(" ","",$score));
  if (($score_array[0] - $score_array[1]) > 0) {
    $clan1winner = 1;
    $clan2winner = 0;
  }
  else {
    $clan2winner = 1;
    $clan1winner = 0;
  }
  $clan1 = array();
  $clan1 = explode(") ",$lines[1]);
  $clan1_img = '<img src="' . $img_dir . '/' . substr($clan1[0],1) . '"> ';
  $clan1_name = '<span style="color:' . $color[$clan1winner] . '">' . $clan1[1] . '</span>';
  $clan2 = explode(") ",$lines[3]);
  $clan2_img = '<img src="' . $img_dir . '/' . substr($clan2[0],1) . '"> ';
  $clan2_name = '<span style= "color:' . $color[$clan2winner] . ';">' . $clan2[1] . '</span>';
  echo '<tr>';
  echo '<td>' . $game_img . '</td>';
  echo '<td>' . $clan1_img . ' ' . $clan1_name . '</td>';
  echo '<td>' . $score . '</td>';
  echo '<td>' . $clan2_img . ' ' . $clan2_name . '</td>';
  echo '</tr>';
}
echo '</table>';


In specific i mean this line:
$number_to_display = 5; // change this to how many you want to display

I also want to frame this info at the top:


Icon|Name|LINK|LINK|Username|Time/date|

And display this under it:

(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Ficons.iconarchive.com%2Ficons%2F3xhumed%2Fmega-games-pack-25%2FCall-of-Duty-World-at-War-2-icon.jpg&hash=da1343580ab9e266cf10984cb8f283817543c3e4)Call of Duty - World at WarSpecific content to the game (http://link%20here)Specific extra content to the game (http://link%20here)KimmenToday at 02:07:04 PM OR October 08, 2009, 03:17:58 PM



All i ask, can you make a script that display the infos like i describe to you in an upperblock, and use the table codings in a specific forumboard to get the information to the upperblock, like we did on the clanwar stats? If there are anything else you need to know, please be more specific on what you are having problems to understand, and try to explain me, so i can give you an valid answer  :)

Many thanks for trying to help me, that is very kind of you  :)

Greets
Kimmen
Title: Re: Bloc contains downloadlinks
Post by: JPDeni on October 10, 2009, 01:12:07 AM
Okay. Let me explain what you have said to me and why I'm confused. What I'm asking you to clarify is not how it's to be displayed. That I pretty much understand. What I don't understand is how you want the information to be collected.

With the clanwar code there was one topic that I took the data from. The posts in the topic were formatted like this:

Quote
game image
(clan 1 image) Clan 1 name
Score
(clan 2 image) Clan 2 name

with the following being an example:

Quote
warcraft3.jpg
(clanx2o.jpg) Clan x2o
4-1
(clanx2o2.jpg) Clan Test

This is just text typed into a forum message just like I'm typing now.

In a previous post, you said (I've added bolding)

Quote
i would need a field to post
For name, i would need a text field so i can write in the name.
For both Links: I just need a field to post a link in :

There are no fields in the posts that hold the information for the clanwar code. It's just a message. To me, the use of the term field means that you want a form for the user to enter their data, rather than a message.

I'm just trying to get things clear, because I don't get paid for my time here (unlike your job as a plumber) and I don't want to rewrite the code from the start if it's not what you want. I'm not asking you to code anything. I'm just trying to find out what you want.

If you'd rather have someone else do the coding, that's fine.
Title: Re: Bloc contains downloadlinks
Post by: Kimmen on October 10, 2009, 11:37:46 AM
so all you say you need, is to know if i want a form or  not?

Ok, after reading your post, i find out that the easy way must be to do the same thing as we did with the clanwar thingy. We can just take information from a specific topic.

The information i want to enter in this post, would be this:
game image
Name of the game
(Link 1) Name of the link
(Link 2) Name of the link

As for Username time & date, this info could be retrieved from the actual post?


(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Ficons.iconarchive.com%2Ficons%2F3xhumed%2Fmega-games-pack-25%2FCall-of-Duty-World-at-War-2-icon.jpg&hash=da1343580ab9e266cf10984cb8f283817543c3e4)Call of Duty - World at WarSpecific content to the game (http://link%20here)Specific extra content to the game (http://link%20here)KimmenToday at 02:07:04 PM OR October 08, 2009, 03:17:58 PM





Icon|Name|LINK|LINK|Username|Time/date|
This should be displayed on top.
Title: Re: Bloc contains downloadlinks
Post by: JPDeni on October 11, 2009, 07:14:11 PM
When my migraine lifts, I'll get to it. It may be several days.
Title: Re: Bloc contains downloadlinks
Post by: Kimmen on October 12, 2009, 08:10:30 AM
Many thanks Deni  :)
Title: Re: Bloc contains downloadlinks
Post by: Kimmen on October 28, 2009, 11:47:41 AM
Bump, in case she forgot me  :)
Title: Re: Bloc contains downloadlinks
Post by: JPDeni on October 28, 2009, 09:44:48 PM
I used what I had to test the code and came up with this:


global $db_prefix;

$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

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

echo '<table border=1>';
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];
  $link1 = str_replace('(','<a href="',$link1);
  $link1 = str_replace(') ','">',$link1);
  $link1 = $link1 . '</a>';
  echo '<td>' . $link1 . '</td>';
  $link2 = $lines[3];
  $link2 = str_replace('(','<a href="',$link2);
  $link2 = str_replace(') ','">',$link2);
  $link2 = $link2 . '</a>';
  echo '<td>' . $link2 . '</td>';
  echo '<td>' . $row['posterName'] . '</td>';
  echo '<td>' . timeformat($row['posterTime']) . '</td></tr>';
}
echo '</table>';


You'll have to fill in the number of the board where your topics are, and the directory where your images are, as well as the number you want to display.

I'll do editing on the code once, so if there's a problem with it, tell me now. After that, I'm going to be away from this site at least through the end of the year, so I won't be able to make any more adjustments or answer any questions you might have.
Title: Re: Bloc contains downloadlinks
Post by: Kimmen on October 28, 2009, 09:58:05 PM
hmm, where is the template i must use when i post the topic inside the board?

Ive put this code in a php block, put in my board number and images directory. What do i do next?


Greets
Kim
Title: Re: Bloc contains downloadlinks
Post by: JPDeni on October 28, 2009, 10:08:48 PM
You made the template.

Quote
game image
Name of the game
(Link 1) Name of the link
(Link 2) Name of the link

You need to create a board for the topics (which you've probably already done, if you have a board number) and create topics that have the information you want to display.
Title: Re: Bloc contains downloadlinks
Post by: Kimmen on October 28, 2009, 10:18:24 PM
I am missing this overview:



Icon|Name|LINK|LINK|Username|Time/date|

I also notice that when it gets my username, it gets my origin username and not nickname. I would also like the nickname to be clickable if possible.

Since all this is in an upperblock, could we center it? And maby add a color to the name?

Yeah, now you probably get abit mad at me, since i did not post anything about this in the start, sorry !  :'(


EDIT: This is how it looks like, could the tables look like the last forumposts?

(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fbildr.no%2Fthumb%2F515466.jpeg&hash=02ae82eb0cb6f1a952083068525ebcabb7a9c39a) (http://bildr.no/view/515466)

Title: Re: Bloc contains downloadlinks
Post by: JPDeni on October 28, 2009, 10:34:20 PM
I didn't know if you wanted the labels or not. I can put it in.

QuoteI also notice that when it gets my username, it gets my origin username and not nickname.

It takes it from the post. Whatever shows on the post shows on the table. At least, that's what it should be. I never know which name is going where because on my site, the two names are always the same.

Quoteclickable if possible.

To the profile? Yes, that's possible. Your example didn't show a clickable username, so I had no way of knowing that you wanted it.

Certainly it can be centered.

QuoteAnd maby add a color to the name?
What color do you want?

QuoteYeah, now you probably get abit mad at me, since i did not post anything about this in the start, sorry ! 

I'll admit that I get frustrated when I have to pry out what people want from them and they still don't tell me until I've already written the code. That's why I give people one more chance to tell me what they want after I've written the first code. But after I write the code twice, I'm done.
Title: Re: Bloc contains downloadlinks
Post by: Kimmen on October 28, 2009, 10:43:10 PM
QuoteWhatever shows on the post shows on the table

In my post it shows my nickname: -=[TLID]=-Kimmen
In table it shows my origin: Kimmen.nor

I want the nickname to be displayed if you can.

QuoteYour example didn't show a clickable username, so I had no way of knowing that you wanted it.

Very sorry for that, but i do want it if its ok.

QuoteCertainly it can be centered.
Awesome

QuoteWhat color do you want?
Can you make it so i can choose myself? That i just put in an html color code?

Again, sorry for not making my request perfect, thanks for helping me out Deni, if i could, i would kiss you    :-*
Title: Re: Bloc contains downloadlinks
Post by: JPDeni on October 28, 2009, 11:00:40 PM
Okay. This is all the things you asked for. You can change the color of the members' names in the $member_color line.


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];
  $link1 = str_replace('(','<a href="',$link1);
  $link1 = str_replace(') ','">',$link1);
  $link1 = $link1 . '</a>';
  echo '<td>' . $link1 . '</td>';
  $link2 = $lines[3];
  $link2 = str_replace('(','<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>';


Take care. :)
Title: Re: Bloc contains downloadlinks
Post by: Kimmen on October 28, 2009, 11:37:32 PM
Thanks Deni, ive got one problem, when i edit my topic, the link repeats itself, so when i click on in the upperblock, i get in my web browser, the link twice. Can this be fixed please?


Many thanks so far..
Title: Re: Bloc contains downloadlinks
Post by: JPDeni on October 29, 2009, 02:19:33 PM
Quotewhen i edit my topic, the link repeats itself

I am unable to repeat your problem on my test site, so the problem must be something on your site and not in my code. I'm not even sure if I understand what you mean. Maybe if you gave an example of what happened, it would be clearer.
Title: Re: Bloc contains downloadlinks
Post by: Kimmen on October 29, 2009, 03:43:07 PM
What happen is this:

1. I post this as a new topic in my forum:

cod5.jpg
Call of Duty 5 - World at War
(http://www.theoaps.com/index.php?topic=212.0) Forumlink
(http://www.gamershell.com/pc/call_of_duty_world_at_war/) Latest Patches

2. When i post, links look like this:

cod5.jpg
Call of Duty 5 - World at War
(http://www.theoaps.com/index.php?topic=212.0) Forumlink
(http://www.gamershell.com/pc/call_of_duty_world_at_war/) Latest Patches

3. When i click the link in my upperpanel, i get this url:
http://www.theoaps.com/%5Burl=http://www.theoaps.com/index.php?topic=212.0]http://www.theoaps.com/index.php?topic=212.0[/url]

And this is also how it looks like in my post when i press the edit button to modify my post  :-\

I dunno what happen !?
Title: Re: Bloc contains downloadlinks
Post by: JPDeni on October 29, 2009, 03:53:31 PM
Are you using the url tags in your post? If so, don't.

I used your example in my test post and there was no problem at all.

Check it out here (http://tester.jpdeni.com/index.php?topic=5.msg23#msg23). You can see both the post and the block.
Title: Re: Bloc contains downloadlinks
Post by: Kimmen on October 29, 2009, 03:59:33 PM
No i am not, but i am however using    Aeva ~ Auto-Embed Video & Audio      6.2.75

Could this maby be the reason?

I am not adding the url tags myself.
Title: Re: Bloc contains downloadlinks
Post by: JPDeni on October 29, 2009, 04:04:46 PM
I don't know. Maybe. It could be that the mod alters the post. Are the url tags in the post when you modify it?
Title: Re: Bloc contains downloadlinks
Post by: IchBin on October 29, 2009, 04:08:07 PM
Aeva definitely parses the post for URL and stuff for video's. It could very well be causing an issue.
Title: Re: Bloc contains downloadlinks
Post by: Kimmen on October 29, 2009, 04:11:51 PM
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.
Title: Re: Bloc contains downloadlinks
Post by: 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.
Title: Re: Bloc contains downloadlinks
Post by: Kimmen on October 29, 2009, 04:31:24 PM
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:
Title: Re: Bloc contains downloadlinks
Post by: JPDeni on October 29, 2009, 04:35:39 PM
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>';
Title: Re: Bloc contains downloadlinks
Post by: Kimmen on October 29, 2009, 04:40:38 PM
JPDeni, what can i say?

THANKS !  :-* :-*

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


Greets
Kimmen
Title: Re: Bloc contains downloadlinks
Post by: JPDeni on October 29, 2009, 04:46:53 PM
I'm glad it worked for you. :)
Title: Re: Bloc contains downloadlinks
Post by: IchBin on October 29, 2009, 06:50:55 PM
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:
Title: Re: Bloc contains downloadlinks
Post by: JPDeni on October 29, 2009, 09:13:46 PM
:) 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.