TinyPortal

Development => Block Codes => Topic started by: Heero on June 24, 2008, 05:01:39 PM

Title: [Block] Clan war points block : need idea's/help
Post by: Heero on June 24, 2008, 05:01:39 PM
Greetings everyone,
here I am again.

I'm planning to add a clan war points block on my wp, but I'm not sure how I should create it, or with what system.
My current idea is this :
Adding all of the clan war results in one page (article) ( with image support ),
and showing the 5 latest results on the frontpage with a center block.

Any suggestions or links for creation?
Thanks,

-Xarwin
Title: Re: Clan war points block : need idea's/help
Post by: JPDeni on June 24, 2008, 05:22:03 PM
What are clan war points? Is this something that is assigned to individuals and would be in the database? Or something else?
Title: Re: Clan war points block : need idea's/help
Post by: Heero on June 24, 2008, 05:40:47 PM
The plan would be to display :
<img>ClanName 10-10 <img>ClanName.
So example:
(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fwww.ace-egypt.org.uk%2Fimages%2Fflag-egypt.gif&hash=1879f01ea15ad41596a11fec83fde29617f28a32) Egy 2-0 (https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fwww.ace-egypt.org.uk%2Fimages%2Fflag-uk.gif&hash=5960008c5d7faa28068543c4191d029b38e6d637) Uk
The images are flags of the country ( I was thinking of bbc support ).

An of mine was to edit the form of you, to easily submit data.
Although does it support bbc? ( http://www.tinyportal.net/index.php?topic=22934.0 ).

Thanks for the response :)
Title: Re: Clan war points block : need idea's/help
Post by: Smoky on June 24, 2008, 05:42:38 PM
are you trying to intergrate wp with smf and tinyportal? :o
Title: Re: Clan war points block : need idea's/help
Post by: Heero on June 24, 2008, 05:55:24 PM
Nono, wp = web page ;)
Title: Re: Clan war points block : need idea's/help
Post by: JPDeni on June 24, 2008, 06:41:23 PM
Xarwin, this doesn't tell me what clan war points are. Or are you just saying that you want to display images and text?

If so, and you're using TP 1.05, you can use bbc in an article, and with either .98 and 1.05 you can use bbc in a block.

Quote
An of mine was to edit the form of you,

I don't understand what that means. I think some words may be missing.

But, no, the script you referred to does not support bbc.
Title: Re: Clan war points block : need idea's/help
Post by: Heero on June 24, 2008, 07:53:10 PM
Oh I'm sorry JPDeni,
I'll give you a link with example :
http://www.sam-clan.com/web/index.php
You can see the latest wars?
It displays an image, their date, the clan they've played and the score.
I hope the example clears up your mind :)
I just want it in another form actualy.

And the words missing :
An idea of mine was to edit the form of you, to easily submit data.

Thanks!
Xarwin.
Title: Re: Clan war points block : need idea's/help
Post by: JPDeni on June 24, 2008, 09:00:18 PM
Well, I see some images and some text, but I don't know where they come from or what they mean. I guess it doesn't matter. :)

It looks to me like it would just be easier to use a bbc block and type in the data as it comes in, rather than going to all the trouble of making a form.
Title: Re: Clan war points block : need idea's/help
Post by: Heero on June 24, 2008, 09:37:18 PM
Well the problem is that,
lets say, all of the clan war 'data' is on a seperated page.
On this seperated page you may see all of the results, but at the front page you may see
the 5 latest points/results of it. ( Thinking of a seperated page with [1],[2],..)
And it would be hard updating each time two pages.
Title: Re: Clan war points block : need idea's/help
Post by: JPDeni on June 24, 2008, 09:59:17 PM
I can't write anything for you because you haven't said what it is that you want. So you're going to have to alter the form yourself to make it do whatever it is that you want it to do.
Title: Re: Clan war points block : need idea's/help
Post by: Bluto on June 24, 2008, 10:11:41 PM
There is a PHP mod called Virtual war, or Vwar that acts on it's own, collects stats and shows past and upcoming matches.You would have to figure out how to link the most recent scores to a block. They do it for Nuke, so it must be possible with SMF and TP. Actually, we had it running on an IPbb site as well. Just have to figure how to link the block.
Here a link to the vWar site:
http://www.vwar.de/download.php (http://www.vwar.de/download.php)
Title: Re: Clan war points block : need idea's/help
Post by: Heero on June 24, 2008, 10:27:59 PM
Thanks Bluto,
I'll be checking it out.
JPDeni, also thanks for your quick replies :)
Title: Re: Clan war points block : need idea's/help
Post by: Kakka on July 07, 2008, 08:55:42 PM
Did it worked for you? :)
I want to have this too! :D
Could someone please create this? :(
Title: Re: Clan war points block : need idea's/help
Post by: Heero on July 08, 2008, 11:53:39 AM
Well hmm ..
Its a stand-alone script so it needs to be integrated with smf and all the other things which will take a while (trying).
I'm still thinking for another solution...
Title: Re: Clan war points block : need idea's/help
Post by: Heero on July 17, 2008, 04:48:45 PM
Okay sorry for the double post,
but I've tried many things and I failed :( .

I hope someone else could lend me a hand with this 'script'.

I know my first explanation wasn't that good, so I'll try again.

I'd like to have a script which makes it able submitting bbc and information in a table.
I've tried to be as accurate as possible, so I created this :
(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fimg180.imageshack.us%2Fimg180%2F5968%2Fclanwarsuj3.jpg&hash=d2e93bfc523c6a933ba38701c4a1ac5d79fcc964)

The first column exists out of submittable information, just like the second and the third.
All I need is some bbc support too :/ .. For using the images and linking to a specific thread.

There should be 5 rows showing the latest submission on the front page.
I hope that this information helps,
and I hope that someone could help me with this.

Thanks in advance,
Xarwin
Title: Re: Clan war points block : need idea's/help
Post by: JPDeni on July 17, 2008, 06:17:38 PM
Displaying information is really simple. The problem is retrieving it before it can be displayed and in order to do that, we have to know where it's being stored or how it's being generated.
Title: Re: Clan war points block : need idea's/help
Post by: Heero on July 17, 2008, 07:41:52 PM
Are there somewhere tutorials or something about it?
I really can use such a script :)
Title: Re: Clan war points block : need idea's/help
Post by: JPDeni on July 17, 2008, 08:30:12 PM
If you'll answer my questions, I'll help you.

