Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > TBDev > Mods & Themes
Reply
  #1  
Old 26th February 2013, 17:17
Chez's Avatar
Chez Chez is offline
Senior Member
 
Join Date: Sep 2011
P2P
Posts: 278
Default Countdown to event
First of all the credits go to - hellix - stonebreath - putyn


Put this is you sql database.

PHP Code:
CREATE TABLE `countdow` (
  `
monthtext NOT NULL,
  `
daytext NOT NULL,
  `
yearyear(4NOT NULL,
  `
countdowtext NOT NULL
ENGINE=MyISAM DEFAULT CHARSET=utf8
Now you name this cimage.php and put it in your root

PHP Code:
<?
require_once ("include/bittorrent.php");
dbconn();
$res mysql_query("SELECT month, day, year, countdow FROM countdow") or sqlerr(__FILE____LINE__);
if (
mysql_num_rows($res) == 0)
echo(
"<b>Countdown is empty</b>\n");
else
while (
$arr mysql_fetch_assoc($res))
{
$target mktime(0,0,0,$arr['month'],$arr['day'],$arr['year']);
$diff $target time();

$days = ($diff - ($diff 86400)) / 86400;
$diff $diff - ($days 86400);
$hours = ($diff - ($diff 3600)) / 3600;
$diff $diff - ($hours 3600);
$minutes = ($diff - ($diff 60)) / 60;
$diff $diff - ($minutes 60);
$seconds = ($diff - ($diff 1)) / 1;

header ("Content-type: image/png");
$imgname "pic/countdown.png";
$im = @imagecreatefrompng ($imgname);
$background_color imagecolorallocate ($im000);
$orange imagecolorallocate ($im25512736);
$yellow imagecolorallocate ($im247246201);

imagestring ($im2605$arr['countdow'], $yellow);
imagestring ($im36518"[ $days day(s) ] [ $hours hour(s) ] [ $minutes minute(s) ] [ $seconds second(s) ]"$orange);

imagepng ($im);
imagedestroy ($im);
} {
}
?>
Now this countdown.php also in your root.

PHP Code:
<?php
require_once ("include/bittorrent.php");
dbconn();
loggedinorreturn();
//referer();
if (get_user_class() < UC_SYSOPstderr("Error""Permission denied");

if (
$_SERVER["REQUEST_METHOD"] == "POST")
{
if (
$_POST["delete"])
mysql_query("DELETE FROM countdow");
header("Location: $BASEURL/countdown.php");

if (
$_POST["month"] == "" || $_POST["day"] == "" || $_POST["year"] == "" || $_POST["countdow"] == "")
stderr("Error""Missing form data.");

$month htmlspecialchars($_POST["month"]);
$day htmlspecialchars($_POST["day"]);
$year htmlspecialchars($_POST["year"]);
$countdow htmlspecialchars($_POST["countdow"]);
$sql "INSERT INTO countdow (month, day, year, countdow) VALUES ('$month', '$day', '$year', '$countdow')";
$result mysql_query($sql);
header("Location: $BASEURL/countdown.php");
die;
}
stdhead("Countdown");
$res mysql_query("SELECT month, day, year, countdow FROM countdow") or sqlerr(__FILE____LINE__);
if (
mysql_num_rows($res) == 0)
echo(
"<h1>Add countdown</h1>
<form method=post action=countdown.php>
<table border=1 width=95% cellspacing=0 cellpadding=5>
<tr><td class=rowhead>Month of the countdown</td><td><input type=text name=month size=5></td></tr>
<tr><td class=rowhead>Day of the countdown</td><td><input type=text name=day size=5></td></tr>
<tr><td class=rowhead>Year of the countdown</td><td><input type=text name=year size=10></td></tr>
<tr><td class=rowhead>Countdown to</td><td><input type=text name=countdow size=70></td></tr></select></td></tr><tr><td colspan=2 align=center><input type=submit class='groovybutton' value='Okay' class=btn></td></tr>
</table>
</form>\n"
);
else
{
while (
$arr mysql_fetch_assoc($res))
{
echo(
"<table border=1 cellspacing=0 width=95% cellpadding=5>\n");
echo(
"<tr><td align=left><b>Month</b></td><td align=left><b>Day</b></td><td align=left><b>Year</b></td><td align=left><b>Countdow to</b></td></tr>\n");
echo(
"<tr><td><font color=black>".htmlspecialchars($arr['month'])."</td><td><font color=black>".htmlspecialchars($arr['day'])."</td><td align=left><font color=black>".htmlspecialchars($arr['year'])."</font><td align=left><font color=black>".htmlspecialchars($arr['countdow'])."</font></font></font></td></tr>\n");
}
echo(
"</table><p></p>");
echo(
"<form method=post action=countdown.php><tr><td colspan=2 align=center><input type=submit name='delete' class='groovybutton' value='Delete'></td></tr>");
}
?>
<?php stdfoot
(); ?>
put this where you want it to show

PHP Code:
echo("<img src='cimage.php'>"); 
Finally put this image in your pic folder.

Click the image to open in full size.
__________________
http://www.bvlist.com/images/avatars/signaturepics/sigpic16443_2.gif

Last edited by Krypto; 4th August 2013 at 02:03. Reason: Removed Hot Linked Images from TorrentStrike
Reply With Quote
The Following User Says Thank You to Chez For This Useful Post:
ratza (4th August 2013)
  #2  
Old 4th August 2013, 01:48
ratza ratza is offline
Senior Member
 
Join Date: Jun 2009
P2P
Posts: 21
Default
what picture should we put ?the image you offered isn't there anymore :(


Thx for the mod
Reply With Quote
  #3  
Old 4th August 2013, 02:06
Krypto Krypto is offline
Retired from BVList
 
Join Date: Jan 2008
P2P
Posts: 510
Default
Nothing wrong with the image just Right Click and Save.

I've amended the Image Link and added it to another host as I don't appreciate images Hotlinked from TorrentStrike especially when I operate their servers.
Reply With Quote
  #4  
Old 4th August 2013, 14:23
Chez's Avatar
Chez Chez is offline
Senior Member
 
Join Date: Sep 2011
P2P
Posts: 278
Default
This is the only image that you need to put in PIC folder

Click the image to open in full size.
__________________
http://www.bvlist.com/images/avatars/signaturepics/sigpic16443_2.gif
Reply With Quote
The Following User Says Thank You to Chez For This Useful Post:
ratza (4th August 2013)
  #5  
Old 4th August 2013, 14:52
ratza ratza is offline
Senior Member
 
Join Date: Jun 2009
P2P
Posts: 21
Default
Click the image to open in full size.its showing broken image :( and i did all steps.Where i did wrong?
Reply With Quote
  #6  
Old 4th August 2013, 15:08
firefly007's Avatar
firefly007 firefly007 is offline
SUPPORT GURU
 
Join Date: Jun 2010
P2P
Posts: 721
Default
http://i.imgur.com/OHZl3to.png
__________________




Please Support Majority Report


You can contact me on Skype live:phesadent.elect but please let me know first.


If you are ever need me desperately then please email me at dan.oak44@gmail.com and I will contact u within a week.


Due to free time I'm able to help interested member's with their tracker.

Please Note!
Depending on your requests I will charge you for my assistance for Tracker installs and mods.
All my mods are custom and prices will very depending on the request.
I'm able to install any tracker and mods including themes.

Please PM me

Reply With Quote
  #7  
Old 4th August 2013, 15:25
ratza ratza is offline
Senior Member
 
Join Date: Jun 2009
P2P
Posts: 21
Default
yes i saw the image but is not showing in the script.Is showing broken image,bet is all there :)
Reply With Quote
  #8  
Old 5th August 2013, 03:51
Krypto Krypto is offline
Retired from BVList
 
Join Date: Jan 2008
P2P
Posts: 510
Default
1. Did you save the image to your pic folder?
2. Did you name the image as countdown.png ?
Reply With Quote
  #9  
Old 5th August 2013, 04:10
ratza ratza is offline
Senior Member
 
Join Date: Jun 2009
P2P
Posts: 21
Default
yes, even when i don't put any date in mysql is hsowing broken image
Reply With Quote
  #10  
Old 5th August 2013, 05:04
fireknight's Avatar
fireknight fireknight is offline
Administrator
 
Join Date: Aug 2010
Australia
Posts: 173
Default
If it is showing a broken image.
It means it cannot find the image, or the image does not exist.

You say you have renamed the image to - countdown.png
You have placed the image in your pic folder, in your root directory.
So the path to the image must be wrong, or just slightly of.

Code:
$imgname = "pic/countdown.png";
Check and see how other images paths are coded.
Reply With Quote
Reply

Tags
countdown , event

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +2. The time now is 01:09. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.