|
Web design and Programming Discuss website creation and other programming topics. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
||
|
BHD Heartbeat
Hi Scott, would it be possible to add a map image to the coding showing which map is playing?
|
#2
|
||
|
It should be possible if you have the map images for sure. Your code would look something like this:
Code:
if(file_exists("/pathto/mapimages/".$Server['MissionFile'].".jpg")) { echo "<img src=\"/pathto/mapimages/".$Server['MissionFile'].".jpg\" />"; } else { echo "<img src=\"/pathto/mapimages/nophoto.jpg\" />"; }
__________________
04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq |
#3
|
||
|
Not sure if i got this right, code added to the status.php.
Added a new folder into the BHD directory with an image called nophoto.jpg Code:
if(file_exists("/Program files(X86)/Novalogic/Delta Force Black Hawk Down/mapimages/".$Server['MissionFile'].".jpg")) { echo "<img src=\"/Program files(X86)/Novalogic/Delta Force Black Hawk Down/mapimages/".$Server['MissionFile'].".jpg\" />"; } else { echo "<img src=\"/Program files(X86)/Novalogic/Delta Force Black Hawk Down/mapimages/nophoto.jpg\" />"; } else { |
#4
|
||
|
Well you'd upload the files to your ftp and put the paths there. Something like (using tio coop status page for example):
Code:
if(file_exists("./mapimages/".$Server['MissionFile'].".jpg")) { echo "<img src=\"./mapimages/".$Server['MissionFile'].".jpg" />"; } else { echo "<img src=\"./mapimages/nophoto.jpg\" />"; }
__________________
04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq |
#5
|
||
|
LOL i tried that at first, made the map folder url /PHPScripts/mapimages/nophoto.jpg
But i figured it would call from the BHD folder, hence why i used that path. OK, now im using the correct domain it works better too I used the Outpost not TIO site to upload files (TIO is a sub domain) Got the No Image to show, now just got to get the map images to show now. http://www.tiocoop.com/Content/pid=10.html |
#6
|
||
|
If you're on Linux, the file name needs to have the same case as the map name. Like MapName.bms is not the same as mapname.bms on Linux. If you make sure all the photos are lower case you can use this:
Code:
if(file_exists("./mapimages/".strtolower($Server['MissionFile']).".jpg")) { echo "<img src=\"./mapimages/".strtolower($Server['MissionFile']).".jpg" />"; } else { echo "<img src=\"./mapimages/nophoto.jpg\" />"; }
__________________
04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq |
#7
|
||
|
still no luck with map images.
i did notice though, line 2 of code: .".jpg" doesn't have the \ and breaks the coding if not added. But you had it in first post coding. PS Thanks for your help Scott, think i've had too much xmass cheer brain is still on holiday mod lol, |
#8
|
||
|
Sorry just got back from Christmas break... You're right, it should be:
Code:
if(file_exists("./mapimages/".strtolower($Server['MissionFile']).".jpg")) { echo "<img src=\"./mapimages/".strtolower($Server['MissionFile']).".jpg\" />"; } else { echo "<img src=\"./mapimages/nophoto.jpg\" />"; } If you need some more help I can ftp in and help you out.
__________________
04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq |
#9
|
||
|
Thank You very much Scott, everything is working spot on now.
To make it easy for others to upload map images i figured i would try your phUploader.php I changes the path from Uploads to mapimages, it works and uploads fine. Problems i have now is the error below and also the image uploaded changes it's name to 1432644.jpg Is the a way to keep it's original name when uploading? Code:
Warning: main(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/novaoutp/public_html/tiocoop.com/phUploader.php on line 198 Notice: Undefined index: submit in /home/novaoutp/public_html/tiocoop.com/phUploader.php on line 198 Code:
If(($_POST['submit']==true) AND ($password_form=="")) { |
#10
|
||
|
in phuploader.php set:
Code:
$random_name=true; Code:
$random_name=false; Code:
if(!empty($_POST['submit']) && $_POST['submit']==true && $password_form=="") {
__________________
04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq |
#11
|
||
|
TY again Scott
That got rid of the error. But.... When i add a password i get the errors Code:
Warning: main(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/novaoutp/public_html/tiocoop.com/phUploader.php on line 166 Notice: Undefined index: verify_password in /home/novaoutp/public_html/tiocoop.com/phUploader.php on line 166 Warning: main(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/novaoutp/public_html/tiocoop.com/phUploader.php on line 176 Notice: Undefined index: phUploader in /home/novaoutp/public_html/tiocoop.com/phUploader.php on line 176 Line 166 Code:
If($_POST['verify_password']==true) { Code:
If($_COOKIE['phUploader']!=$password_hash) { I think this is pretty cool, having the HeartBeat with stats and images and an easy way to upload the map images Thanks again Scott |
#12
|
||
|
Guess I should update my script at some point...
Line 166 Code:
If(!empty($_POST['verify_password']) && $_POST['verify_password']==true) { Code:
If(empty($_COOKIE['phUploader']) || $_COOKIE['phUploader']!=$password_hash) {
__________________
04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq |
#13
|
||
|
wow, everything is spot on now!
Thanks Scott |
#14
|
||
|
The phUploader kept taking the dot out of the file for the .bms
So the name would be test.bms.jpg but when it uploaded it is testbms.jpg I got around this by changing the status.php file from MissionFile to MissionName, i don't need to use the .bms extention now |
#15
|
||
|
That'll work as long as they are exact
__________________
04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq |
#16
|
||
|
Ok, i got one more question, if i may.
The map image i have set at 250px width How would i add, onclick of image to open at 800x600px. Thanks ~BLÃÐE~ |
#17
|
||
|
Hi Blade, it would look something like this:
Code:
if(file_exists("../mapimages/".$Server['MissionFile'].".jpg")) { echo "<a href=\"http://www.tiocoop.com/mapimages/".$Server['MissionFile'].".jpg\" target=\"_blank\"><img src=\"http://www.tiocoop.com/mapimages/".$Server['MissionFile'].".jpg\" width=\"500\" /></a>"; } else { echo "<img src=\"http://www.tiocoop.com/mapimages/nophoto.jpg\" />"; }
__________________
04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq |
#18
|
||
|
Thanks again Scott, i was close in my coding lol, can't believe i have forgotten the basic stuff not doing any coding for years.
Ok so i think i have finished doing everything i can to it now lol. |
#19
|
||
|
Glad you got it working, BTW how is the heartbeat working out for you guys? I see MANY more BHD servers using it now which is great and will really help keep the lobbies up and running for years (fyi it also reports data to novaworld.cc if novahq ever goes down). Keep spreading the word
__________________
04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq |
#20
|
||
|
Hi Scott, yeah we got about 7 servers up with HeartBeat in total with Mod and BHD/TS Servers (half the HB List lol)
Been trying to spread the word to whom ever we can... |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|