Imagine that you were asking me to make you a stew at your house. I said I'd be happy to do it, but I needed to know where you keep the vegetables. I can't make a stew without vegetables and if you won't tell me where they are, no stew will be made.

In just the same way, I can't tell you how to put your information together unless I know where the information is.
Title: Re: Clan war points block : need idea's/help
Post by: Heero on July 18, 2008, 03:06:32 PM
Oh crap :stupidme: .
I thought u ment something else!

Well..
I was thinking to keep it in the database..
Or from a page (example article), but I think that's impossible.
Since another global moderator should be able to edit it too.

Thanks already for your help!
Title: Re: Clan war points block : need idea's/help
Post by: JPDeni on July 18, 2008, 05:33:04 PM
I think we're still having trouble with communication. Let me back up a little bit more.

Where does this information originate? Do you enter it? Do other admin/moderator-types enter it? Do members enter it? Is it imported from an external file? Is it computed from something that's already in the database, like number of posts or time online?
Title: Re: Clan war points block : need idea's/help
Post by: Heero on July 18, 2008, 07:27:02 PM
Well, actualy I was thinking about a system like this (which you also created :) ) :
http://www.tinyportal.net/index.php?topic=22934.msg186613#msg186613

It stores data in database files, you enter it with fields which are later editable/deletable (if possible) and some other member groups can edit it.
And like the image, it should come out like this when posting (with some possible html or bbc support):
(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fimg180.imageshack.us%2Fimg180%2F5968%2Fclanwarsuj3.jpg&hash=d2e93bfc523c6a933ba38701c4a1ac5d79fcc964)
Is that more clear? ^.^
Title: Re: Clan war points block : need idea's/help
Post by: JPDeni on July 18, 2008, 07:36:06 PM
Unless you're going to have a reason to have a lot of different database things, it would probably be better to use something that is directly written for your application.

So... you want people to enter the data on a form. Who? Any member? Guests? Only moderators? Only admins?

What data do you want saved? Why do you need html or bbc support? Are there a limited number of "clans" that could be chosen from a drop-down list? Are clans always associated with a specific flag graphic?

You know, it's more work to get the information I need to write the code than it is to actually write it. :) I don't mean to be picky, but I'd rather write just one code, rather than to have to re-write it over and over until it fits your needs.
Title: Re: Clan war points block : need idea's/help
Post by: Heero on July 18, 2008, 08:54:12 PM
Okay, and I'm already glad you want to write this script :).
Sorry to be bad ass, but I just thought of another row  :buck2:.
I'm trying to be more accurate so I took another picture.
It should start with such a field to fill in :
(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fimg369.imageshack.us%2Fimg369%2F3907%2Fsubmissionsft4.jpg&hash=1890780961e8d1962018bb6504cac192a58bb8d8)
(note that I made it twice, the secondary field shows the input of the first submission which I also 'made')
As you can see, I'd like to have bbc or html for showing a flag or icon beneath it.
This would be the input and shown in different ways each :

(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fimg394.imageshack.us%2Fimg394%2F2958%2Fcwox5.jpg&hash=1a790eb20ca01a6b85a7efc31d26129fd83ed182)
(I didn't added 'Warcraft 3' behind the first image).

So it should be stored in the database (somehow  :o).
And I'd like to have only the admin(1) and member group 18 to have the ability editing or submission.
The submissions ( second images ) should be displayed in a front page block per 5.

I thank you in advance for your help, and your effort for looking at it!
Title: Re: Clan war points block : need idea's/help
Post by: Bluto on July 18, 2008, 09:18:55 PM
What you're looking for is a ladder script. There are a few out there if you do a search, and can add a link to the ladder page from the home page, or wherever you want.
You're asking JP to write something that is already done, and by no means easy.
I just did a search and found a bunch of them, and used to admin a gaming ladder that used them.
They work well, do a search and check them out.
Title: Re: Clan war points block : need idea's/help
Post by: Wasdy on July 18, 2008, 09:20:43 PM
Hey, that's pretty much what I'm looking for also!

I hope you get it done soon  :)
Title: Re: Clan war points block : need idea's/help
Post by: Heero on July 18, 2008, 09:28:12 PM
Bluto,

I've searched like hell behind such a script,
I even asked a friend (which also is busy with those things) for scripts like that,
he gave me several links, I've tryed them all out and they all didn't worked well with smf or are vulnerable.
Why do you think I came back to this topic?

I even mailed someone who made a bridge for vwar, and he gave me the following mail back :

Quote from: feeble
Hi,
sorry about the late reply I dont really check leaderless any more.
I do apologise for this.

In regards to the vwar-smf script.
Since I haven't used vwar in a long time(I'm actually using my own code)
The bridge I made along time ago is broken as well since it was made several years ago and new versions of vwar have since passed.

I highly recommend not to use vwar, as it can be hacked quite easily

hopefully this answer is sufficient

regards,
feeble

I don't think it would be useless if she creates it,
I'll be using it, and I guess others too since this can be used for many other things too.
Sorry, I might be asking to write her something that does exist,
but it doesn't exist for smf yet, and that's the goal.

I've searched for ladder scripts, these 'scripts' come along with a pretty big portal, and that's not what I need.
Although, if you know anything better, please give a hint.
Title: Re: Clan war points block : need idea's/help
Post by: Bluto on July 18, 2008, 09:32:36 PM
Get what done? Go find the ladder scripts, install them, and use vWar also,(as mentioned earlier in this topic), if you want also to keep a record for your team. Here's a link to make it even easier for you.http://www.mygamingladder.com/ (http://www.mygamingladder.com/)
Title: Re: Clan war points block : need idea's/help
Post by: Bluto on July 18, 2008, 09:34:23 PM
Sorry, guess I was posting at the same time.
A ladder script is different than vWar.
And it does work with SMF. We had a loaded gaming ladder using it.
The ladder will also keep track of all stats for you.
Title: Re: Clan war points block : need idea's/help
Post by: Heero on July 18, 2008, 09:51:53 PM
I found http://www.mygamingladder.com/ before but you need to pay for it ... Pretty much.
And I really don't need a big ladder script, I know it also exists for smf, although,
I'm asking for a clan war script which only shows points and not a whole combat(ladder) system script..
Title: Re: Clan war points block : need idea's/help
Post by: Wasdy on July 18, 2008, 09:54:13 PM
vWar can be hacked with relative ease so I really wouldn't use it.
And I'm not looking for a ladder script, neither is Xarwin.
Title: Re: Clan war points block : need idea's/help
Post by: JPDeni on July 18, 2008, 10:47:14 PM
It's perfectly okay to add things now. I haven't written anything yet.

