You are not logged in.

#26 28 Jul 2006 2:22 am

Butcher
Moderator
From: Norway
Registered: Jul 2006
Posts: 308

Re: BF2 Rank

Ok, I tried it out, pasted everything from index.php ontop of the html page (above the <html>) and tested writing Global Score: <?= $global_score ?> in the output table cell, so I uploaded it to this link. Now, ontop of the site I get a message saying:

Warning: readfile(templates/enterid.tpl) [function.readfile]: failed to open stream: No such file or directory in /home/bamboo/public_html/prank/prank2.php on line 40

And after entering my nick, I get redirected to a page containing everything from index.tpl... I'm guessing that I have some wrong code somewhere since I get redirected instead of having it show up on the same page.


http://bamboocommandos.com/butcher_img/butchersig7.jpg

Offline

 

#27 28 Jul 2006 7:06 am

MadHatter
Administrator
From: Dallas TX
Registered: Jun 2006
Posts: 529
Website

Re: BF2 Rank

replace the code w/ this;

Code:

<?php

// check for the name in the url
if($_GET['nick']) {
        
    // include the library
    include("bf2/bf2_player.php");
    include("globals.php");
    
    $bf2_player = new bf2_player($_GET['nick']);
    
    if($bf2_player->is_valid_player) {
        $player_name = $bf2_player->stats['nick'];
        $global_score = $bf2_player->stats['scor'];
        $rank = $bf2_player->stats['rank'];
        $player_rank_text = $rank_text_table[$rank];
        $next_rank_text = $rank_text_table[$rank+1];        
        $progress = 0;
        if($global_score != 0) {        
            $progress = ((($global_score - $rank_table[$rank]) / ($rank_table[$rank + 1] - $rank_table[$rank])) * PERCENT);
        }        
    }
}

?>

and it should work.

Offline

 

#28 28 Jul 2006 8:28 am

Butcher
Moderator
From: Norway
Registered: Jul 2006
Posts: 308

Re: BF2 Rank

I replaced the top php with the above code, but it still won't work, and it keep redirecting me to an empty page. I don't understand why it keeps bugging, and the code keeps appearing ontop of it all aswell. There is something very wrong somewhere, but I can't understand what.


http://bamboocommandos.com/butcher_img/butchersig7.jpg

Offline

 

#29 28 Jul 2006 10:25 am

MadHatter
Administrator
From: Dallas TX
Registered: Jun 2006
Posts: 529
Website

Re: BF2 Rank

try renaming your page from .html to .php

Offline

 

#30 28 Jul 2006 10:56 am

Butcher
Moderator
From: Norway
Registered: Jul 2006
Posts: 308

Re: BF2 Rank

Tried it, same result except the stuff on the top is not showing up as code, but it now redirects me to the index.tpl again. link


http://bamboocommandos.com/butcher_img/butchersig7.jpg

Offline

 

#31 28 Jul 2006 11:30 am

MadHatter
Administrator
From: Dallas TX
Registered: Jun 2006
Posts: 529
Website

Re: BF2 Rank

1. your "<form action" tag points to that index.tpl file.  change it to action="".
2. your <?= $global_score ?> is actually written as &lt;?= $global_score &gt;, which will cause the literal text "<?= $global_score ?>" to show up (&lt; is the html code for the < symbol, and the &gt; is the html symbol for >)

Offline

 

#32 28 Jul 2006 12:01 pm

Butcher
Moderator
From: Norway
Registered: Jul 2006
Posts: 308

Re: BF2 Rank

Ok, fixed those 2. Though I keep running into errors, I pasted my nick in the box, and got this up:

Code:

Warning: include(bf2/bf2_player.php) [function.include]: failed to open stream: No such file or directory in /home/bamboo/public_html/prank/prank.php on line 7

Warning: include() [function.include]: Failed opening 'bf2/bf2_player.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/bamboo/public_html/prank/prank.php on line 7

Warning: include(globals.php) [function.include]: failed to open stream: No such file or directory in /home/bamboo/public_html/prank/prank.php on line 8

