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: 0
  • Guests: 364
  • Total: 364

[Block] Clan war points block : need idea's/help

Started by Heero, June 24, 2008, 05:01:39 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Heero

JPDeni is still taking care of it.

And indeed barpoet, I have a clan forum and that's why I've requested it :).

barpoet

Can you guy's post it when it's finished... It'd be great to be able to utilize it for tourneys

JPDeni

QuoteIt might be that both clans are using the same flags.

Okay. Then you need to decide what you want to do. You can save the same graphic multiple times with different names, so that you have a different graphic file for each clan -- clanx2o.jpg for example -- or you can have each flag just once and require the user to enter the name of the file in addition to the name of the clan. The problem with the second option is that there is more chance of making an error when entering the data.

Maybe I'm making this too complicated, in an attempt to make it simple. :)

QuoteWhere is this code?

It hasn't been written yet. I'm still trying to narrow down what is needed. It will be posted here once I get it written.

barpoet

Quote
It hasn't been written yet. I'm still trying to narrow down what is needed. It will be posted here once I get it written.

Awesome... thank you....

Heero

Hmm the first option is fine for me.
Would this system work then? lets say :

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

But, in the next post you can use the same images again.

JPDeni

If that's what you want, I can figure out how to do it. Otherwise we're going to be here until next year. :) It's still more complicated than it needs to be, but I'm not sure I can explain why.

It will take a little more time. It's a Saturday. :)

Heero

Well .. I'm already happy you want to do this,
and do whatever what is easy for you.

I don't like to bother people with requests.
Sadly enough I don't have the time for learning full phping.

JPDeni

Okay. Sorry it took so long.

First, you need to put your images into a specific directory. Then create a topic in a board that only those who you want to be able to add, edit and delete information can see. The posts in that topic need to be in the form of:

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

So it's like:

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

Add one post for each result that you want to display.

Put the following into a block:



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__);
echo '<table border=1>';
while ($row = mysql_fetch_assoc($query))
{
  $array = array();
  echo '<tr>';
  $array = explode("<br />", $row['body']);
  echo '<td><img src="' . $img_dir . '/' . $array[0] . '"></td>';
  echo '<td>';
  $array2 = array();
  $array2 = explode(") ",$array[1]);
  $img = substr($array2[0],1);
  echo '<td><img src="' . $img_dir . '/' . $img . '"> '. $array2[1] .'</td>';
  echo '<td>' . $array[2] . '</td>';
  $array2 = array();
  $array2 = explode(") ",$array[3]);
  $img = substr($array2[0],1);
  echo '<td><img src="' . $img_dir . '/' . $img . '"> '. $array2[1] .'</td>';
  echo '</tr>';
}
echo '</table>';



I've tested it and it seems to work just fine.

Heero

Omg JPDeni that's just amazing!
It works perfectly!
I'm very thankful you made this script :).
I owe you one now !

JPDeni

I'm glad it works for you. :) You're very welcome.

This website is proudly hosted on Crocweb Cloud Website Hosting.