You show:

(http://war3) Warcraft 3

in addition to other images. Does Warcraft 3 always have the same image? If so, there's no need to enter the

(http://war3)

part. It can be taken care of in the programming. Same thing with the clans.

How many possible games are there? How many possible clans are there? Does each clan have its own flag graphic?
Title: Re: Clan war points block : need idea's/help
Post by: Bluto on July 18, 2008, 10:56:27 PM
Sorry guys. I thought you were looking to keep track of match stats.
Guess I'm missing the point.
Hope you find what you need.
Title: Re: Clan war points block : need idea's/help
Post by: Heero on July 18, 2008, 11:05:33 PM
np Bluto ;) .

Erhm oh well, Deni ..
Is it harder to make it just submittable with text and bbc or html support?
Because we are playing in some kind of league, which always generates random matches.
That means we need to play versus many different clans and otherwise if you only add a few clans we have a limited selection :).

As for the first game image.. we might expand to new games in the future which we might not know yet..

So is it possible to just submit data which is given?
I am sorry if I'm being hard in posting :( but it makes me happy that you are creating this :)
Title: Re: Clan war points block : need idea's/help
Post by: JPDeni on July 18, 2008, 11:41:18 PM
Quoteif you only add a few clans
Well, we can make as many as you want. But it can just be an open field if you want.

It can also be done with the images, but things are a lot easier if it's simpler and more compact.

For example, you have Warcraft 3 as a game name, right? You could have a graphic called Warcraft3.gif. Then later on you have a game called Warcraft 7. You would just put the name of the game in the field and upload a graphic file called Warcraft7.gif. The programming can determine the name of the graphic file based on the input, rather than having to put in the name of the graphic file as well.

Same with the clans. You have Clan Tern and the accompanying file could be ClanTern.gif (or clantern.gif if you prefer).

It can be done the way you say, but there is more possibility of error that way. If the graphics are hosted on another server or you don't have any control over the naming of the files, then this won't work.

How many do you want to show? All? A limited number? Most recent first?
Title: Re: Clan war points block : need idea's/help
Post by: Heero on July 19, 2008, 01:02:24 AM
Oh, that would be great too!

As long as I can add more games/clans it would be great !
The images for the clans are actualy the flag of their country.

And I'd like to show the 5 most recent clan war points if that's possible :).

Many thanks again!

p.s. clan tern is an example clan,  clan x2o is how our clan is named.
Title: Re: Clan war points block : need idea's/help
Post by: Heero on July 25, 2008, 01:25:43 PM
Sorry for the double posting,
but is there anything happening :)?

Don't want to push for creation either,
but just want to know a bit if there is progress :).
Title: Re: Clan war points block : need idea's/help
Post by: Ken. on July 25, 2008, 01:43:24 PM
Some of our code specialist team members are on holiday so you may have a few days wait before seeing any response to you questions.

Thanks.
Title: Re: Clan war points block : need idea's/help
Post by: JPDeni on July 25, 2008, 01:44:31 PM
Actually, I've been taking some time away from programming. To tell you the truth, I'm a bit burned out at the moment and have been working on something completely different.

However, I have thought a bit about your issue. I think that the best way to deal with entering, deleting and editing the data is to create a board (or child board) in your forum, which only the appropriate member groups can access.

Have your people enter the data -- one record per post -- in the form of:

Game
First Clan Name
Results
Second Clan Name

Create a center block that is only visible from within that board to remind people of the format that is required. Stress that the first four lines of the post must be in the correct format.

At that point, it's merely a matter of reading, parsing and displaying the most recent x number of posts in that board, rather like the code that I wrote for someone else recently.

Does that sound reasonable?

Quotep.s. clan tern is an example clan,  clan x2o is how our clan is named.

Does this mean that the "First Clan" will always be the same?

P.S. Thanks Ken!!  :)
Title: Re: Clan war points block : need idea's/help
Post by: Heero on July 25, 2008, 02:43:29 PM
Oh, yes JPDeni it sounds reasonable :)
The only minus is that we can't add images.. Ah well, not everything can be perfect.

But I'll try to figure something out then ..

Quote
Quote
p.s. clan tern is an example clan,  clan x2o is how our clan is named.
Does this mean that the "First Clan" will always be the same?
Yes it does ;)

Ken., thanks for your response, I will.

Edit :
sigh hmm, isn't it possible showing the first 5 lines of a topic?
That would do it too. I'll be searching if this is possible.
Title: Re: Clan war points block : need idea's/help
Post by: JPDeni on July 25, 2008, 03:16:47 PM
QuoteThe only minus is that we can't add images

Sure you can.

Let's say you have an entry that reads like this:

World of Warcraft 3
Clan X20
4:1
Clan Nasty People

The code I'll write will look at those four lines and will look for images called

worldofwarcraft3.jpg
clanx20.jpg
clannastypeople.jpg

and then, in the block, print out



|worldofwarcraft3.jpg |clanx20.jpg Clan X20 |4:1 |clannastypeople.jpg Clan Nasty People |

That's what you want, right? Except that the images will show up instead of the names of the image files. Isn't that what we agreed on before?

Quote
QuoteDoes this mean that the "First Clan" will always be the same?

Yes it does

Then it doesn't need to be entered. :) That can be within the script. No point in having people enter the same data over and over again.

Quotesigh hmm, isn't it possible showing the first 5 lines of a topic?