Warning: include() [function.include]: Failed opening 'globals.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/bamboo/public_html/prank/prank.php on line 8

Fatal error: Class 'bf2_player' not found in /home/bamboo/public_html/prank/prank.php on line 10

http://bamboocommandos.com/butcher_img/butchersig7.jpg

Offline

 

#33 28 Jul 2006 12:15 pm

MadHatter
Administrator
From: Dallas TX
Registered: Jun 2006
Posts: 529
Website

Re: BF2 Rank

you still need the bf2 folder inside prank.php

the directory structure needs to look something like this:

Code:

/prank
 |
 +-- /bf2
 |
 +-- prank.php

Offline

 

#34 28 Jul 2006 12:29 pm

Butcher
Moderator
From: Norway
Registered: Jul 2006
Posts: 308

Re: BF2 Rank

So, move it into the bf2 folder inside the stat folder? Or is it the bf2rank folder? Should the bf2rank folder be included at all?


http://bamboocommandos.com/butcher_img/butchersig7.jpg

Offline

 

#35 28 Jul 2006 12:38 pm

MadHatter
Administrator
From: Dallas TX
Registered: Jun 2006
Posts: 529
Website

Re: BF2 Rank

if you just copied the stats folder inside your prank foldler then you need to move the bf2 folder from inside the stats folder to the same directory as your prank.php file.

also you may want to remove the old html stuff that I had you put in there when you were trying to use your html file as the template.

Offline

 

#36 28 Jul 2006 2:02 pm

Butcher
Moderator
From: Norway
Registered: Jul 2006
Posts: 308

Re: BF2 Rank

Ok, moved the bf2 folder out of stats and into /prank. Not sure what I'm supposed to remove, lol, but now I got that error thing again.


http://bamboocommandos.com/butcher_img/butchersig7.jpg

Offline

 

#37 28 Jul 2006 3:50 pm

MadHatter
Administrator
From: Dallas TX
Registered: Jun 2006
Posts: 529
Website

Re: BF2 Rank

do this for me.

in dreamweaver, make the page as you want it to look (just html, with whatever stats you want on there, exactly how you want it to look), post the link here, and I'll just write you up something that you can use. 

make 2 html pages in dreamweaver: one for the empty page with no user stats, and the other that looks the way you want it to look when the stats come up.

that way you can just upload the contents of the script and you'll be set.

Offline

 

#38 29 Jul 2006 2:52 am

Butcher
Moderator
From: Norway
Registered: Jul 2006
Posts: 308

Re: BF2 Rank

Ok, made em:

Before stats show up: Empty_Link
When they show up: Filled_Link

They are set in nice table cells, all of them, so if you'd like, I'd be happy to send you the raw files if you need them.

Last edited by Butcher (29 Jul 2006 5:00 am)


http://bamboocommandos.com/butcher_img/butchersig7.jpg

Offline

 

#39 30 Jul 2006 8:44 pm

MadHatter
Administrator
From: Dallas TX
Registered: Jun 2006
Posts: 529
Website

Re: BF2 Rank

k, here you go.  Test it out hereDownload it here.

unzip and upload in place of your current prank. if you wish to save what you have, back up your existing prank contents, then delete the prank folder on the server (you may want to download the mailform.php file, and add it to the prank folder from my zip file).  then upload the prank folder from the zip file to the server.  then go to http://www.bamboocommandos.com/prank and enter your name. go to the url submit and you should be able to bookmark that page, and it will always display your stats. other clan members may do the same. you shouldnt have to edit any html or php for it to work (just unzip, and upload).  prank.html does not exist here, instead it uses the default index.php page to do everything. 

let me know how it goes.

Offline

 

#40 31 Jul 2006 2:36 am

Butcher
Moderator
From: Norway
Registered: Jul 2006
Posts: 308

Re: BF2 Rank

