• » webSPELL.org - Free Content Management System
  • Language switch: English German
  • login



    » lost password?   » register now
  • About webSPELL

    webSPELL is a free Content Management System which was especially developed for the needs of esport related communities. Since a short while we are also offering an optimized and enhanced webSPELL version for the special requirements of non-profit organisations. The purpose of both systems is to offer a professional and free opportunity to create and administrate your own website in an easy and optimized way.

    » Learn more about webSPELL     » Download webSPELL now!
  • Advertisement

    Follow us

  • Sort:     printview
    Author
    Message
    webSPELL user
    232 Posts
    13.05.2012, 20:04 email offline quote 

    Hallo ich wollte fragen ob es möglich ist die Polls mit der Option Startzeit zu ergänzen. Das würde mir sehr helfen.

    Hier mal mein Code:
    Code:
    1.
    2.
    3.
    4.
    5.
    6.
    7.
    8.
    9.
    10.
    11.
    12.
    13.
    14.
    15.
    16.
    17.
    18.
    19.
    20.
    21.
    22.
    23.
    24.
    25.
    26.
    27.
    28.
    29.
    30.
    31.
    32.
    33.
    34.
    35.
    36.
    37.
    38.
    39.
    40.
    41.
    42.
    43.
    44.
    45.
    46.
    47.
    48.
    49.
    50.
    51.
    52.
    53.
    54.
    55.
    56.
    57.
    58.
    59.
    60.
    61.
    62.
    63.
    64.
    65.
    66.
    67.
    68.
    69.
    70.
    71.
    72.
    73.
    74.
    75.
    76.
    77.
    78.
    79.
    80.
    81.
    82.
    83.
    84.
    85.
    86.
    87.
    88.
    89.
    90.
    91.
    92.
    93.
    94.
    95.
    96.
    97.
    98.
    99.
    100.
    101.
    102.
    103.
    104.
    105.
    106.
    107.
    108.
    109.
    110.
    111.
    112.
    113.
    114.
    115.
    116.
    117.
    118.
    119.
    120.
    121.
    122.
    123.
    124.
    125.
    126.
    127.
    128.
    129.
    130.
    131.
    132.
    133.
    134.
    135.
    136.
    137.
    138.
    139.
    140.
    141.
    142.
    143.
    144.
    145.
    146.
    147.
    148.
    <?php
    /*
    ##########################################################################
    #                                                                        #
    #           Version 4       /                        /   /               #
    #          -----------__---/__---__------__----__---/---/-               #
    #           | /| /  /___) /   ) (_ `   /   ) /___) /   /                 #
    #          _|/_|/__(___ _(___/_(__)___/___/_(___ _/___/___               #
    #                       Free Content / Management System                 #
    #                                   /                                    #
    #                                                                        #
    #                                                                        #
    #   Copyright 2005-2010 by webspell.org                                  #
    #                                                                        #
    #   visit webSPELL.org, webspell.info to get webSPELL for free           #
    #   - Script runs under the GNU GENERAL PUBLIC LICENSE                   #
    #   - It's NOT allowed to remove this copyright-tag                      #
    #   -- http://www.fsf.org/licensing/licenses/gpl.html                    #
    #                                                                        #
    #   Code based on WebSPELL Clanpackage (Michael Gruber - webspell.at),   #
    #   Far Development by Development Team - webspell.org                   #
    #                                                                        #
    #   visit webspell.org                                                   #
    #                                                                        #
    ##########################################################################
    */

    $_language->read_module('polls');

    function vote($poll) {
         global $userID, $_language;
         $pagebg=PAGEBG;
         $border=BORDER;
         $bghead=BGHEAD;
         $bgcat=BGCAT;

         if($poll) $lastpoll = safe_query("SELECT * FROM ".PREFIX."poll WHERE aktiv='1' AND laufzeit>".time()." AND intern<=".isclanmember($userID)." and pollID='".$poll."' LIMIT 0,1");
         else {
              $num = mysql_num_rows(safe_query("SELECT * FROM ".PREFIX."poll WHERE aktiv='1' AND laufzeit>".time()." AND intern<=".isclanmember($userID).""));
              if($num) {
                   $start = rand(0,($num-1));
                   $lastpoll = safe_query("SELECT * FROM ".PREFIX."poll WHERE aktiv='1' AND laufzeit>".time()." AND intern<=".isclanmember($userID)." ORDER BY pollID DESC LIMIT ".$start.",".($start+1)."");
              }
              else {
                   include("armas.php");
                   return true;
              }
         }


         $anz = mysql_num_rows($lastpoll);
         $ds = mysql_fetch_array($lastpoll);
         if($anz) {

              $anz = mysql_num_rows(safe_query("SELECT pollID FROM `".PREFIX."poll` WHERE pollID='".$ds['pollID']."' AND hosts LIKE '%".$_SERVER['REMOTE_ADDR']."%' AND intern<=".isclanmember($userID).""));
              $anz_user = false;
              if($userID) {
                   $user_ids = explode(";", $ds['userIDs']);
                   if(in_array($userID, $user_ids)) $anz_user = true;
              }
              $cookie = false;
              if(isset($_COOKIE['poll'])) if($_COOKIE['poll'] == $ds['pollID']) $cookie = true;
              
              if($cookie or $anz or $anz_user) {

                   if($ds['intern'] == 1) $isintern = '('.$_language->module['intern'].')';
                    else $isintern = '';
               
                    $title = $ds['titel'];      

                   for ($n = 1; $n <= 10; $n++) {
                        if($ds['o'.$n]) $options[] = clearfromtags($ds['o'.$n]);
                   }

                   $votes = safe_query("SELECT * FROM ".PREFIX."poll_votes WHERE pollID='".$ds['pollID']."'");
                   $dv = mysql_fetch_array($votes);
                   $gesamtstimmen = $dv['o1'] + $dv['o2'] + $dv['o3'] + $dv['o4'] + $dv['o5'] + $dv['o6'] + $dv['o7'] + $dv['o8'] + $dv['o9'] + $dv['o10'];
                   
                   eval("\$poll_voted_head = \"".gettemplate("poll_voted_head")."\";");
                   echo $poll_voted_head;

                   $n=1;
                   $bg = BG_2;
                   foreach ($options as $option) {
                        $stimmen = $dv['o'.$n];
                        if ($gesamtstimmen) {
                             $perc = $stimmen / $gesamtstimmen * 10000;
                             settype($perc, "integer");
                             $perc = $perc/100;
                        }
                        else $perc = 0;
                        $picwidth = $perc;
                        settype($picwidth, "integer");
                        eval("\$poll_voted_content = \"".gettemplate("poll_voted_content")."\";");
                        echo $poll_voted_content;
                        $n++;
                   }

                   $anzcomments = getanzcomments($ds['pollID'], 'po');
                   $comments='<a href="index.php?site=polls&amp;pollID='.$ds['pollID'].'">['.$anzcomments.'] '.$_language->module['comments'].'</a>';
                   
                   eval("\$poll_voted_foot = \"".gettemplate("poll_voted_foot")."\";");
                   echo $poll_voted_foot;
                   
                   unset($options);
              }
              else {
                   
                    if($ds['intern'] == 1) $isintern = '('.$_language->module['intern'].')';
                    else $isintern = '';
                    $title = $ds['titel'];
                    $allowed_votes = $ds['votes'];
                   
                    eval("\$poll_head = \"".gettemplate("poll_head")."\";");
                   echo $poll_head;
                   
                   for ($n=1; $n<=10; $n++) {
                        if($ds['o'.$n]) $options[]=$ds['o'.$n];
                   }
                   $n=1;
                   foreach ($options as $option) {
                        $option=$option;
                        if($allowed_votes>1) {
                             
                             eval("\$poll_content_multiple = \"".gettemplate("poll_content_multiple")."\";");
                             echo $poll_content_multiple;
                             
                        } else {
                             
                             eval("\$poll_content = \"".gettemplate("poll_content")."\";");
                             echo $poll_content;
                             
                        }
                        $n++;
                   }
                   $pollID = $ds['pollID'];
                   eval("\$poll_foot = \"".gettemplate("poll_foot")."\";");
                   echo $poll_foot;
              }
         }
         else{
              include("armas.php");
         }
    }

    if(!isset($pollID)) $pollID = '';
    vote($pollID);
    ?>


    Mehr gibts eigendlich nicht zu sagen... kurz und knapp ^^
    Webspell 4.2.2a
    www.apb-clan.com
    webSPELL user
    232 Posts
    15.05.2012, 14:41 email offline quote 

    //push
    webSPELL user
    232 Posts
    19.05.2012, 14:17 email offline quote 

    DIESES Forum war auch mal hilfsbereiter unglücklich
    webSPELL newbie
    53 Posts
    19.05.2012, 22:05 email offline quote 

    Dieses Forum ist nach wie vor hilfsbereit, sofern du es mit genug info fütterst zwinkern

    Ripoli wrote:

    Hallo ich wollte fragen ob es möglich ist die Polls mit der Option Startzeit zu ergänzen. Das würde mir sehr helfen.


    wofür würde dir die Option "Startzeit" genau helfen?

    Website: http://ws442a.pytalhost.de
    Version: 4.2.2a
    ( nicht 4.4.2a zwinkern )
    webSPELL user
    232 Posts
    21.05.2012, 09:10 email offline quote 

    Die Option startzeit würde mir erhebliche organisatorische arbeit abnehmen. da wir darüber Member aufnahmen machen. Das heisst bei 10 Membern die alle an verschiedenen Tagen ihre Trailzeit um haben, muss man sich alles auf Papier aufschreiben. Wenn man aber direkt ne startzeit festlegen kann läuft das quasi automatisch ab.

    Zur Startzeit: Wenn ich dort 22.05.2012 14:00 Uhr eingeben würde, sollte das Voting an diesem tag um diese uhrzeit aktiv werden. und die endzeit steuert dann das Ende des Votings.


    wenn du noch mehr Infos brauchst kann ich sie gerne posten.
    webSPELL user
    232 Posts
    22.05.2012, 20:37 email offline quote 

    mhh eigendlich sind das ja alle Infos die man braucht, aber wieder tagelang keine hilfe.
    Administrator
    Member of webSPELL e.V.
    3068 Posts
    23.05.2012, 11:06 offline quote 

    Du scheinst auch keine hilfe zu suchen, bzw. dich selber überhaupt mal mit dem Code beschäftigt zu haben, sondern nach einer Komplettlösung.

    Code:
    1.
    if($poll) $lastpoll = safe_query("SELECT * FROM ".PREFIX."poll WHERE aktiv='1' AND laufzeit>".time()." AND intern<=".isclanmember($userID)." and pollID='".$poll."' LIMIT 0,1");


    Hier wird z.b. die Endzeit (laufzeit) abgefragt.

    Du musst also:
    1) Spalte "startzeit" zur PREFIX_poll tabelle hinzufügen
    2) beim hinzufügen/editieren von polls die Endzeit mit übergeben
    3) abfragen ob Poll bereits gestartet
    Sort:     printview


    To start or to reply to a topic you have to be registered and logged in!

    register now
    login
  • » Support

    » Topics
    22.05.2013 - 21:43 - 3 Replies
    » Slider Links Bitte um Hil...
    Slider Links Bitte um Hilfe
    Last post: bazic
    Board: DE - Allgemein
    22.05.2013 - 21:43
    22.05.2013 - 21:40 - 8 Replies
    » forum anzeige erweitern
    forum anzeige erweitern
    Last post: bazic
    Board: DE - Allgemeiner Support
    22.05.2013 - 21:40
    22.05.2013 - 21:28 - 464 Replies
    » Wettscript 2.1 for 4.2.3a...
    Wettscript 2.1 for 4.2.3a - Betscript
    Last post: Amokossi
    Board: DE - Fertige Skripte
    22.05.2013 - 21:28
    22.05.2013 - 20:27 - 6 Replies
    » When the update?
    When the update?
    Last post: Argu
    Board: EN - General
    22.05.2013 - 20:27
    22.05.2013 - 17:46 - 3 Replies
    » Admin login
    Admin login
    Last post: blackmoonstah
    Board: DE - Allgemeiner Support
    22.05.2013 - 17:46
    22.05.2013 - 17:28 - 1 Replies
    » Design Ausverkauf - alles...
    Design Ausverkauf - alles unter 70€
    Last post: Freestyler92
    Board: DE - Biete
    22.05.2013 - 17:28
    22.05.2013 - 14:54 - 2 Replies
    » adminlogin auf allypage f...
    adminlogin auf allypage funktioniert nicht mehr. bitte um hilfe
    Last post: blackmoonstah
    Board: DE - Technischer Support
    22.05.2013 - 14:54
    22.05.2013 - 14:41 - 4 Replies
    » Content laden
    Content laden
    Last post: bazic
    Board: DE - Anfragen
    22.05.2013 - 14:41
    22.05.2013 - 09:57 - 0 Replies
    » [4SALE] eSport Design/Tem...
    [4SALE] eSport Design/Template
    Last post: LeG3nDz
    Board: EN - Offers
    22.05.2013 - 09:57
    22.05.2013 - 09:24 - 1 Replies
    » Updatefunktion?
    Updatefunktion?
    Last post: Sysix
    Board: DE - Vorschläge
    22.05.2013 - 09:24
    22.05.2013 - 00:47 - 5 Replies
    » msql datenbank transfer
    msql datenbank transfer
    Last post: pgene
    Board: DE - Technischer Support
    22.05.2013 - 00:47
    22.05.2013 - 00:03 - 9 Replies
    » Mein Forum
    Mein Forum
    Last post: Lordy4007
    Board: DE - Fragen zur Seite
    22.05.2013 - 00:03
    21.05.2013 - 19:43 - 9 Replies
    » login startseite
    login startseite
    Last post: Argu
    Board: DE - Technischer Support
    21.05.2013 - 19:43
    21.05.2013 - 13:18 - 7 Replies
    » [Biete] Template Designs
    [Biete] Template Designs
    Last post: Marceld
    Board: DE - Biete
    21.05.2013 - 13:18
    21.05.2013 - 05:15 - 0 Replies
    » Need Designer for Logo/Te...
    Need Designer for Logo/Template
    Last post: Kody
    Board: EN - General
    21.05.2013 - 05:15
    21.05.2013 - 05:13 - 0 Replies
    » Looking for Designers/Cod...
    Looking for Designers/Coders (paid)
    Last post: Kody
    Board: EN - Requests
    21.05.2013 - 05:13
    20.05.2013 - 21:11 - 12 Replies
    » High Quality Website
    High Quality Website
    Last post: Dansjostedt
    Board: EN - Offers
    20.05.2013 - 21:11
    20.05.2013 - 18:27 - 4 Replies
    » [S] Tester für neuen Foru...
    [S] Tester für neuen ForumMod
    Last post: Argu
    Board: DE - Anfragen
    20.05.2013 - 18:27
    20.05.2013 - 11:47 - 5 Replies
    » Suche Designer GGL:Geld
    Suche Designer GGL:Geld
    Last post: Dynamic-Webmedia
    Board: DE - Suche
    20.05.2013 - 11:47
    20.05.2013 - 00:07 - 0 Replies
    » [S] Suche Programmierer
    [S] Suche Programmierer
    Last post: phoenix762
    Board: DE - Suche
    20.05.2013 - 00:07
    » Partners
    Bilderkiste.org Image Hosting
    k3rmit.org
    PascalMh.de


    » Blog
    28.03.2013 - derchris
    » Those damn spammers