Sure. You can have the first 43 lines of a topic if you want. The lines just have to be the same type of data in each post. If you'll tell me what you want to display, I can tell you how to set it up to do whatever you want. But you have to tell me what you want first.
Title: Re: Clan war points block : need idea's/help
Post by: Heero on July 25, 2008, 10:40:11 PM
Let me ask you this, what is the most easiest way for you?
I don't want to bother you that much with this request ;) .
Title: Re: Clan war points block : need idea's/help
Post by: JPDeni on July 25, 2008, 11:06:07 PM
It's easiest for me to have you tell me what you want. :)

It's easiest for both of us if the data is entered into posts and not in a form. But I really need to know what fields you want before I can know for certain. You can have as many fields as you need, but you have to tell me what they are going to be up front.

At present, you need

Game (which will have an image connected with it)
Score
Enemy clan (which will have an image connected with it)

You don't need to enter your own clan name every time, since it will be the same every time. What else do you need to display?
Title: Re: Clan war points block : need idea's/help
Post by: Heero on July 26, 2008, 04:22:43 AM
Well..  I guess you know somehow what I want to have.
As the fields I guess you want to know the input, right?
(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fimg369.imageshack.us%2Fimg369%2F3907%2Fsubmissionsft4.jpg&hash=1890780961e8d1962018bb6504cac192a58bb8d8)
And so on front page present :
(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fimg394.imageshack.us%2Fimg394%2F2958%2Fcwox5.jpg&hash=1a790eb20ca01a6b85a7efc31d26129fd83ed182) , or anything what makes it easy for u to create.

p.s. It could be I misunderstood your question. I'm sorry for that.
Title: Re: Clan war points block : need idea's/help
Post by: JPDeni on July 26, 2008, 05:50:36 AM
Earlier you said:
Quotesigh hmm, isn't it possible showing the first 5 lines of a topic?

I took that to mean you needed another field. But you didn't add a field. You still have your original 4. This is why I'm confused.

Unless you think that "the first 4 lines of a topic" means that it would only show four of your war thingies. Let me see if I can explain it again.

You create a board that only certain members can see -- whoever you want to be able to add, modify and delete the information. You create a topic in the board. You put the following in the first post:

------------------------------------------------------
Warcraft 3
Clan Tern
4:1
Clan Yui
------------------------------------------------------

That's it. Just the things between the lines up there are in that first post. Then you have another war thingy and you post those results by adding another post to the topic:

------------------------------------------------------
Warcraft 3
Clan Tern
3:2
Clan On
------------------------------------------------------

Then you have another war. You post those results in another post:

------------------------------------------------------
Warcraft 3
Clan Tern
2:2
Clan Pol
------------------------------------------------------

You continue that way. Each time you have a war you add a post to that topic in that hidden board with the information about the results of the war, always exactly in that order:

Game
Your clan
Results
Enemy clan

The names of the graphic files you want to use should be

For the games -- the name of the game in lower case with the spaces removed and add the file extension -- Warcraft 3 becomes warcraft3.jpg

For the clans -- the name of the clan in lower case with the spaces removed and add the file extension -- Clan Tern becomes clantern.jpg

The only thing you have to worry about is getting the names of the files right and tell me what folder they're going to be in. The code in the block will take care of the rest.

I write code for a block that reads the 5 most recent posts in that hidden board. The code then translates each line into a name of a graphic file which you have added and have in a specific folder on your site. It prints out the graphic files, the clan names and the results in a table, just like you made as an example

The reason that I'm wanting to use a forum post is that it means I don't have to write code for editing and deleting the information. Adding stuff is real easy to write code for. When I have to add the functions of editing and deleting, it's a whole 'nother ball game. I can do it, but it's just as easy for you to put it into posts as it is for you to put it into a form.

Does this make more sense?
Title: Re: Clan war points block : need idea's/help
Post by: Heero on July 26, 2008, 02:28:07 PM
Well it does ...
Sorry for misunderstanding and thanks for your patience lol.

The folder could be just named clanwarimg. Not that the name actually matters that much for me ;) .
For the images, I can add more later on, right? ( note that I have enough knowledge to edit some php )

And if I'm correct by understanding, it would be like this to post :

warcraft3.jpg ( - > This reveals an image if it is correctly spelled )
flageurope.jpg Clan x2o ( -> This reveals one image, and the text )
1 - 3 ( -> This reveals the score of the clanwar )
flagrussia.jpg Clan Test ( This reveals one image again, and the text )

And on the frontpage it would show the 5 latest wars.

Are we following both the right line now?
Thanks in advance,
Xarwin :)
Title: Re: Clan war points block : need idea's/help
Post by: JPDeni on July 26, 2008, 03:35:40 PM
QuoteFor the images, I can add more later on, right?
All you have to do is to stick them in the folder, following the naming pattern of making it all lower-case and taking out the spaces. The script will take care of everything else.

QuoteAnd if I'm correct by understanding, it would be like this to post :

Well, you can do that, but it will make life more difficult for you. I'm trying to make it easier.

Rename flageurope.jpg to clanx2o.jpg
Rename flagrussia.jpg to clantest.jpg

Then all you have to do is enter the data like this:

Warcraft 3
Clan x2o
1 - 3
Clan Test

and the script will take it from there.

Something just occurred to me. Does each clan have its own flag or can several clans share a flag?
Title: Re: Clan war points block : need idea's/help
Post by: Heero on July 26, 2008, 03:39:54 PM
Heh thanks ..

Well about the flags, it can be any flag since each clan can be from a different country.
It's okay if I can manuel add more codes & images to display other flags :)
Title: Re: Clan war points block : need idea's/help
Post by: JPDeni on July 26, 2008, 05:08:43 PM
Quoteeach clan can be from a different country.

Can two clans be from the same country? This is a very important question and the whole code depends on the answer. Is it possible that two clans could use the same flag graphic?
Title: Re: Clan war points block : need idea's/help
Post by: Heero on July 26, 2008, 05:31:29 PM
Yes, that's possible. It might be that both clans are using the same flags.
Title: Re: Clan war points block : need idea's/help
Post by: barpoet on July 26, 2008, 05:43:54 PM
Where is this code? I'm just curious cause this could be a useful code for Clan forums. ;D
Title: Re: Clan war points block : need idea's/help
Post by: Heero on July 26, 2008, 05:47:41 PM
JPDeni is still taking care of it.

