Zurück   RR:Board > Webmaster > Webentwicklung

Web-Technik: ASP, PHP, XML, Javascript, AJAX, SQL Datenbanken. Webentwicklung: CMS, Foren, Blog -Scripte.
Antwort
 
Themen-Optionen Thema durchsuchen

[PHP] - Band Tour Script - Upcoming Shows / Past Shows sortieren
Alt 16.06.2012, 21:47   # 1
GenesisEX
Final Releaser
rot rot rot rot rot 
Bewertung:
GenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 Punkte
GenesisEX hat mehr als 5000 Punkte
Registriert seit: Jan 2006
Internet: DSL 6000
Beiträge: 1.760
Power: 26
Hallo liebe Community,

brauche wieder etwas hilfe. Habe folgendes Script runtergeladen http://sourceforge.net/projects/show...es/showlister/ und wollte fragen ob mir einer aushelfen kann. Beherrsche PHP kaum und würde gerne das er automatisch die Shows, in Past Shows einsortiert welche ein Tag nach dem Datum abgelaufen sind. Muss auch definieren was upcoming und pastshows sind, das programm stellt einfach alles dar. Muss noch einiges anpassen, aber den rest bekomm ich denke ich selbst hin.

Vllt. kennt auch einer ein script was besser geeignet ist?

Würde mich sehr über hilfe freuen!
  GenesisEX ist offline   Mit Zitat antworten

Alt 16.06.2012, 22:22   # 2
Decryptor
Psychopath
blau gruen gruen gruen blau
Bewertung:
Decryptor hat mehr als 25.000 PunkteDecryptor hat mehr als 25.000 PunkteDecryptor hat mehr als 25.000 PunkteDecryptor hat mehr als 25.000 PunkteDecryptor hat mehr als 25.000 PunkteDecryptor hat mehr als 25.000 PunkteDecryptor hat mehr als 25.000 PunkteDecryptor hat mehr als 25.000 PunkteDecryptor hat mehr als 25.000 PunkteDecryptor hat mehr als 25.000 Punkte
Decryptor hat mehr als 25.000 PunkteDecryptor hat mehr als 25.000 PunkteDecryptor hat mehr als 25.000 PunkteDecryptor hat mehr als 25.000 Punkte
Registriert seit: Sep 2005
Beiträge: 5.306
Power: 49
sample_shows_page_005.php all artists, by date [no old shows]

sollte doch eigentlich das sein was du suchst
  Decryptor ist offline   Mit Zitat antworten

AW: Band Tour Script - Upcoming Shows / Past Shows sortieren
Alt 17.06.2012, 03:09   # 3
GenesisEX
Final Releaser
rot rot rot rot rot 
Bewertung:
GenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 Punkte
GenesisEX hat mehr als 5000 Punkte
Registriert seit: Jan 2006
Internet: DSL 6000
Beiträge: 1.760
Power: 26
Themenstarter
Hmm bin ich wirklich so daemlich das ich es ubersehen habe, bin momentan nicht zuhause, werde es mir mal genauer anschauen, gabs da auch eine datei die nur diealten showsanzeigt?
  GenesisEX ist offline   Mit Zitat antworten

AW: Band Tour Script - Upcoming Shows / Past Shows sortieren
Alt 17.06.2012, 12:09   # 4
Decryptor
Psychopath
blau gruen gruen gruen blau
Bewertung:
Decryptor hat mehr als 25.000 PunkteDecryptor hat mehr als 25.000 PunkteDecryptor hat mehr als 25.000 PunkteDecryptor hat mehr als 25.000 PunkteDecryptor hat mehr als 25.000 PunkteDecryptor hat mehr als 25.000 PunkteDecryptor hat mehr als 25.000 PunkteDecryptor hat mehr als 25.000 PunkteDecryptor hat mehr als 25.000 PunkteDecryptor hat mehr als 25.000 Punkte
Decryptor hat mehr als 25.000 PunkteDecryptor hat mehr als 25.000 PunkteDecryptor hat mehr als 25.000 PunkteDecryptor hat mehr als 25.000 Punkte
Registriert seit: Sep 2005
Beiträge: 5.306
Power: 49
n e das nicht, sollte aber durch abändern und zusammen kopieren machbar sein
  Decryptor ist offline   Mit Zitat antworten

AW: Band Tour Script - Upcoming Shows / Past Shows sortieren
Alt 20.06.2012, 02:43   # 5
GenesisEX
Final Releaser
rot rot rot rot rot 
Bewertung:
GenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 Punkte
GenesisEX hat mehr als 5000 Punkte
Registriert seit: Jan 2006
Internet: DSL 6000
Beiträge: 1.760
Power: 26
Themenstarter
Habe es nach meinen Wünschen angepasst, ich danke dir nochmal.

Jetzt habe ich jedoch ein Problem, was ich seid 2 Stunden nicht behoben bekomme, wahrscheinlich habe ich nicht das auge für. Ich habe immer folgenden Fehler:



