הרשם שאלות ותשובות רשימת חברים לוח שנה חיפוש הודעות מהיום סמן פורומים כנקראו

   
|!|

 
 
כלים לאשכול תצורת הצגה
Prev הודעה קודמת   הודעה הבאה Next
ישן 18-06-06, 13:38   # 1
Homie
Permanently Banned
 
מיני פרופיל
תאריך הצטרפות: Oct 2005
גיל: 39
הודעות: 287

Homie לא מחובר  

Smile [PHP - שאלה] איך אפשר לגרום לטקסט לתמוך עברית ב-Countdown? פרטים בפנים!

שלום,

יש לי קובץ Countdown שהורדתי מהאינטרנט שסופר עד ארוע כלשהו.

תוכן הקובץ countdown.php:
PHP קוד:
<?
// Bizzar PHP GD Countdown Script
// Written by: Brad Derstine (Brad@BizzarScripts.net)

$month = 7; // Month of the countdown
$day = 1; // Day of the countdown
$year = 2004; // Year of the countdown

// mktime is the marked time, and time() is the current time.
$target = mktime(0,0,0,$month,$day,$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 = "hl2countdown.png";
$im = @imagecreatefrompng ($imgname);

//Here are some common color codes in case you want to change the colors.
//$white = imagecolorallocate ($im, 255, 255, 255);
//$blue = imagecolorallocate ($im, 0, 0, 255);
//$black = imagecolorallocate ($im,0,0,0);
//$gray = imagecolorallocate ($im,153,153,153);
//$red = imagecolorallocate ($im,255,0,0);
//$orange = imagecolorallocate ($im, 255, 127, 36);

$background_color = imagecolorallocate ($im, 0, 0, 0);
$orange = imagecolorallocate ($im, 255, 127, 36);
$yellow = imagecolorallocate ($im, 247, 246, 201);
imagestring ($im, 2, 60, 5,  " Countdown to Half Life 2 Release:     Available from www.hl2empire.com", $yellow);
imagestring ($im, 3, 65, 18,  "[ $days day(s) ] [ $hours hour(s) ] [ $minutes minute(s) ] [ $seconds second(s) ]", $orange);
imagepng ($im);
imagedestroy ($im);
?>
הוא מציג זמן עד ארוע כלשהו על תמונה (כמו החתימות המפורסמות של ה"היום הולדת ה? שלי יהיה בעוד ?? חודשים ?? ימים ?? דקות ו-?? שניות"

ויש לי את הקובץ gd.php סתם קובץ שיצרתי לכתיבת עברית פשוטה (לא על תמונה):
PHP קוד:
<?php
$font 
= imageloadfont('Arial.bmp');

$text = hebrevc($text); 
$fgColor ="black";
$fontWidth = imagefontwidth($font);
$fontHeight = imagefontheight($font);
$im = imagecreate(strlen($text) * $fontWidth, $fontHeight);
$bgColor = imagecolorallocate($im, 255, 255, 255);
$fgColor = imagecolorallocate($im,   0,   0, 255);
imagestring($im, $font, 0, 0, $text, $fgColor);
header('Content-Type: image/png');
imagepng($im);
imagedestroy($im);
?>
בקיצור, מה שאני רוצה לעשות זה:

אם אני כותב בקובץ הראשון בעברית - אז על התמונה רואים ג'יבריש. ובקובץ השני (gd.php) העברית מסודרת ואני רוצה לשלב את זה על הקובץ countdown.php כך שאני אכתוב בעברית יראו באמת עברית.

למה אני רוצה? פשוט מאוד, שמתי לב שהרבה אתרים שנותנים שירות "טיימר עד ליומהולדת" הם משתמשים בתמונה שכתבו בה בפוטושופ "היום הולדת שלי יחול בעוד....ו.......שניות" ואז הם מציגים על קטעים בתמונה פרמטרים של הזמנים. ולפי דעתי יותר נוח אם התמונה ריקה והכל מתבצעה ע"י ה-PHP. כך גם התמונה שוקלת פחות.

תודה מראש, תומר.
 
 

חברים פעילים הצופים באשכול זה: 1 (0 חברים ו- 1 אורחים)
 

כלים לאשכול
תצורת הצגה

חוקי פירסום
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 מופעל
סמיילים הם מופעל
[IMG] קוד מופעל
קוד HTML מכובה

קפיצה לפורום


כל הזמנים הם GMT +2. הזמן כעת הוא 23:07.

מופעל באמצעות VBulletin גרסה 3.8.6
כל הזכויות שמורות ©
כל הזכויות שמורות לסולל יבוא ורשתות (1997) בע"מ