And indeed barpoet, I have a clan forum and that's why I've requested it :).
Title: Re: Clan war points block : need idea's/help
Post by: barpoet on July 26, 2008, 06:14:31 PM
Can you guy's post it when it's finished... It'd be great to be able to utilize it for tourneys
Title: Re: Clan war points block : need idea's/help
Post by: JPDeni on July 26, 2008, 06:21:20 PM
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.
Title: Re: Clan war points block : need idea's/help
Post by: barpoet on July 26, 2008, 07:01:48 PM
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....
Title: Re: Clan war points block : need idea's/help
Post by: Heero on July 26, 2008, 07:35:46 PM
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.
Title: Re: Clan war points block : need idea's/help
Post by: JPDeni on July 26, 2008, 07:45:56 PM
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. :)
Title: Re: Clan war points block : need idea's/help
Post by: Heero on July 26, 2008, 07:48:56 PM
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.
Title: Re: Clan war points block : need idea's/help
Post by: JPDeni on July 29, 2008, 07:09:30 PM
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.
Title: Re: Clan war points block : need idea's/help
Post by: Heero on July 29, 2008, 07:36:48 PM
Omg JPDeni that's just amazing!
It works perfectly!
I'm very thankful you made this script :).
I owe you one now !
Title: Re: Clan war points block : need idea's/help
Post by: JPDeni on July 29, 2008, 07:40:30 PM
I'm glad it works for you. :) You're very welcome.
Title: Re: Clan war points block : need idea's/help
Post by: c4rver on August 02, 2008, 01:53:59 PM
Thanks for the code, I'm look for that! It would be possible that the winner show in green & looser in red??  Is it possible with a subtraction??
Ex1: Clan A   0 - 4  Clan B
Ex2: Clan A   10 - 4  Clan B

if "score"(ex1:0-4= -4  Ex2: 10-4= 6) is >0 "Clan A" is red and "Clan B" is green else  "Clan A" is green and "Clan B" is red

(sorry for my english)
Title: Re: Clan war points block : need idea's/help
Post by: JPDeni on August 03, 2008, 01:37:44 AM
Yes, it would be possible. :)

Oh! You want me to do it? ;) Tomorrow or Monday.
Title: Re: Clan war points block : need idea's/help
Post by: JPDeni on August 04, 2008, 05:53:12 PM

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>';
Title: Re: Clan war points block : need idea's/help
Post by: c4rver on August 04, 2008, 06:25:30 PM
Thank you very much!
Title: Re: Clan war points block : need idea's/help
Post by: Heero on December 13, 2008, 06:09:43 PM
Hello JPDeni,
again, thanks for the awesome script, it is still working fine over here!
However I've been using it a very long time, I'd like to slighty modify it.

Is it possible to have everything (the images & text) in one line?
I'm planning to use a marquee scrolling.
And, it isn't that urgent so if you're very busy, np.

A small reply how to do would be fine, thanks :)
Title: Re: Clan war points block : need idea's/help
Post by: JPDeni on December 13, 2008, 06:16:58 PM
The whole thing is set up to be displayed in a table. You can take out the table formatting if you don't want it that way.
Title: Re: Clan war points block : need idea's/help
Post by: Heero on December 13, 2008, 06:55:40 PM
Oh right, I'm such a fool that I didn't see it :D

Thanks, it works now :).
Title: Re: Clan war points block : need idea's/help
Post by: goofyfootejb on December 23, 2008, 07:33:13 PM
I stumbled upon this script and found it very useful and it suited what I was looking for almost perfectly. I was wondering though if it could be modified  a bit so that if you posted two more lines, one being a date and one being a map name (see below), that they would appear in the table in two additional cells. I tried to do it but I don't know php at all so I wasn't able to get anywhere. If you could help me that would be great.

game image
(clan 1 image) Clan 1 name
Score
(clan 2 image) Clan 2 name
date
map name
Title: Re: Clan war points block : need idea's/help
Post by: JPDeni on December 23, 2008, 07:48:25 PM
I don't know where you would get the data for the date and the map name, but structurally it would be like this:


  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>';


You would have to define the $date and $mapname variables, because without knowing where they come from, I can't write the definition.

Also, these are horizontal records, not vertical. It goes:

game image - (clan 1 image) Clan 1 name - Score - (clan 2 image) Clan 2 name - date - map name
Title: Re: Clan war points block : need idea's/help
Post by: goofyfootejb on December 23, 2008, 08:01:48 PM
Quote from: JPDeni on December 23, 2008, 07:48:25 PM
I don't know where you would get the data for the date and the map name, but structurally it would be like this:

You would have to define the $date and $mapname variables, because without knowing where they come from, I can't write the definition.

Also, these are horizontal records, not vertical. It goes:

game image - (clan 1 image) Clan 1 name - Score - (clan 2 image) Clan 2 name - date - map name

I know it goes horizontal. I may have worded it badly so let me try again. Currently, you make a new post in the thread that looks like this to enter the data.

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

What I was trying to do was make it so you enter this into a post.

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

so that is shows up in script box the way  you have it in your post

game image - (clan 1 image) Clan 1 name - Score - (clan 2 image) Clan 2 name - date - map name
Title: Re: Clan war points block : need idea's/help
Post by: JPDeni on December 23, 2008, 08:09:53 PM
Ah. :)

Okay. As long as you're just copying the text on those lines, you can use this:


  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>' . $lines[4] . '</td>';
  echo '<td>' . $lines[5] . '</td>';
  echo '</tr>';
Title: Re: Clan war points block : need idea's/help
Post by: goofyfootejb on December 23, 2008, 08:15:08 PM
Thank you that worked perfectly
Title: Re: Clan war points block : need idea's/help
Post by: goofyfootejb on January 15, 2009, 02:34:17 AM
Hey I have another question regarding the war block but it is sort of on a different topic. First let me just say I love this block. It looks absolutely great!

I was wondering though if you'd know if there was anyway got get this to display where the News would at the top of the theme? I tried just putting the code in the normal place where you type the news but that didn't work. If you don't get what I mean I attached a picture of my forums showing where I am trying to get this to display.