Eingetragen in der Datenbank ist der 22.09.2012, wird auch dargestellt, und plötzlich, ganz ohne sinn wird der juni dargestellt. Es wird gedoppelt, aber in der Datenbank gibts den 22. Juni nicht als eintrag. Selbst wenn man den eintrag auf 22.10 wechselt bleibt es in der falschen doppelten Anzeige beim Juni. Dies ist der 10. Show Eintrag in der DB, der 11. ist der falsche, der eig. nicht exisitert.

Schreibe extra alles auf, da ich echt keine ahnung habe wo der fehler entsteht.

Hier der Code

PHP-Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
  <head>
    <title>Shows</title>
    <link rel="stylesheet" type="text/css" href="showlister.css">
  <head>
  <body>

<?php



    
// read in the connection settings
    
require("showlister_settings.inc.php");
    require(
"showlister_methods.inc.php");

    
// connect to the RDBMS
    
$db mysql_connect("$site","$user","$pass"
        or 
die_now("<h2>Could not connect to database server</h2><p>Check passwords and sockets</p>");

    
// select the database
    
mysql_select_db("$database",$db
        or 
die_now("<h2>Could not select database $database</h2><p>Check database name</p>");

    
// select all the shows in the database
    
$result mysql_query("select show_id, month, day, year, location, details, venue
       from 
$database_table order by year, month, day",$db)
        or 
die_now("<h2>Could not select shows</h2>");

    
// set up the table        
    
echo("<div class='box'>\n<h3>Upcoming Shows</h3>\n</div>\n<div class='box'>\n");
    echo(
"<table border='0' width='80%'>\n");

    

    
// print the next five shows
    // thanks to Lee Mikles (lee@getcohesive.com) for contributing the 
    // first version of this code
      
$cur_month date("n");
      
$cur_day date("d");
      
$cur_year date("Y");
$event_count=1;

    
// echo out the next five shows
    
while(($row mysql_fetch_array($result)) and ($event_count <= 20)) {
      
$the_id $row["show_id"];
      
$the_month $row["month"];
      
$the_day $row["day"];
      
$the_year $row["year"];
      
$the_location $row["location"];
      
$the_details $row["details"];
      
$the_venue $row["venue"];

$monate = array(
=> "Jan",
    
=> "Feb",
    
=> "Mar",
    
=> "Apr",
    
=> "May",
    
=> "Jun",
    
=> "Jul",
    
=> "Aug",
    
=> "Sep",
    
10 => "Oct",
    
11 => "Nov",
    
12 => "Dec");
$tage = array(
=> "1st",
=> "2nd",
=> "3rd",
=> "4th",
=> "5th",
=> "6th",
=> "7th",
=> "8th",
=> "9th",
10 => "10th",
11 => "11th",
12 => "12th",
13 => "13th",
14 => "14th",
15 => "15th",
16 => "16th",
17 => "17th",
18 => "18th",
19 => "19th",
20 => "20th",
21 => "21st",
22 => "22nd",
23 => "23rd",
24 => "24th",
25 => "25th",
26 => "26th",
27 => "27th",
28 => "28th",
29 => "29th",
30 => "30th",
31 => "31st");
 
if ((
$the_year $cur_year)) {
        
// echo shows in current month, today and later


        
        
echo("\t\t<td bgolor='navy'>" "o" "$tage[$the_day]"&nbsp;" "$monate[$the_month]"&nbsp;" "$the_year"&nbsp;" "@" "&nbsp;" "<b>$the_venue"&nbsp;" "-" "&nbsp;" "$the_location</b>" "&nbsp;" "<i>with" "&nbsp;" "$the_details</i></td>\n");
$event_count++;

      }

 if ((
$the_month $cur_month) and ($the_year $cur_year)) {
        
// echo shows in current month, today and later

        
echo("\t<tr>\n");
        echo(
"\t\t<td bgolor='navy'>" "o" "$tage[$the_day]"&nbsp;" "$monate[$the_month]"&nbsp;" "$the_year"&nbsp;" "@" "&nbsp;" "<b>$the_venue"&nbsp;" "-" "&nbsp;" "$the_location</b>" "&nbsp;" "<i>with" "&nbsp;" "$the_details</i></td>\n");
$event_count++;

      }



      if ((
$the_month $cur_month) and ($the_day >= $cur_day) and ($the_year $cur_year)) {
        
// echo shows in current month, today and later


        
echo("\t<tr>\n");
        echo(
"\t\t<td bgolor='navy'>" "o" "$tage[$the_day]"&nbsp;" "$monate[$the_month]"&nbsp;" "$the_year"&nbsp;" "@" "&nbsp;" "<b>$the_venue"&nbsp;" "-" "&nbsp;" "$the_location</b>" "&nbsp;" "<i>with" "&nbsp;" "$the_details</i></td>\n");
$event_count++;

      }
}

    
// close the table
    
echo("\t</tr></table>\n</div>\n");



    
// select the database
    
mysql_select_db("$database",$db
        or 
die_now("<h2>Could not select database $database</h2><p>Check database name</p>");

    
// select all the shows in the database
    
$result mysql_query("select show_id, month, day, year, location, details, venue
       from 
$database_table order by year, month, day",$db)
        or 
die_now("<h2>Could not select shows</h2>");

    
// set up the table        
    
echo("<div class='box'>\n<h3>Past Shows</h3>\n</div>\n<div class='box'>\n");
    echo(
"<table border='0' width='80%'>\n");


    
// print the next five shows
    // thanks to Lee Mikles (lee@getcohesive.com) for contributing the 
    // first version of this code
      
$cur_month date("n");
      
$cur_day date("d");
      
$cur_year date("Y");
$event_count=1;

    
// echo out the next five shows
    
while(($row mysql_fetch_array($result)) and ($event_count <= 20)) {
      
$the_id $row["show_id"];
      
$the_month $row["month"];
      
$the_day $row["day"];
      
$the_year $row["year"];
      
$the_location $row["location"];
      
$the_details $row["details"];
      
$the_venue $row["venue"];


      if ((
$the_month <= $cur_month) and ($the_day $cur_day) and ($the_year <= $cur_year)) {
        
// echo shows in current month, today and later


        
echo("\t<tr>\n");
        echo(
"\t\t<td bgolor='navy'>" "o" "$tage[$the_day]"&nbsp;" "$monate[$the_month]"&nbsp;" "$the_year"&nbsp;" "@" "&nbsp;" "<b>$the_venue"&nbsp;" "-" "&nbsp;" "$the_location</b>" "&nbsp;" "<i>with" "&nbsp;" "$the_details</i></td>\n");
$event_count++;

      }
}

    
    
// close the table
    
echo("\t</tr></table>\n</div>\n");
?>

  </body>
</html>


Als .php bei xup:
http://www.xup.in/dl,15152966/tour.php/

Tut mir leid, falls es etwas schlampig ist, wie ich bereits sagte, habe ich nie php gelernt Kommentiert habe ich auch nicht, jedoch ist der code so klein, das die übersicht trotzdem vorhanden ist.

Was ich geändert habe:
-Darstellung in "Datum" @ "Location" - "Stadt" with "andere Bands"
-Datum in 1st/2nd/3rd/4th Jan/Feb/Mar/Apr 2012 abgeändert
-Upcoming Shows und Past Shows, automatische zuordnung
-Sortierung der Shows nach dem Datum, bei den Past Shows in umgekehrter Reihenfolge

Hört sich nach wenig an, aber ich saß meine 2 Std. da dran + die Fehler suche und hier und da paar kleine optimierungen ^^

Ich hoffe einer kann mir helfen. Verzweifle dadran, ist bestimmt was kleines/einfaches...

PS: Die Originaldatei
http://www.xup.in/dl,16525969/sample..._page_005.php/
  GenesisEX ist offline   Mit Zitat antworten

AW: Band Tour Script - Upcoming Shows / Past Shows sortieren
Alt 20.06.2012, 19:13   # 6
Decryptor
Psychopath
blau gruen gruen gruen blau
Bewertung:
Decryptor hat mehr als 25.000 PunkteDecryptor hat mehr als 25.000 PunkteDecryptor hat mehr als 25.000 PunkteDecryptor hat mehr als 25.000 PunkteDecryptor hat mehr als 25.000 PunkteDecryptor hat mehr als 25.000 PunkteDecryptor hat mehr als 25.000 PunkteDecryptor hat mehr als 25.000 PunkteDecryptor hat mehr als 25.000 PunkteDecryptor hat mehr als 25.000 Punkte
Decryptor hat mehr als 25.000 PunkteDecryptor hat mehr als 25.000 PunkteDecryptor hat mehr als 25.000 PunkteDecryptor hat mehr als 25.000 Punkte
Registriert seit: Sep 2005
Beiträge: 5.306
Power: 49

PHP-Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
  <head>
    <title>Shows</title>
    <link rel="stylesheet" type="text/css" href="showlister.css">
  <head>
  <body>

<?php



    
// read in the connection settings
    
require("showlister_settings.inc.php");
    require(
"showlister_methods.inc.php");

    
// connect to the RDBMS
    
$db mysql_connect("$site","$user","$pass"
        or 
die_now("<h2>Could not connect to database server</h2><p>Check passwords and sockets</p>");

    
// select the database
    
mysql_select_db("$database",$db
        or 
die_now("<h2>Could not select database $database</h2><p>Check database name</p>");

    
// select all the shows in the database
    
$result mysql_query("select show_id, month, day, year, location, details, venue
       from 
$database_table order by year, month, day",$db)
        or 
die_now("<h2>Could not select shows</h2>");

    
// set up the table        
    
echo("<div class='box'>\n<h3>Upcoming Shows</h3>\n</div>\n<div class='box'>\n");
    echo(
"<table border='0' width='80%'>\n");

    

    
// print the next five shows
    // thanks to Lee Mikles (lee@getcohesive.com) for contributing the 
    // first version of this code
      
$cur_month date("n");
      
$cur_day date("d");
      
$cur_year date("Y");
$event_count=1;

    
// echo out the next five shows
    
while(($row mysql_fetch_array($result)) and ($event_count <= 20)) {
      
$the_id $row["show_id"];
      
$the_month $row["month"];
      
$the_day $row["day"];
      
$the_year $row["year"];
      
$the_location $row["location"];
      
$the_details $row["details"];
      
$the_venue $row["venue"];

$monate = array(
=> "Jan",
    
=> "Feb",
    
=> "Mar",
    
=> "Apr",
    
=> "May",
    
=> "Jun",
    
=> "Jul",
    
=> "Aug",
    
=> "Sep",
    
10 => "Oct",
    
11 => "Nov",
    
12 => "Dec");
$tage = array(
=> "1st",
=> "2nd",
=> "3rd",
=> "4th",
=> "5th",
=> "6th",
=> "7th",
=> "8th",
=> "9th",
10 => "10th",
11 => "11th",
12 => "12th",
13 => "13th",
14 => "14th",
15 => "15th",
16 => "16th",
17 => "17th",
18 => "18th",
19 => "19th",
20 => "20th",
21 => "21st",
22 => "22nd",
23 => "23rd",
24 => "24th",
25 => "25th",
26 => "26th",
27 => "27th",
28 => "28th",
29 => "29th",
30 => "30th",
31 => "31st");
 
if ((
$the_year $cur_year)) {
        
// echo shows in current month, today and later


        
        
echo("\t\t<td bgolor='navy'>" "o" "$tage[$the_day]"&nbsp;" "$monate[$the_month]"&nbsp;" "$the_year"&nbsp;" "@" "&nbsp;" "<b>$the_venue"&nbsp;" "-" "&nbsp;" "$the_location</b>" "&nbsp;" "<i>with" "&nbsp;" "$the_details</i></td>\n");
$event_count++;

      }

 if ((
$the_month $cur_month) and ($the_year $cur_year)) {
        
// echo shows in current month, today and later

        
echo("\t<tr>\n");
        echo(
"\t\t<td bgolor='navy'>" "o" "$tage[$the_day]"&nbsp;" "$monate[$the_month]"&nbsp;" "$the_year"&nbsp;" "@" "&nbsp;" "<b>$the_venue"&nbsp;" "-" "&nbsp;" "$the_location</b>" "&nbsp;" "<i>with" "&nbsp;" "$the_details</i></td>\n");
$event_count++;

      }

}

    
// close the table
    
echo("\t</tr></table>\n</div>\n");



    
// select the database
    
mysql_select_db("$database",$db
        or 
die_now("<h2>Could not select database $database</h2><p>Check database name</p>");

    
// select all the shows in the database
    
$result mysql_query("select show_id, month, day, year, location, details, venue
       from 
$database_table order by year, month, day",$db)
        or 
die_now("<h2>Could not select shows</h2>");

    
// set up the table        
    
echo("<div class='box'>\n<h3>Past Shows</h3>\n</div>\n<div class='box'>\n");
    echo(
"<table border='0' width='80%'>\n");


    
// print the next five shows
    // thanks to Lee Mikles (lee@getcohesive.com) for contributing the 
    // first version of this code
      
$cur_month date("n");
      
$cur_day date("d");
      
$cur_year date("Y");
$event_count=1;

    
// echo out the next five shows
    
while(($row mysql_fetch_array($result)) and ($event_count <= 20)) {
      
$the_id $row["show_id"];
      
$the_month $row["month"];
      
$the_day $row["day"];
      
$the_year $row["year"];
      
$the_location $row["location"];
      
$the_details $row["details"];
      
$the_venue $row["venue"];


      if ((
$the_month <= $cur_month) and ($the_day $cur_day) and ($the_year <= $cur_year)) {
        
// echo shows in current month, today and later


        
echo("\t<tr>\n");
        echo(
"\t\t<td bgolor='navy'>" "o" "$tage[$the_day]"&nbsp;" "$monate[$the_month]"&nbsp;" "$the_year"&nbsp;" "@" "&nbsp;" "<b>$the_venue"&nbsp;" "-" "&nbsp;" "$the_location</b>" "&nbsp;" "<i>with" "&nbsp;" "$the_details</i></td>\n");
$event_count++;

      }
}

    
    
// close the table
    
echo("\t</tr></table>\n</div>\n");
?>

  </body>
</html>
  Decryptor ist offline   Mit Zitat antworten

AW: Band Tour Script - Upcoming Shows / Past Shows sortieren
Alt 26.09.2012, 08:34   # 7
GenesisEX
Final Releaser
rot rot rot rot rot 
Bewertung:
GenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 Punkte
GenesisEX hat mehr als 5000 Punkte
Registriert seit: Jan 2006
Internet: DSL 6000
Beiträge: 1.760
Power: 26
Themenstarter
So habe ein neues problem, will bei den upcoming shows ausgeben das keine mehr stattfinden (mit einem else) jedoch gibt der mir die anzahl der events die stattgefunden haben aus als "no upcoming shows". 11 Events in der letzten Zeit, sind die vorbei war vorher upcoming events leer jetzt habe ich ein else eingefügt und es wird mir 11 mal angezeigt "no upcoming shows".

Die frage ist wie beschränke ich die echo ausgabe auf einmal, so das es keinen loop für jedes event gibt.

Der Part vom code ist der hier:

PHP-Code:
      $cur_month date("n");
      
$cur_day date("d");
      
$cur_year date("Y");
$event_count=1;

    
// echo out the next five shows
    
while(($row mysql_fetch_array($result)) and ($event_count <= 20)) {
      
$the_id $row["show_id"];
      
$the_month $row["month"];
      
$the_day $row["day"];
      
$the_year $row["year"];
      
$the_location $row["location"];
      
$the_details $row["details"];
      
$the_venue $row["venue"];


if ((
$the_year $cur_year)) {
        
// echo shows in current month, today and later

        
        
echo("\t\t<td  style='border: none' bgolor='navy'>" "?" "$tage[$the_day]"&nbsp;" "$monate[$the_month]"&nbsp;" "$the_year"&nbsp;" "@" "&nbsp;" "<b>$the_venue"&nbsp;" "-" "&nbsp;" "$the_location</b>" "&nbsp;" "<i>with" "&nbsp;" "$the_details</i></td>\n");
$event_count++;

      }

 if ((
$the_month $cur_month) and ($the_year == $cur_year)) {
        
// echo shows in current month, today and later

        
echo("\t<tr>\n");
        echo(
"\t\t<td style='border: none'  bgolor='navy'>" "?" "$tage[$the_day]"&nbsp;" "$monate[$the_month]"&nbsp;" "$the_year"&nbsp;" "@" "&nbsp;" "<b>$the_venue"&nbsp;" "-" "&nbsp;" "$the_location</b>" "&nbsp;" "<i>with" "&nbsp;" "$the_details</i></td>\n");
$event_count++;

      }
if ((
$the_month == $cur_month) and ($the_day >= $cur_day) and ($the_year == $cur_year)) {
        
// echo shows in current month, today and later

        
echo("\t<tr>\n");
        echo(
"\t\t<td style='border: none'  bgolor='navy'>" "?" "$tage[$the_day]"&nbsp;" "$monate[$the_month]"&nbsp;" "$the_year"&nbsp;" "@" "&nbsp;" "<b>$the_venue"&nbsp;" "-" "&nbsp;" "$the_location</b>" "&nbsp;" "<i>with" "&nbsp;" "$the_details</i></td>\n");
$event_count++;

      }

else{
 echo(
"\t<tr>\n");
        echo(
"\t\t<td style='border: none'  bgolor='navy'>no upcoming shows</td>\n");
      
       

}

    
// close the table
echo("\t</table>\n");
    echo(
"\t</tr></table>\n</div>\n"); 
  GenesisEX ist offline   Mit Zitat antworten

AW: Band Tour Script - Upcoming Shows / Past Shows sortieren
Alt 26.09.2012, 10:37   # 8
BlueSin
Einer geht noch!
rot
Bewertung:
BlueSin hat 2500 bis 5000 PunkteBlueSin hat 2500 bis 5000 PunkteBlueSin hat 2500 bis 5000 PunkteBlueSin hat 2500 bis 5000 PunkteBlueSin hat 2500 bis 5000 PunkteBlueSin hat 2500 bis 5000 PunkteBlueSin hat 2500 bis 5000 PunkteBlueSin hat 2500 bis 5000 PunkteBlueSin hat 2500 bis 5000 PunkteBlueSin hat 2500 bis 5000 Punkte
Registriert seit: Jun 2012
Internet: DSL2 32K
Beiträge: 250
Power: 4
Ich würde einfach einen "boolean" einbauen.
Code:
// echo out the next five shows $show = false; while(($row = mysql_fetch_array($result)) and ($event_count <= 20)) { // Hier steht anderer Code else { if(!$show) { $show = true; echo("\t<tr>\n"); echo("\t\t<td style='border: none' bgolor='navy'>no upcoming shows</td>\n"); } }
  BlueSin ist offline   Mit Zitat antworten

AW: Band Tour Script - Upcoming Shows / Past Shows sortieren
Alt 26.09.2012, 14:14   # 9
Murdoc
Moderator
team
Bewertung:
Murdoc hat mehr als 25.000 PunkteMurdoc hat mehr als 25.000 PunkteMurdoc hat mehr als 25.000 PunkteMurdoc hat mehr als 25.000 PunkteMurdoc hat mehr als 25.000 PunkteMurdoc hat mehr als 25.000 PunkteMurdoc hat mehr als 25.000 PunkteMurdoc hat mehr als 25.000 PunkteMurdoc hat mehr als 25.000 PunkteMurdoc hat mehr als 25.000 Punkte
Murdoc hat mehr als 25.000 PunkteMurdoc hat mehr als 25.000 PunkteMurdoc hat mehr als 25.000 PunkteMurdoc hat mehr als 25.000 Punkte
Registriert seit: Nov 2006
Internet: DSL2 16K
Beiträge: 6.161
Power: 51
Zitat:
Zitat von BlueSin Beitrag anzeigen
Ich würde einfach einen "boolean" einbauen.
Achtung, der Code wird in der Zukunft anders arbeiten als du erwartest, denn

Code:
for() {} else {} while() else {} foreach() {} else {}
wird in der Zukunft valide Syntax sein.
https://wiki.php.net/rfc/loop_else

Daher lieber gleich richtig:
PHP-Code:
if ($result && mysql_num_rows($result) > && $event_count <= 20) {
  while (
$row mysql_fetch_array($result)) {

  
// Hier steht anderer Code

  
}
} else {
  echo 
"no upcoming shows\n";      


MfG Murdoc

Meins: http://murdoc.eu

Geändert von Murdoc (26.09.2012 um 14:43 Uhr).
  Murdoc ist offline   Mit Zitat antworten

AW: Band Tour Script - Upcoming Shows / Past Shows sortieren
Alt 26.09.2012, 15:15   # 10
BlueSin
Einer geht noch!
rot
Bewertung:
BlueSin hat 2500 bis 5000 PunkteBlueSin hat 2500 bis 5000 PunkteBlueSin hat 2500 bis 5000 PunkteBlueSin hat 2500 bis 5000 PunkteBlueSin hat 2500 bis 5000 PunkteBlueSin hat 2500 bis 5000 PunkteBlueSin hat 2500 bis 5000 PunkteBlueSin hat 2500 bis 5000 PunkteBlueSin hat 2500 bis 5000 PunkteBlueSin hat 2500 bis 5000 Punkte
Registriert seit: Jun 2012
Internet: DSL2 32K
Beiträge: 250
Power: 4
Zitat:
Zitat von Murdoc Beitrag anzeigen
Achtung, der Code wird in der Zukunft anders arbeiten als du erwartest, denn

Code:
for() {} else {} while() else {} foreach() {} else {}
wird in der Zukunft valide Syntax sein.
Die "else" bezieht sich doch nicht auf die "while".

Der Aufbau schaut ungefähr so aus.
PHP-Code:
$show false;
while((
$row mysql_fetch_array($result)) and ($event_count <= 20))
{
  if(
$the_month == $cur_month) and ($the_day >= $cur_day) and ($the_year == $cur_year)
  {
    
//Show gefunden/ausgeben script
  
}
  else
  {
    if(!
$show)
    {
      
$show true;
      echo(
"\t<tr>\n");
      echo(
"\t\t<td style='border: none'  bgolor='navy'>no upcoming shows</td>\n");      
    }
  }

Aber deine Lösung ist eleganter und sieht "schöner" aus
  BlueSin ist offline   Mit Zitat antworten

AW: Band Tour Script - Upcoming Shows / Past Shows sortieren
Alt 26.09.2012, 19:35   # 11
GenesisEX
Final Releaser
rot rot rot rot rot 
Bewertung:
GenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 Punkte
GenesisEX hat mehr als 5000 Punkte
Registriert seit: Jan 2006
Internet: DSL 6000
Beiträge: 1.760
Power: 26
Themenstarter
PHP-Code:

      $cur_month 
date("n");
      
$cur_day date("d");
      
$cur_year date("Y");
$event_count=1;

    
// echo out the next five shows
      
$the_id $row["show_id"];
      
$the_month $row["month"];
      
$the_day $row["day"];
      
$the_year $row["year"];
      
$the_location $row["location"];
      
$the_details $row["details"];
      
$the_venue $row["venue"];

if (
$result && mysql_num_rows($result) > && $event_count <= 20) {
  while (
$row mysql_fetch_array($result)) {

if ((
$the_year $cur_year)) {
        
// echo shows in current month, today and later

        
        
echo("\t\t<td  style='border: none' bgolor='navy'>" "᛫" "$tage[$the_day]"&nbsp;" "$monate[$the_month]"&nbsp;" "$the_year"&nbsp;" "@" "&nbsp;" "<b>$the_venue"&nbsp;" "-" "&nbsp;" "$the_location</b>" "&nbsp;" "<i>with" "&nbsp;" "$the_details</i></td>\n");
$event_count++;

      }

 if ((
$the_month $cur_month) and ($the_year == $cur_year)) {
        
// echo shows in current month, today and later

        
echo("\t<tr>\n");
        echo(
"\t\t<td style='border: none'  bgolor='navy'>" "᛫" "$tage[$the_day]"&nbsp;" "$monate[$the_month]"&nbsp;" "$the_year"&nbsp;" "@" "&nbsp;" "<b>$the_venue"&nbsp;" "-" "&nbsp;" "$the_location</b>" "&nbsp;" "<i>with" "&nbsp;" "$the_details</i></td>\n");
$event_count++;

      }
if ((
$the_month == $cur_month) and ($the_day >= $cur_day) and ($the_year == $cur_year)) {
        
// echo shows in current month, today and later

        
echo("\t<tr>\n");
        echo(
"\t\t<td style='border: none'  bgolor='navy'>" "᛫" "$tage[$the_day]"&nbsp;" "$monate[$the_month]"&nbsp;" "$the_year"&nbsp;" "@" "&nbsp;" "<b>$the_venue"&nbsp;" "-" "&nbsp;" "$the_location</b>" "&nbsp;" "<i>with" "&nbsp;" "$the_details</i></td>\n");
$event_count++;

  }
} else {
echo(
"\t<tr>\n");
        echo(
"\t\t<td style='border: none'  bgolor='navy'>no upcoming shows</td>\n");
      


Sieht so aus, ich bekomme nur einen weißen Bildschirm, weiß leider nicht woran es liegt...
  GenesisEX ist offline   Mit Zitat antworten

AW: Band Tour Script - Upcoming Shows / Past Shows sortieren
Alt 27.09.2012, 07:01   # 12
theQuest
Final Releaser
rot rot rot rot rot 
Bewertung:
theQuest hat 400 bis 499 PunktetheQuest hat 400 bis 499 PunktetheQuest hat 400 bis 499 PunktetheQuest hat 400 bis 499 Punkte
Registriert seit: Mar 2005
Internet: Modem/ISDN
Beiträge: 1.860
Power: 29
Zitat:
Zitat von Murdoc Beitrag anzeigen
Achtung, der Code wird in der Zukunft anders arbeiten als du erwartest, denn

Code:
for() {} else {} while() else {} foreach() {} else {}
wird in der Zukunft valide Syntax sein.
https://wiki.php.net/rfc/loop_else

Daher lieber gleich richtig:
PHP-Code:
if ($result && mysql_num_rows($result) > && $event_count <= 20) {
  while (
$row mysql_fetch_array($result)) {

  
// Hier steht anderer Code

  
}
} else {
  echo 
"no upcoming shows\n";      

Sehr optimistisch gedacht. Die Neuerrungen, so gut sie auch sind, werden erst in zwei bis drei Jahren wirklich Verbreitung finden (leider).

Doch der Genitiv des sächlichen Demonstrativpronomens
"dieses" und der des männlichen Demonstrativpronomens
"dieser" lautet in beiden Fällen "dieses".
  theQuest ist offline   Mit Zitat antworten

AW: Band Tour Script - Upcoming Shows / Past Shows sortieren
Alt 27.09.2012, 08:23   # 13
BlueSin
Einer geht noch!
rot
Bewertung:
BlueSin hat 2500 bis 5000 PunkteBlueSin hat 2500 bis 5000 PunkteBlueSin hat 2500 bis 5000 PunkteBlueSin hat 2500 bis 5000 PunkteBlueSin hat 2500 bis 5000 PunkteBlueSin hat 2500 bis 5000 PunkteBlueSin hat 2500 bis 5000 PunkteBlueSin hat 2500 bis 5000 PunkteBlueSin hat 2500 bis 5000 PunkteBlueSin hat 2500 bis 5000 Punkte
Registriert seit: Jun 2012
Internet: DSL2 32K
Beiträge: 250
Power: 4
Zitat:
Zitat von GenesisEX Beitrag anzeigen
Sieht so aus, ich bekomme nur einen weißen Bildschirm, weiß leider nicht woran es liegt...
Vll. solltest du den Quellcode mal formatieren, damit man ihn "lesen" kann

Dann fällt sofort auf, dass eine Klammer fehlt.
das "else" nach dem "while" gibt es noch NICHT!

PHP-Code:
if ($result && mysql_num_rows($result) > && $event_count <= 20)

    while (
$row mysql_fetch_array($result))
    {
        if ((
$the_year $cur_year))
        { 
            
// echo shows in current month, today and later 
            
echo("\t\t<td  style='border: none' bgolor='navy'>" "᛫" 
                
"$tage[$the_day]"&nbsp;" "$monate[$the_month]
                
"&nbsp;" "$the_year"&nbsp;" "@" "&nbsp;" 
                
"<b>$the_venue"&nbsp;" "-" "&nbsp;" 
                
"$the_location</b>" "&nbsp;" "<i>with" "&nbsp;" 
                
"$the_details</i></td>\n"); 
            
$event_count++; 
        } 
        
        if ((
$the_month $cur_month) and ($the_year == $cur_year))
        { 
            
// echo shows in current month, today and later
            
echo("\t<tr>\n"); 
            echo(
"\t\t<td style='border: none'  bgolor='navy'>" "᛫" 
                
"$tage[$the_day]"&nbsp;" "$monate[$the_month]
                
"&nbsp;" "$the_year"&nbsp;" "@" "&nbsp;" 
                
"<b>$the_venue"&nbsp;" "-" "&nbsp;" 
                
"$the_location</b>" "&nbsp;" "<i>with" "&nbsp;" 
                
"$the_details</i></td>\n"); 
            
$event_count++;
        }
      
        if ((
$the_month == $cur_month) and ($the_day >= $cur_day) and ($the_year == $cur_year))
        { 
            
// echo shows in current month, today and later
            
echo("\t<tr>\n"); 
            echo(
"\t\t<td style='border: none'  bgolor='navy'>" "᛫" 
                
"$tage[$the_day]"&nbsp;" "$monate[$the_month]
                
"&nbsp;" "$the_year"&nbsp;" "@" "&nbsp;" 
                
"<b>$the_venue"&nbsp;" "-" "&nbsp;" 
                
"$the_location</b>" "&nbsp;" "<i>with" "&nbsp;" 
                
"$the_details</i></td>\n"); 
            
$event_count++;
        } 
    }
}
else

    echo(
"\t<tr>\n"); 
    echo(
"\t\t<td style='border: none'  bgolor='navy'>no upcoming shows</td>\n"); 

  BlueSin ist offline   Mit Zitat antworten

AW: Band Tour Script - Upcoming Shows / Past Shows sortieren
Alt 27.09.2012, 12:22   # 14
GenesisEX
Final Releaser
rot rot rot rot rot 
Bewertung:
GenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 Punkte
GenesisEX hat mehr als 5000 Punkte
Registriert seit: Jan 2006
Internet: DSL 6000
Beiträge: 1.760
Power: 26
Themenstarter
Der gibt einfach nichts aus wie vorher, als würde er das else ignorieren. Habe etwas rumexperementiert, aber bin leider nicht auf eine lösung gekommen.

PS: mit deinem script geht es bluesin. ( $show = false; )

edit:
doch nicht, wenn man eine show hinzufügt bleibt das "no upcoming shows" bestehen und verschwindet nicht.

Geändert von GenesisEX (27.09.2012 um 12:26 Uhr).
  GenesisEX ist offline   Mit Zitat antworten

AW: Band Tour Script - Upcoming Shows / Past Shows sortieren
Alt 27.09.2012, 12:47   # 15
BlueSin
Einer geht noch!
rot
Bewertung:
BlueSin hat 2500 bis 5000 PunkteBlueSin hat 2500 bis 5000 PunkteBlueSin hat 2500 bis 5000 PunkteBlueSin hat 2500 bis 5000 PunkteBlueSin hat 2500 bis 5000 PunkteBlueSin hat 2500 bis 5000 PunkteBlueSin hat 2500 bis 5000 PunkteBlueSin hat 2500 bis 5000 PunkteBlueSin hat 2500 bis 5000 PunkteBlueSin hat 2500 bis 5000 Punkte
Registriert seit: Jun 2012
Internet: DSL2 32K
Beiträge: 250
Power: 4
Versuch mal das Script:
PHP-Code:
$show false;
while((
$row mysql_fetch_array($result)) and ($event_count <= 20))
{
  if(
$the_month == $cur_month) and ($the_day >= $cur_day) and ($the_year == $cur_year)
  {
    
//Show gefunden/ausgeben script
    
$show true;
  }
  else
  {
    if(!
$show)
    {
      
$show true;
      echo(
"\t<tr>\n");
      echo(
"\t\t<td style='border: none'  bgolor='navy'>no upcoming shows</td>\n");      
    }
  }

  BlueSin ist offline   Mit Zitat antworten

AW: Band Tour Script - Upcoming Shows / Past Shows sortieren
Alt 27.09.2012, 15:18   # 16
GenesisEX
Final Releaser
rot rot rot rot rot 
Bewertung:
GenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 Punkte
GenesisEX hat mehr als 5000 Punkte
Registriert seit: Jan 2006
Internet: DSL 6000
Beiträge: 1.760
Power: 26
Themenstarter
bleibt gleich, no upcoming shows steht da, obwohl es eine show gibt die noch stattfinden wird.
  GenesisEX ist offline   Mit Zitat antworten

AW: Band Tour Script - Upcoming Shows / Past Shows sortieren
Alt 27.09.2012, 15:49   # 17
BlueSin
Einer geht noch!
rot
Bewertung:
BlueSin hat 2500 bis 5000 PunkteBlueSin hat 2500 bis 5000 PunkteBlueSin hat 2500 bis 5000 PunkteBlueSin hat 2500 bis 5000 PunkteBlueSin hat 2500 bis 5000 PunkteBlueSin hat 2500 bis 5000 PunkteBlueSin hat 2500 bis 5000 PunkteBlueSin hat 2500 bis 5000 PunkteBlueSin hat 2500 bis 5000 PunkteBlueSin hat 2500 bis 5000 Punkte
Registriert seit: Jun 2012
Internet: DSL2 32K
Beiträge: 250
Power: 4
Wird die Show den angezeigt, welche noch ansteht?
  BlueSin ist offline   Mit Zitat antworten

AW: Band Tour Script - Upcoming Shows / Past Shows sortieren
Alt 27.09.2012, 17:27   # 18
GenesisEX
Final Releaser
rot rot rot rot rot 
Bewertung:
GenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 PunkteGenesisEX hat mehr als 5000 Punkte
GenesisEX hat mehr als 5000 Punkte
Registriert seit: Jan 2006
Internet: DSL 6000
Beiträge: 1.760
Power: 26
Themenstarter
Jap, die steht da auch noch inklusiv no upcoming shows
  GenesisEX ist offline   Mit Zitat antworten
Antwort

RR:Board > Webmaster > Webentwicklung > [PHP] - Band Tour Script - Upcoming Shows / Past Shows sortieren


Forumregeln
Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir erlaubt, Anhänge anzufügen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

vB Code ist An.
Smileys sind An.
[IMG] Code ist An.
HTML-Code ist Aus.

Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
Ähnliche Reality-Shows ? Fedja Kino, Filme, Tv 4 24.06.2012 13:20
Japanische Game shows DerGärtner Humor & Fun 0 30.07.2008 16:47
9live gründet neue shows ^^ Jimmy-D Humor & Fun 5 19.01.2008 12:27
Wie findet ihr Casting Shows?! chryzzle Musik und Musiker 95 08.08.2007 23:52
Tuning-Shows wo? leinad01 Auto und Motorrad 9 23.04.2006 21:26



Alle Zeitangaben in WEZ +1. Es ist jetzt 20:31 Uhr.
vBulletin Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.