It works I guess, but the problem now comes to: How can I edit the html of it? If I want to change something on the page...
And how can I change the progress image? None of the ones in the images folder match... And none of my pretty bg images/header is in the image folder either, how do they show up on the page?

And the feedback now doesn't have it's header, naturally, since it's not in the image folder. The rank image is not showing up either. Check it out here.

And btw, I'll be going to Paris for a week from tomorrow, so if I don't post all my technical problems, it's just because of that, lol.

Last edited by Butcher (31 Jul 2006 3:18 am)


http://bamboocommandos.com/butcher_img/butchersig7.jpg

Offline

 

#41 31 Jul 2006 6:48 am

MadHatter
Administrator
From: Dallas TX
Registered: Jun 2006
Posts: 529
Website

Re: BF2 Rank

re-upload those images to the images folder.

to edit the Filled page, open /prank/templates/stats.tpl in dreamweaver and make changes to the html there.

to make the image work (sorry I did this late last night), open /prank/templates/stats.tpl and change line 58 from

<td width="149" height="80" rowspan="4" align="center"><img src="images/rank_<rank/>" border="0" alt="<rank_title/>"></td>

to

<td width="149" height="80" rowspan="4" align="center"><img src="images/rank_<rank/>.jpg" border="0" alt="<rank_title/>"></td>


I didnt do a progress image with this one.  to make the graident progress image work, you can either use the one I originally did, or create one of your own (in photoshop create a new image 2px wide and like 20px high, drop the gradient fill in and you're done... save that and upload to the images folder).

to make the progress image work, you open prank/templates/stats.tpl, find the <style></style> node, and inside the .progress block, add the area in bold (make sure you reference the image you use as your progress image, the following assumes you have that small progress image in your prank/images folder, and have named it "progress.jpg").

.progress {
        background-image: url('http://www.bamboocommandos.com/prank/images/progress.jpg');
    top:0px;
    left:0px;
    background-color:#00CC00;
    color:#ccc;
}



one other thing I forgot is to do the alt text for the rank image.    if you want that to work (where it shows the name of the rank when you mouse over the rank image)

--[open]--

prank/index.php

--[find]--

$file_contents = str_replace('<rank/>', $rank, $file_contents);

--[and after, add]--

$file_contents = str_replace('<rank_title/>', $rank_text_table[$rank], $file_contents);

Offline

 

#42 31 Jul 2006 8:25 am

Butcher
Moderator
From: Norway
Registered: Jul 2006
Posts: 308

Re: BF2 Rank

It works big_smile, thanks so much! If you ever need any graphical work done (lol), please let me know, I'll be at it! Very nice of you to help me get this little project done, it is highly appreciated!

Bye for now, I'm off to Paris to get even more burnt by the sun wink

Last edited by Butcher (31 Jul 2006 8:25 am)


http://bamboocommandos.com/butcher_img/butchersig7.jpg

Offline

 

#43 31 Jul 2006 9:22 am

MadHatter
Administrator
From: Dallas TX
Registered: Jun 2006
Posts: 529
Website

Re: BF2 Rank

Glad you got it working!  Have fun on your trip!

Offline

 

#44 01 Aug 2006 2:14 am

Butcher
Moderator
From: Norway
Registered: Jul 2006
Posts: 308

Re: BF2 Rank

Hmm, ok, just about to leave actually, lol, but there is something wrong with the: "Points for Next Rank:", it says 20.000 on everyone...

Last edited by Butcher (01 Aug 2006 2:22 am)


http://bamboocommandos.com/butcher_img/butchersig7.jpg

Offline

 

#45 01 Aug 2006 5:35 am

MadHatter
Administrator
From: Dallas TX
Registered: Jun 2006
Posts: 529
Website

Re: BF2 Rank

20000 is the score needed to get master and first sergeant.  50000 is the score needed for master gunnery sergeant and sergeant major.  60000 for 2nd lieutenant, 75000 for 1st lieutenant. 

http://www.bamboocommandos.com/prank/in … k=bash56ka doesnt show 20000 for next score.  you can verify points here: http://ubar.bf2s.com/ranks.php

Offline

 

#46 02 Aug 2006 12:01 pm

Repent
Member
Registered: Aug 2006
Posts: 9

Re: BF2 Rank

Hey all, I've installed the script, and have a PHP server, as well as GD installed, I'm not getting any errors in my error logs, but my output is garbled text:

Code:

JFIF>CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), default quality C    $.' ",#(7),01444'9=82<.342C  2!!22222222222222222222222222222222222222222222222222PP" ĵ}!1AQa"q2 #BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz ĵw!1AQaq"2 B #3Rbr $4%&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz ?#֧X XXrNJc%Z[zю8⬭'{Ӱd}!>$Ps \V}ο@?+=JjZHvqO4Ӫjz1isx_?&q_YٞX *T>^f4<3Z]' vªKmJݣ4htCIsWEUpVCcv&YHTQMqZƫi,{Ծ%59NRI9)Kүiׂ8`]̛Gɣ1'nyaJyՇgbfo_Rq ѵ&<"'i'S ɭO evuS?/)X.ʧ' gVO;=_r3\Ķ:!n U v[[@'> 4 T^!ng4 4)8#AwL]洣/eV.I'4٭?z .ռB}> W уUIpzRx&_i/h OJ׸i\I[ž(vlj,J?y'V. GcT &p[{uM}sb1z4]FkA$ 2<, Ԏ3pQ<֬x2{moמ`cz5j]啄mlV*::R)95싗!V{ óZ=nBsM  njͱ;lu{+(aX'S=c )>q% ϙۭn\.UY2ܤQҶN8YtI))s]5o {9[kϸKfG|isfsJ4mݚqir~^C_׭5 N, g< <>kM0Y# j[kmJdr]S_UF.0IEY^W23eΩgu5:*  qdkKY X]B9@Xima$?Gw8#kL o-s$jٯ Z業]jFv.\N$B" ڤwu jN% ":"v8A$?_BRK֔+Q3ֺ0z;k-N\OubUERYc  >v"!.}*wC ֿQ B;m "Q pQv؋\