http://phenomfive.lemonnades.org is my website.
Title: Re: Clan war points block : need idea's/help
Post by: JPDeni on January 15, 2009, 02:37:18 AM
You would need to talk to the theme designer. The code would go into your index.template.php file -- somewhere. I can't tell you where because I don't know anything about that theme. (I also don't "do" themes. ;) )

I'm glad it's working well for you, though.
Title: Re: Clan war points block : need idea's/help
Post by: goofyfootejb on January 15, 2009, 02:44:08 AM
Quote from: JPDeni on January 15, 2009, 02:37:18 AM
You would need to talk to the theme designer. The code would go into your index.template.php file -- somewhere. I can't tell you where because I don't know anything about that theme. (I also don't "do" themes. ;) )

I'm glad it's working well for you, though.

Thank you for the info!
Title: Re: Clan war points block : need idea's/help
Post by: Kimmen on February 24, 2009, 07:17:00 PM
Nice minty thing this one. I used this version of the code:

  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>' . $lines[4] . '</td>';
  echo '<td>' . $lines[5] . '</td>';
  echo '</tr>';


JPDeni, is it possible to make each event scroll? I have now 5 events listed, but i want them to scroll in a smaller box. I use upper block to display it now, and added a center to it, so it is in center, but is it possible that the box shows the size of 3 events and scrolls the next 10 events?
Title: Re: Clan war points block : need idea's/help
Post by: JPDeni on February 24, 2009, 07:38:06 PM
What do you mean by "scroll"? Do you want the whole thing to be continuously scrolling or do you want scroll bars in the block?
Title: Re: Clan war points block : need idea's/help
Post by: Kimmen on February 24, 2009, 07:46:51 PM
I want all events to scroll automatic, but the box need to be the same size as it is with 3 events displayed  :)

Edit: If you can make it pause for 2 sec for each event or make a pause when mouse is over it, that would also help, but is not heavily needed, only if it is possible i would like it.
Title: Re: Clan war points block : need idea's/help
Post by: JPDeni on February 24, 2009, 08:27:09 PM
I don't know how to make it pause for each event. This will make it pause when the mouse is over it. This is just borrowed code that I got from SMF for "who's online today."

Before the printout of the text, add


echo '

<style type="text/css">

#marqueecontainer{
position: relative;
width: 95%; /*marquee width */
height: 150px; /*marquee height */
overflow: hidden;
padding: 2px;
padding-left: 4px;
}

</style>

<script language="javascript" type="text/javascript">

/***********************************************
* Cross browser Marquee II- Ã,© Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

var delayb4scroll=1000 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
var marqueespeed=1
var pauseit=1 //Pause marquee onMousever (0=no. 1=yes)?

////NO NEED TO EDIT BELOW THIS LINE////////////

var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var actualheight=\'\'

function scrollmarquee(){
if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+8))
cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px"
else
cross_marquee.style.top=parseInt(marqueeheight)+8+"px"
}

function initializemarquee(){
cross_marquee=document.getElementById("vmarquee")
if(cross_marquee == null)
   return
cross_marquee.style.top=0
marqueeheight=document.getElementById("marqueecontainer").offsetHeight
actualheight=cross_marquee.offsetHeight
if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1){ //if Opera or Netscape 7x, add scrollbars to scroll and exit
cross_marquee.style.height=marqueeheight+"px"
cross_marquee.style.overflow="scroll"
return
}
setTimeout(\'lefttime=setInterval("scrollmarquee()",30)\', delayb4scroll)
}

if (window.addEventListener)
window.addEventListener("load", initializemarquee, false)
else if (window.attachEvent)
window.attachEvent("onload", initializemarquee)
else if (document.getElementById)
window.onload=initializemarquee


</script>

<div id="marqueecontainer" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">
<div id="vmarquee" style="position: absolute; width: 98%;">
';


After the printout of the text, add


echo '
</div>
</div>
';


You may have to play around with the height in the line


height: 150px; /*marquee height */


to get it to the size you want.
Title: Re: Clan war points block : need idea's/help
Post by: Kimmen on February 24, 2009, 09:04:49 PM
This is grate.
Title: Re: Clan war points block : need idea's/help
Post by: Kimmen on February 24, 2009, 09:28:34 PM
I was asked if it is possible to make each event with a link in it. Lets say that the first event looks like this:

Picture   The [OAPS]   6-1   -=SD=- Skunkdogz   31 FEB 2009 ""   Strike at Karkand / Road to Jalalabad

That is the first event, if i want to have a link that takes me to a specific forum topic, would that be possible as well?

I guess i want setup to be something like:

Link to original forum topic
game image
(clan 1 image) Clan 1 name
Score
(clan 2 image) Clan 2 name
date
map name


So when i hold my mouse over that particular event, i can click on it, and it takes to the specific topic.

Thanks for all your help so far  ;D

Title: Re: Clan war points block : need idea's/help
Post by: JPDeni on February 24, 2009, 09:37:50 PM
How would I know what the topic is?
Title: Re: Clan war points block : need idea's/help
Post by: Kimmen on February 24, 2009, 09:43:28 PM
You don't. I know what the topic is, so i want the possibility to put in a link to the topic, where i put in the info for the event in the hidden board on the forum  :)
Title: Re: Clan war points block : need idea's/help
Post by: JPDeni on February 24, 2009, 09:50:23 PM
So it would be another line in the post?

Right now the post that you're taking the info from is

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

Yes?

Add another line:

game image
(clan 1 image) Clan 1 name
Score
(clan 2 image) Clan 2 name
date
map name
topic number

Then you can just use another variable in the array:


  echo '<tr>';
  echo '<td><a href="' $scripturl . '?topic=' . lines[6] . '">Link</a></td>';
  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>' . $lines[4] . '</td>';
  echo '<td>' . $lines[5] . '</td>';
  echo '</tr>';


You'll also need to add a line to the beginning of the code:


global $scripturl;

Title: Re: Clan war points block : need idea's/help
Post by: Kimmen on February 24, 2009, 09:58:39 PM
I only got error message now.

Here is the total code i currently have:

global $scripturl;
echo '
<style type="text/css">

#marqueecontainer{
position: relative;
width: 95%; /*marquee width */
height: 150px; /*marquee height */
overflow: hidden;
padding: 2px;
padding-left: 4px;
}

</style>
<script language="javascript" type="text/javascript">

