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,917
  • Total Topics: 21,308
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 450
  • Total: 451
  • @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.

JPDeni

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.

Kimmen

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|
Call of Duty - World at WarSpecific content to the gameSpecific extra content to the gameKimmenToday 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:


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:

Call of Duty - World at WarSpecific content to the gameSpecific extra content to the gameKimmenToday 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

JPDeni

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.

Kimmen

#13
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?


Call of Duty - World at WarSpecific content to the gameSpecific extra content to the gameKimmenToday 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.

JPDeni

When my migraine lifts, I'll get to it. It may be several days.

Kimmen


Kimmen


JPDeni

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.

Kimmen

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

JPDeni

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.

This website is proudly hosted on Crocweb Cloud Website Hosting.