I know this is the actual JPG being translated to TEXT, but I can't figure out whats causing it.

Any ideas?

Great script, by the way.

smile

Offline

 

#47 02 Aug 2006 12:45 pm

MadHatter
Administrator
From: Dallas TX
Registered: Jun 2006
Posts: 529
Website

Re: BF2 Rank

That happens when the browser doesnt know what type of data its downloading.  the HTTP Content-Type: header should tell the browser that its a jpeg, so make sure the line:

header("Content-type: image/jpeg");

comes before

imagejpeg($img);

imagejpeg is whats repsonsible for writing out the image to your browser. 


what browser is this in by the way?

Offline

 

#48 02 Aug 2006 1:15 pm

Repent
Member
Registered: Aug 2006
Posts: 9

Re: BF2 Rank

Both IE & FireFox

Here's a link: http://www.wwa-clan.com/avatar/pid/45647367/score.jpg

I have the .htaccess file set up, no errors, ust the image display. I downloaded the bf2rank.zip from here, and haven't "fiddled" with the code any.

I'm a bit baffled, need more caffiene smile

Offline

 

#49 02 Aug 2006 1:18 pm

Repent
Member
Registered: Aug 2006
Posts: 9

Re: BF2 Rank

BTW.. I run another BF2 signature script on my site, I haven't had any problems with it, but it uses PNG files.

http://www.wwa-clan.com/sigfiles/3/43712178.png

That's why I'm a bit baffled.

Offline

 

#50 02 Aug 2006 1:36 pm

MadHatter
Administrator
From: Dallas TX
Registered: Jun 2006
Posts: 529
Website

Re: BF2 Rank

the content type header is being changed (i'm guessing during the mod-rewrite).  try referring to it the long way and see if it shows up an image or displays text.  if it shows text then somethings wrong w/ the script, but if it shows up then there's something going on w/ mod rewrite.

Offline

 



© 2003 - 2018 NullFX
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License