/***********************************************
* Cross browser Marquee II- Ã,© Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

var delayb4scroll=1000 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
var marqueespeed=1
var pauseit=1 //Pause marquee onMousever (0=no. 1=yes)?

////NO NEED TO EDIT BELOW THIS LINE////////////

var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var actualheight=\'\'

function scrollmarquee(){
if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+8))
cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px"
else
cross_marquee.style.top=parseInt(marqueeheight)+8+"px"
}

function initializemarquee(){
cross_marquee=document.getElementById("vmarquee")
if(cross_marquee == null)
   return
cross_marquee.style.top=0
marqueeheight=document.getElementById("marqueecontainer").offsetHeight
actualheight=cross_marquee.offsetHeight
if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1){ //if Opera or Netscape 7x, add scrollbars to scroll and exit
cross_marquee.style.height=marqueeheight+"px"
cross_marquee.style.overflow="scroll"
return
}
setTimeout(\'lefttime=setInterval("scrollmarquee()",30)\', delayb4scroll)
}

if (window.addEventListener)
window.addEventListener("load", initializemarquee, false)
else if (window.attachEvent)
window.attachEvent("onload", initializemarquee)
else if (document.getElementById)
window.onload=initializemarquee


</script>

<div id="marqueecontainer" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">
<div id="vmarquee" style="position: absolute; width: 98%;">
';

global $db_prefix;

$topic = 80; // 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 = 'clanwars';  //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 '<center><table border=0>';
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><a href="' $scripturl . '?topic=' . lines[6] . '">Link</a></td>';
  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>' . $lines[4] . '</td>';
  echo '<td>' . $lines[5] . '</td>';
  echo '</tr>';
}
echo '</table></center>';
echo '
</div>
</div>
';
Title: Re: Clan war points block : need idea's/help
Post by: Kimmen on February 27, 2009, 11:33:43 PM
bump
Title: Re: Clan war points block : need idea's/help
Post by: JPDeni on February 28, 2009, 03:31:56 AM
Sorry. I didn't see your earlier post.

What was the error message?
Title: Re: Clan war points block : need idea's/help
Post by: Kimmen on March 01, 2009, 12:29:09 AM
It says:

Parse error: syntax error, unexpected ';', expecting T_PAAMAYIM_NEKUDOTAYIM in /home2/theocouk/public_html/Sources/Load.php(1741) : eval()'d code(52) : eval()'d code on line 76
Title: Re: Clan war points block : need idea's/help
Post by: JPDeni on March 01, 2009, 12:40:27 AM
There were some little errors, but they were on line 108.


global $scripturl;
echo '
<style type="text/css">

#marqueecontainer{
position: relative;
width: 95%; /*marquee width */
height: 150px; /*marquee height */
overflow: hidden;
padding: 2px;
padding-left: 4px;
}

</style>
<script language="javascript" type="text/javascript">

/***********************************************
* Cross browser Marquee II- Ã,© Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

var delayb4scroll=1000 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
var marqueespeed=1
var pauseit=1 //Pause marquee onMousever (0=no. 1=yes)?

////NO NEED TO EDIT BELOW THIS LINE////////////

var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var actualheight=\'\'

function scrollmarquee(){
if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+8))
cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px"
else
cross_marquee.style.top=parseInt(marqueeheight)+8+"px"
}

function initializemarquee(){
cross_marquee=document.getElementById("vmarquee")
if(cross_marquee == null)
   return
cross_marquee.style.top=0
marqueeheight=document.getElementById("marqueecontainer").offsetHeight
actualheight=cross_marquee.offsetHeight
if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1){ //if Opera or Netscape 7x, add scrollbars to scroll and exit
cross_marquee.style.height=marqueeheight+"px"
cross_marquee.style.overflow="scroll"
return
}
setTimeout(\'lefttime=setInterval("scrollmarquee()",30)\', delayb4scroll)
}

if (window.addEventListener)
window.addEventListener("load", initializemarquee, false)
else if (window.attachEvent)
window.attachEvent("onload", initializemarquee)
else if (document.getElementById)
window.onload=initializemarquee


</script>

<div id="marqueecontainer" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">
<div id="vmarquee" style="position: absolute; width: 98%;">
';

global $db_prefix;

$topic = 80; // 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 = 'clanwars';  //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 '<center><table border=0>';
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><a href="' . $scripturl . '?topic=' . $lines[6] . '">Link</a></td>';
  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>' . $lines[4] . '</td>';
  echo '<td>' . $lines[5] . '</td>';
  echo '</tr>';
}
echo '</table></center>';
echo '
</div>
</div>
';
Title: Re: Clan war points block : need idea's/help
Post by: Kimmen on March 01, 2009, 12:50:49 AM
Now i have this error message:

Warning: Unexpected character in input: ''' (ASCII=39) state=1 in /home2/theocouk/public_html/Sources/Load.php(1741) : eval()'d code(52) : eval()'d code on line 118

Parse error: syntax error, unexpected '<' in /home2/theocouk/public_html/Sources/Load.php(1741) : eval()'d code(52) : eval()'d code on line 119
Title: Re: Clan war points block : need idea's/help
Post by: JPDeni on March 01, 2009, 01:05:20 AM
Are you sure you copied the code I posted correctly? Because, while it doesn't actually work on my test site, there are no errors.

Maybe you can try changing


echo '</table></center>';
echo '
</div>
</div>
';


to


echo '</table></center></div></div>';
Title: Re: Clan war points block : need idea's/help
Post by: Kimmen on March 01, 2009, 01:42:47 AM
Yes, when i do that, scrolling don't work. Link now shows in the first row, but i wanted the whole line to be a link, not a own row.
Title: Re: Clan war points block : need idea's/help
Post by: JPDeni on March 01, 2009, 01:47:14 AM
Post the code again.
Title: Re: Clan war points block : need idea's/help
Post by: Kimmen on March 01, 2009, 02:00:54 AM
Code is:

global $scripturl;
echo '
<style type="text/css">

#marqueecontainer{
position: relative;
width: 95%; /*marquee width */
height: 150px; /*marquee height */
overflow: hidden;
padding: 2px;
padding-left: 4px;
}

</style>
<script language="javascript" type="text/javascript">

/***********************************************
* Cross browser Marquee II- Ã,© Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

var delayb4scroll=1000 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
var marqueespeed=1
var pauseit=1 //Pause marquee onMousever (0=no. 1=yes)?

////NO NEED TO EDIT BELOW THIS LINE////////////

var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var actualheight=\'\'

function scrollmarquee(){
if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+8))
cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px"
else
cross_marquee.style.top=parseInt(marqueeheight)+8+"px"
}

function initializemarquee(){
cross_marquee=document.getElementById("vmarquee")
if(cross_marquee == null)
   return
cross_marquee.style.top=0
marqueeheight=document.getElementById("marqueecontainer").offsetHeight
actualheight=cross_marquee.offsetHeight
if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1){ //if Opera or Netscape 7x, add scrollbars to scroll and exit
cross_marquee.style.height=marqueeheight+"px"
cross_marquee.style.overflow="scroll"
return
}
setTimeout(\'lefttime=setInterval("scrollmarquee()",30)\', delayb4scroll)
}

if (window.addEventListener)
window.addEventListener("load", initializemarquee, false)
else if (window.attachEvent)
window.attachEvent("onload", initializemarquee)
else if (document.getElementById)
window.onload=initializemarquee


</script>

<div id="marqueecontainer" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">
<div id="vmarquee" style="position: absolute; width: 98%;">
';

global $db_prefix;

$topic = 80; // 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 = 'clanwars';  //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 '<center><table border=0>';
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><a href="' . $scripturl . '?topic=' . $lines[6] . '">Link</a></td>';
  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>' . $lines[4] . '</td>';
  echo '<td>' . $lines[5] . '</td>';
  echo '</tr>';
}
echo '</table></center></div></div>';
Title: Re: Clan war points block : need idea's/help
Post by: JPDeni on March 01, 2009, 02:17:16 AM
The scrolling works fine on mine. If it doesn't work on yours, you must be having a problem with your javascript.

As for the link, I don't know what you mean when you say
QuoteLink now shows in the first row, but i wanted the whole line to be a link, not a own row.

The script is set up to be like this:

Link | game image | Clan image | Clan Name | Score | Clan Image | Something | Something

That is one row. The link is in the first column of the row. Each column is in a table cell. It is not possible to maintain the structured printout and, at the same time, make the entire row into a link. Links can not go across table cells.

Now, what is it that you want?
Title: Re: Clan war points block : need idea's/help
Post by: Kimmen on March 01, 2009, 02:22:40 AM
Yes, i want the impossible that you explained. Anywho, thanks for your time JPDeni, you have been really helpful.  :up: :)
Title: Re: Clan war points block : need idea's/help
Post by: bobanss on May 06, 2009, 07:04:42 AM
Is it possible to haw a third color, I mean if the results is equal
Title: Re: Clan war points block : need idea's/help
Post by: JPDeni on May 06, 2009, 02:13:55 PM
It would be nice if people would tell me what is possible. I didn't know there could be ties.

After


$color[0] = 'red';
$color[1] = 'green';


add


$color[2] = 'purple'; // Change this to whatever you want the "tie" color to be


Change


  if (($score_array[0] - $score_array[1]) > 0) {
    $clan1winner = 1;
    $clan2winner = 0;
  }
  else {
    $clan2winner = 1;
    $clan1winner = 0;
  }


to


  if (($score_array[0] - $score_array[1]) == 0) {
    $clan1winner = 2;
    $clan2winner = 2;
  }
  elseif (($score_array[0] - $score_array[1]) > 0) {
    $clan1winner = 1;
    $clan2winner = 0;
  }
  else {
    $clan2winner = 1;
    $clan1winner = 0;
  }
Title: Re: Clan war points block : need idea's/help
Post by: bobanss on May 06, 2009, 08:16:12 PM
Thanks JPDeni that worked perfectly
Title: Re: [Block] Clan war points block : need idea's/help
Post by: Rav33n on June 21, 2009, 06:52:34 AM
Can someone who has used this script please put up a demo image of it in action :) ?

Thanks!
Title: Re: [Block] Clan war points block : need idea's/help
Post by: c4rver on June 21, 2009, 01:48:26 PM
Quote from: Rav33n on June 21, 2009, 06:52:34 AM
Can someone who has used this script please put up a demo image of it in action :) ?

Thanks!

Title: Re: [Block] Clan war points block : need idea's/help
Post by: tigerclaw on July 19, 2009, 08:05:17 AM
how to install this script? i really need it badly... :(
Title: Re: [Block] Clan war points block : need idea's/help
Post by: c4rver on July 19, 2009, 12:10:34 PM
Quote from: Fei Long on July 19, 2009, 08:05:17 AM
how to install this script? i really need it badly... :(
You need create a new php block and paste the code
Title: Re: [Block] Clan war points block : need idea's/help
Post by: tigerclaw on July 19, 2009, 12:25:52 PM
I know that it should be created using php block... :) but the problem is i'm getting errors...
Title: Re: [Block] Clan war points block : need idea's/help
Post by: c4rver on July 19, 2009, 12:29:35 PM
you need to post the results in a new thread, the you take de id from this thread and modify it in your code
Title: Re: [Block] Clan war points block : need idea's/help
Post by: tigerclaw on July 19, 2009, 12:33:22 PM
Quote from: JPDeni on July 29, 2008, 07:09:30 PM
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.

This is the problem...don't know how to get it working... :(

sorry for being so stupid... :(
Title: Re: [Block] Clan war points block : need idea's/help
Post by: JPDeni on July 19, 2009, 02:26:00 PM
I really don't know how to explain it any differently. Where do you start having problems?

Quotethe problem is i'm getting errors...

What are the errors? What did you do, exactly? Give me a step-by-step of what you did so I can figure out where you went wrong.
Title: Re: [Block] Clan war points block : need idea's/help
Post by: tigerclaw on July 19, 2009, 02:52:14 PM
actually it is now working (just make some messed with the code)...how stupid i am... :)

My main problem problem right now is that the images are not showing up on the Portal... :(
Title: Re: [Block] Clan war points block : need idea's/help
Post by: Heero on July 31, 2010, 12:27:53 AM
I might be wrong but this mod doesn't work with smf 2.0 versions, right?