• » 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:      1 2  » printview


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

    register now
    login
    Author
    Message
    webSPELL newbie
    69 Posts
    26.04.2012, 11:42 email offline quote 

    BlueaKaKev wrote:

    melde dich mal im IRC.

    -> http://www.webspell.org/index.php?site=irc


    oki,
    ich glaub ich bin dort drin.
    Rechts stehen zumindest einige nicks ^^
    Moderator
    1708 Posts
    26.04.2012, 11:36 online quote 

    webSPELL newbie
    69 Posts
    26.04.2012, 11:30 email offline quote 

    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.
    149.
    150.
    151.
    152.
    153.
    154.
    155.
    156.
    157.
    158.
    159.
    160.
    161.
    162.
    163.
    164.
    165.
    166.
    167.
    168.
    169.
    170.
    171.
    172.
    173.
    174.
    175.
    176.
    177.
    178.
    179.
    180.
    181.
    182.
    183.
    184.
    185.
    186.
    187.
    188.
    189.
    190.
    191.
    192.
    193.
    194.
    195.
    196.
    197.
    198.
    199.
    200.
    201.
    202.
    203.
    204.
    205.
    206.
    207.
    208.
    209.
    210.
    211.
    212.
    213.
    214.
    215.
    216.
    217.
    218.
    219.
    220.
    221.
    222.
    223.
    224.
    225.
    226.
    227.
    228.
    229.
    230.
    231.
    232.
    233.
    234.
    235.
    236.
    237.
    238.
    239.
    240.
    241.
    242.
    243.
    244.
    245.
    246.
    247.
    248.
    249.
    250.
    251.
    252.
    253.
    254.
    255.
    256.
    257.
    258.
    259.
    260.
    261.
    262.
    263.
    264.
    265.
    266.
    267.
    268.
    269.
    270.
    271.
    272.
    273.
    274.
    275.
    276.
    277.
    278.
    279.
    280.
    281.
    282.
    283.
    284.
    285.
    286.
    287.
    288.
    289.
    290.
    291.
    292.
    293.
    294.
    295.
    296.
    297.
    298.
    299.
    300.
    301.
    302.
    303.
    304.
    305.
    306.
    307.
    308.
    309.
    310.
    311.
    312.
    313.
    314.
    315.
    316.
    317.
    318.
    319.
    320.
    321.
    322.
    323.
    324.
    325.
    326.
    327.
    328.
    329.
    330.
    331.
    332.
    333.
    334.
    335.
    336.
    337.
    338.
    339.
    340.
    341.
    342.
    343.
    344.
    345.
    346.
    347.
    348.
    349.
    350.
    351.
    352.
    353.
    354.
    355.
    356.
    357.
    358.
    359.
    360.
    361.
    362.
    363.
    364.
    365.
    366.
    367.
    368.
    369.
    370.
    371.
    372.
    373.
    374.
    375.
    376.
    377.
    378.
    379.
    380.
    381.
    382.
    383.
    384.
    385.
    386.
    387.
    388.
    389.
    390.
    391.
    392.
    393.
    394.
    395.
    396.
    397.
    398.
    399.
    400.
    401.
    402.
    403.
    404.
    405.
    406.
    407.
    408.
    409.
    410.
    411.
    412.
    413.
    414.
    415.
    416.
    417.
    418.
    419.
    420.
    421.
    422.
    423.
    424.
    425.
    426.
    427.
    428.
    429.
    430.
    431.
    432.
    433.
    434.
    435.
    436.
    437.
    438.
    439.
    440.
    441.
    442.
    443.
    444.
    445.
    446.
    447.
    448.
    449.
    450.
    451.
    452.
    453.
    454.
    455.
    456.
    457.
    458.
    459.
    460.
    461.
    462.
    463.
    464.
    465.
    466.
    467.
    468.
    469.
    470.
    471.
    472.
    473.
    474.
    475.
    476.
    477.
    478.
    479.
    480.
    481.
    482.
    483.
    484.
    485.
    486.
    487.
    488.
    489.
    490.
    491.
    492.
    493.
    494.
    495.
    496.
    497.
    498.
    499.
    500.
    501.
    502.
    503.
    504.
    505.
    506.
    507.
    508.
    509.
    510.
    511.
    512.
    513.
    514.
    515.
    516.
    517.
    518.
    519.
    520.
    521.
    522.
    523.
    524.
    525.
    526.
    527.
    528.
    529.
    530.
    531.
    532.
    533.
    534.
    535.
    536.
    537.
    538.
    539.
    540.
    541.
    542.
    543.
    544.
    545.
    546.
    547.
    548.
    549.
    550.
    551.
    552.
    553.
    554.
    555.
    556.
    557.
    558.
    559.
    560.
    561.
    562.
    563.
    564.
    565.
    566.
    567.
    568.
    569.
    570.
    571.
    572.
    573.
    574.
    575.
    576.
    577.
    578.
    579.
    580.
    581.
    582.
    583.
    584.
    585.
    586.
    587.
    588.
    589.
    590.
    591.
    592.
    593.
    594.
    595.
    596.
    597.
    598.
    599.
    600.
    601.
    602.
    603.
    604.
    605.
    606.
    607.
    608.
    609.
    610.
    611.
    612.
    613.
    614.
    615.
    616.
    617.
    618.
    619.
    620.
    621.
    622.
    623.
    624.
    625.
    626.
    627.
    628.
    629.
    630.
    631.
    632.
    633.
    634.
    635.
    636.
    637.
    638.
    639.
    640.
    641.
    642.
    643.
    644.
    645.
    646.
    647.
    648.
    649.
    650.
    651.
    652.
    653.
    654.
    655.
    656.
    657.
    658.
    659.
    660.
    661.
    662.
    663.
    664.
    665.
    666.
    667.
    668.
    669.
    670.
    671.
    672.
    673.
    674.
    675.
    676.
    677.
    678.
    679.
    680.
    681.
    682.
    683.
    684.
    685.
    686.
    687.
    688.
    689.
    690.
    691.
    692.
    693.
    694.
    695.
    696.
    697.
    698.
    699.
    700.
    701.
    702.
    703.
    704.
    705.
    706.
    707.
    708.
    709.
    710.
    711.
    712.
    713.
    714.
    715.
    716.
    717.
    718.
    719.
    720.
    721.
    722.
    723.
    724.
    725.
    726.
    727.
    728.
    729.
    730.
    731.
    732.
    733.
    734.
    735.
    736.
    737.
    738.
    739.
    740.
    741.
    742.
    743.
    744.
    745.
    746.
    747.
    748.
    749.
    750.
    751.
    752.
    753.
    754.
    755.
    756.
    757.
    758.
    759.
    760.
    761.
    762.
    763.
    764.
    765.
    766.
    767.
    768.
    769.
    770.
    771.
    772.
    773.
    774.
    775.
    776.
    777.
    778.
    779.
    780.
    781.
    782.
    783.
    784.
    785.
    786.
    787.
    788.
    789.
    790.
    791.
    792.
    793.
    794.
    795.
    796.
    797.
    798.
    799.
    800.
    801.
    802.
    803.
    804.
    805.
    806.
    807.
    808.
    809.
    810.
    811.
    812.
    813.
    814.
    815.
    816.
    817.
    818.
    819.
    820.
    821.
    822.
    823.
    824.
    825.
    826.
    827.
    828.
    829.
    830.
    831.
    832.
    833.
    834.
    835.
    836.
    837.
    838.
    839.
    840.
    841.
    842.
    843.
    844.
    845.
    846.
    847.
    848.
    849.
    850.
    851.
    852.
    853.
    854.
    855.
    856.
    857.
    858.
    859.
    860.
    861.
    862.
    863.
    864.
    865.
    866.
    867.
    868.
    869.
    870.
    871.
    872.
    873.
    874.
    875.
    876.
    877.
    878.
    879.
    880.
    881.
    882.
    883.
    884.
    885.
    886.
    887.
    888.
    889.
    890.
    891.
    892.
    893.
    894.
    895.
    896.
    897.
    898.
    899.
    900.
    901.
    902.
    903.
    904.
    905.
    906.
    907.
    908.
    909.
    910.
    <?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                                                   #
    #                                                                        #
    ##########################################################################
    */


    if(isset($_GET['action'])) $action = $_GET['action'];
    else $action = '';

    if($action=="save") {
         include("_mysql.php");
         include("_settings.php");
         include("_functions.php");
         $_language->read_module('articles');

         if(!isnewswriter($userID)) die($_language->module['no_access']);
         $title = $_POST['title'];
         $message = $_POST['message'];
         $link1 = $_POST['link1'];
         $url1 = $_POST['url1'];
         $window1 = $_POST['window1'];
         $link2 = $_POST['link2'];
         $url2 = $_POST['url2'];
         $window2 = $_POST['window2'];
         $link3 = $_POST['link3'];
         $url3 = $_POST['url3'];
         $window3 = $_POST['window3'];
         $link4 = $_POST['link4'];
         $url4 = $_POST['url4'];
         $window4 = $_POST['window4'];
         $r_v = $_POST['r_v'];
         $b_v = $_POST['b_v'];
         $m_v = $_POST['m_v'];
         $c_v = $_POST['c_v'];
         $lb_v = $_POST['lb_v'];
         $s_v = $_POST['s_v'];
         $a_v = $_POST['a_v'];
         $e_v = $_POST['e_v'];
         $k_v = $_POST['k_v'];
         $schwere = $_POST['schwere'];
         $general = $_POST['general'];
         $content_a = $_POST['content_a'];     
         $comments = $_POST['comments'];
         $rubricID=$_POST['rubric'];
         $articlesID = $_POST['articlesID'];
         
         safe_query("UPDATE ".PREFIX."articles SET
                                             title='".$title."',
                                             link1='".$link1."',
                                             url1='".$url1."',
                                             window1='".$window1."',
                                             link2='".$link2."',
                                             url2='".$url2."',
                                             window2='".$window2."',
                                             link3='".$link3."',
                                             url3='".$url3."',
                                             window3='".$window3."',
                                             link4='".$link4."',
                                             url4='".$url4."',
                                             window4='".$window4."',
                                             r_v='".$r_v."',
                                             b_v='".$b_v."',
                                             m_v='".$m_v."',
                                             c_v='".$c_v."',
                                             lb_v='".$lb_v."',
                                             s_v='".$s_v."',
                                             a_v='".$a_v."',
                                             e_v='".$e_v."',
                                             k_v='".$k_v."',
                                             schwere='".$schwere."',
                                             general='".$general."',
                                             content_a='".$content_a."',
                                             
                                             rubricID='".$rubricID."',
                                             saved='1',
                                             comments='".$comments."' WHERE articlesID='".$articlesID."'");

         $anzpages = mysql_num_rows(safe_query("SELECT * FROM ".PREFIX."articles_contents WHERE articlesID='".$articlesID."'"));
         if($anzpages > count($message)) {
              safe_query("DELETE FROM `".PREFIX."articles_contents` WHERE `articlesID` = '".$articlesID."' and `page` > ".count($message));
         }
         
         for($i = 0; $i <= count($message); $i++) {
               if(isset($message[$i])){
                   if($i >= $anzpages) {
                        safe_query("INSERT INTO ".PREFIX."articles_contents (articlesID, content, page) VALUES ('".$articlesID."', '".$message[$i]."', '".$i."')");
                   }
                   else {
                        safe_query("UPDATE ".PREFIX."articles_contents SET content = '".$message[$i]."' WHERE articlesID = '".$articlesID."' and page = '".$i."'");
                   }
              }
         }
         for($x=$_POST['language_count'];$x<100;$x++){
              safe_query("DELETE FROM ".PREFIX."articles_contents WHERE articlesID = '".$articlesID."' and page = '".$x."'");
         }

         // delete the entries that are older than 2 hour and contain no text
         safe_query("DELETE FROM `".PREFIX."articles` WHERE `saved` = '0' and ".time()." - `date` > ".(2 * 60 * 60));

         die('<body onload="window.close()"></body>');
    }
    elseif(isset($_GET['delete'])) {
         include("_mysql.php");
         include("_settings.php");
         include("_functions.php");
         $_language->read_module('articles');

         $ds=mysql_fetch_array(safe_query("SELECT screens,poster FROM ".PREFIX."articles WHERE articlesID='".$_GET['articlesID']."'"));
      
          if($userID != $ds['poster'] or !isnewsadmin($userID)) die($_language->module['no_access']);

         if($ds['screens']) {
              $screens=explode("|", $ds['screens']);
              if(is_array($screens)) {
                   $filepath = "./images/articles-pics/";
                   foreach($screens as $screen) {
                        if(file_exists($filepath.$screen)) @unlink($filepath.$screen);
                   }
              }
         }

         safe_query("DELETE FROM ".PREFIX."articles WHERE articlesID='".$_GET['articlesID']."'");
         safe_query("DELETE FROM ".PREFIX."articles_contents WHERE articlesID='".$_GET['articlesID']."'");
         safe_query("DELETE FROM ".PREFIX."comments WHERE parentID='".$_GET['articlesID']."' AND type='ar'");

         if(isset($close)) echo'<body onload="window.close()"></body>';
         else header("Location: index.php?site=articles");
    }

    function top5() {
         $pagebg=PAGEBG;
         $border=BORDER;
         $bghead=BGHEAD;
         $bgcat=BGCAT;

         global $_language;

         $_language->read_module('articles');

         echo'<table cellspacing="0" cellpadding="0" width="100%"><tr><td align="center"><div class="top_5"><table border="0" cellspacing="0" cellpadding="0" width="100%">
        <tr>
          <td width="49%" valign="top">';
     if(empty($_GET['rubricID']))     $rub=""; else $rub="and rubricID='".$_GET['rubricID']."'";
         // RATING
         $ergebnis=safe_query("SELECT * FROM ".PREFIX."articles WHERE saved='1' $rub  ORDER BY rating DESC LIMIT 0,5");
         $top=$_language->module['top5_rating'];
         
      eval ("\$top5_head = \"".gettemplate("top5_head")."\";");
      echo $top5_head;
         
      $n=1;
         while($ds=mysql_fetch_array($ergebnis)) {
              if($n%2) {
                   $bg1=BG_1;
                   $bg2=BG_2;
              }
              else {
                   $bg1=BG_3;
                   $bg2=BG_4;
              }

              $title='<a href="index.php?site=articles&amp;action=show&amp;articlesID='.$ds['articlesID'].'">'.clearfromtags($ds['title']).'</a>';
              $poster='<a href="index.php?site=profile&amp;id='.$ds['poster'].'">'.getnickname($ds['poster']).'</a>';
              $viewed='('.$ds['viewed'].')';
              $ratings=array(0,0,0,0,0,0,0,0,0,0);
              for($i=0; $i<$ds['rating']; $i++) {
                   $ratings[$i]=1;
              }
              $ratingpic='<img src="images/icons/rating_'.$ratings[0].'_start.gif" width="1" height="5" alt="" />';
              foreach($ratings as $pic) {
                   $ratingpic.='<img src="images/icons/rating_'.$pic.'.gif" width="4" height="5" alt="" />';
              }
              
        echo'<tr>
            <td align="center"><b>'.$n.'.</b></td>
            <td align="center" style="white-space:nowrap;">'.$ratingpic.'</td>
            <td>'.$title.'</td>
          </tr>';

              unset($ratingpic);
              $n++;
         }
         
      echo'</table>';
         echo'</td><td width="49%" valign="top">';
      
         // POINTS
         $ergebnis=safe_query("SELECT * FROM ".PREFIX."articles WHERE saved='1' $rub ORDER BY points DESC LIMIT 0,5");
         $top=$_language->module['top5_points'];
         
      eval ("\$top5_head = \"".gettemplate("top5_head")."\";");
         echo $top5_head;
      
         $n=1;
         while($ds=mysql_fetch_array($ergebnis)) {
        if($n%2) {
                   $bg1=BG_1;
                   $bg2=BG_2;
              }
              else {
                   $bg1=BG_3;
                   $bg2=BG_4;
              }
        
              $title='<a href="index.php?site=articles&amp;action=show&amp;articlesID='.$ds['articlesID'].'">'.clearfromtags($ds['title']).'</a>';
              $viewed='('.$ds['viewed'].')';
              echo'<tr>
            <td align="center"><b>'.$n.'.</b></td>
            <td align="center">'.$ds['points'].'</td>
            <td>'.$title.'</td>
          </tr>';
          
              $n++;
         }
         echo'</table></td></tr></table></div></td></tr></table>';
    }

    if($action=="new") {
         include("_mysql.php");
         include("_settings.php");
         include("_functions.php");

         $_language->read_module('articles');
         $_language->read_module('bbcode', true);

         $pagebg=PAGEBG;
         $border=BORDER;
         $bghead=BGHEAD;
         $bgcat=BGCAT;

         if(isnewswriter($userID)) {
              safe_query("INSERT INTO ".PREFIX."articles ( date, poster, saved ) VALUES( '".time()."', '$userID', '0' ) ");
              $articlesID=mysql_insert_id();

              $selects='';
              for($i=1;$i<100;$i++) {
                   $selects .= '<option value="'.$i.'">'.$i.'</option>';
              }
         
         if($ds['r_v'])     
         $r_v='<input type="checkbox" name="r_v" value="icon_recruit.png" checked="checked" />';
         else $r_v='<input type="checkbox" name="r_v" value="icon_recruit.png" />';
         
         if($ds['b_v'])     
         $b_v='<input type="checkbox" name="b_v" value="icon_bowman.png" checked="checked" />';
         else $b_v='<input type="checkbox" name="b_v" value="icon_bowman.png" />';
         
         if($ds['m_v'])     
         $m_v='<input type="checkbox" name="m_v" value="icon_militia.png" checked="checked" />';
         else $m_v='<input type="checkbox" name="m_v" value="icon_militia.png" />';
         
         if($ds['c_v'])     
         $c_v='<input type="checkbox" name="c_v" value="icon_cavalry.png" checked="checked" />';
         else $c_v='<input type="checkbox" name="c_v" value="icon_cavalry.png" />';
         
         if($ds['lb_v'])     
         $lb_v='<input type="checkbox" name="lb_v" value="icon_longbowman.png" checked="checked" />';
         else $lb_v='<input type="checkbox" name="lb_v" value="icon_longbowman.png" />';
         
         if($ds['s_v'])     
         $s_v='<input type="checkbox" name="s_v" value="icon_soldier.png" checked="checked" />';
         else $s_v='<input type="checkbox" name="s_v" value="icon_soldier.png" />';
         
         if($ds['a_v'])     
         $a_v='<input type="checkbox" name="a_v" value="icon_crossbowman.png" checked="checked" />';
         else $a_v='<input type="checkbox" name="a_v" value="icon_crossbowman.png" />';
         
         if($ds['e_v'])     
         $e_v='<input type="checkbox" name="e_v" value="icon_elite_soldier.png" checked="checked" />';
         else $e_v='<input type="checkbox" name="e_v" value="icon_elite_soldier.png" />';
         
         if($ds['k_v'])     
         $k_v='<input type="checkbox" name="k_v" value="icon_cannoneer.png" checked="checked" />';
         else $k_v='<input type="checkbox" name="k_v" value="icon_cannoneer.png" />';
         
         
         $schwere='<option value="">Schwierigkeit Wählen:</option>
                     <option value="1">1</option>
                     <option value="2">2</option>
                     <option value="3">3</option>
                     <option value="4">4</option>
                     <option value="5">5</option>
                     <option value="6">6</option>
                     <option value="7">7</option>
                     <option value="8">8</option>
                     <option value="9">9</option>
                     <option value="10">10</option>';
         
         $general='<option value="">General Wählen:</option>
                     <option value="200">200</option>
                     <option value="250">250</option>';
                     

         
         $rubrics='<option value="">Abendteuer Wählen:</option>';
         $articlesrubrics=safe_query("SELECT rubricID, rubric FROM ".PREFIX."articles_rubrics ORDER BY rubric");
         while($dr=mysql_fetch_array($articlesrubrics)) {
              $rubrics.='<option value="'.$dr['rubricID'].'">'.$dr['rubric'].'</option>';
         }


              $pages = 1;

              $bg1=BG_1;
              eval ("\$addbbcode = \"".gettemplate("addbbcode")."\";");
              eval ("\$addflags = \"".gettemplate("flags")."\";");

              eval ("\$articles_post = \"".gettemplate("articles_post")."\";");
              echo $articles_post;
         }
         else redirect('index.php?site=articles', $_language->module['no_access']);
    }
    elseif($action=="edit") {

         include("_mysql.php");
         include("_settings.php");
         include("_functions.php");

         $_language->read_module('articles');
         $_language->read_module('bbcode', true);

         $articlesID = $_GET['articlesID'];
         
         
         $pagebg=PAGEBG;
         $border=BORDER;
         $bghead=BGHEAD;
         $bgcat=BGCAT;
                   
                   
         if($userID = $ds['poster'] or isnewsadmin($userID)) {
              $ds=mysql_fetch_array(safe_query("SELECT * FROM ".PREFIX."articles WHERE articlesID = '".$articlesID."'"));

              $title=getinput($ds['title']);
              $rubricID =getinput($ds['rubricID']);
              
              $message = array();
              $query = safe_query("SELECT content FROM ".PREFIX."articles_contents WHERE articlesID = '".$articlesID."' ORDER BY page ASC");
              while($qs = mysql_fetch_array($query)) {
                   $message[] = $qs['content'];
              }

              $message_vars='';
              $i=0;
              foreach($message as $val) {
                   $message_vars .= "message[".$i."] = '".js_replace($val)."';\n";
                   $i++;
              }
              $pages = count($message);

              $selects='';
              for($i=1;$i<100;$i++) {
                    if($i==$pages) $selected = "selected='selected'";
                    else $selected = NULL;
                   $selects .= '<option value="'.$i.'" '.$selected.'>'.$i.'</option>';
              }
              
         if($ds['r_v'])     
         $r_v='<input type="checkbox" name="r_v" value="icon_recruit.png" checked="checked" />';
         else $r_v='<input type="checkbox" name="r_v" value="icon_recruit.png" />';
         
         if($ds['b_v'])     
         $b_v='<input type="checkbox" name="b_v" value="icon_bowman.png" checked="checked" />';
         else $b_v='<input type="checkbox" name="b_v" value="icon_bowman.png" />';
         
         if($ds['m_v'])     
         $m_v='<input type="checkbox" name="m_v" value="icon_militia.png" checked="checked" />';
         else $m_v='<input type="checkbox" name="m_v" value="icon_militia.png" />';
         
         if($ds['c_v'])     
         $c_v='<input type="checkbox" name="c_v" value="icon_cavalry.png" checked="checked" />';
         else $c_v='<input type="checkbox" name="c_v" value="icon_cavalry.png" />';
         
         if($ds['lb_v'])     
         $lb_v='<input type="checkbox" name="lb_v" value="icon_longbowman.png" checked="checked" />';
         else $lb_v='<input type="checkbox" name="lb_v" value="icon_longbowman.png" />';
         
         if($ds['s_v'])     
         $s_v='<input type="checkbox" name="s_v" value="icon_soldier.png" checked="checked" />';
         else $s_v='<input type="checkbox" name="s_v" value="icon_soldier.png" />';
         
         if($ds['a_v'])     
         $a_v='<input type="checkbox" name="a_v" value="icon_crossbowman.png" checked="checked" />';
         else $a_v='<input type="checkbox" name="a_v" value="icon_crossbowman.png" />';
         
         if($ds['e_v'])     
         $e_v='<input type="checkbox" name="e_v" value="icon_elite_soldier.png" checked="checked" />';
         else $e_v='<input type="checkbox" name="e_v" value="icon_elite_soldier.png" />';
         
         if($ds['k_v'])     
         $k_v='<input type="checkbox" name="k_v" value="icon_cannoneer.png" checked="checked" />';
         else $k_v='<input type="checkbox" name="k_v" value="icon_cannoneer.png" />';
         
         $rubrics='test';
         $articlesrubrics=safe_query("SELECT rubricID, rubric FROM ".PREFIX."articles_rubrics ORDER BY rubric");
         while($dr=mysql_fetch_array($articlesrubrics)) {
              $rubrics.='<option value="'.$dr['rubricID'].'">'.$dr['rubric'].'</option>';
         }
         
              $schwere='<option value="'.$ds['schwere'].'">Schwierigkeit: '.$ds['schwere'].'</option>
                     <option value="1">1</option>
                     <option value="2">2</option>
                     <option value="3">3</option>
                     <option value="4">4</option>
                     <option value="5">5</option>
                     <option value="6">6</option>
                     <option value="7">7</option>
                     <option value="8">8</option>
                     <option value="9">9</option>
                     <option value="10">10</option>';
                     
              $general='<option value="'.$ds['general'].'">General: '.$ds['general'].'</option>
                     <option value="200">200</option>
                     <option value="250">250</option>';
         
         /*
              
         $articlesrubrics=safe_query("SELECT * FROM ".PREFIX."articles_rubrics ORDER BY rubric");
         $rubrics='<option value="'.$dr['rubricID'].'">'.getinput($dr['rubric']).'</option>';
         while($dr=mysql_fetch_array($articlesrubrics)) {
              if($dr['rubric']==$dr['rubricID']) $rubrics.='<option value="'.$dr['rubricID'].'" selected="selected">'.getinput($dr['rubric']).'</option>';
              else $rubrics.='<option value="'.$dr['rubricID'].'">'.getinput($dr['rubric']).'</option>';
         }
         */

              $link1=getinput($ds['link1']);
              $link2=getinput($ds['link2']);
              $link3=getinput($ds['link3']);
              $link4=getinput($ds['link4']);
              $url1=getinput($ds['url1']);
              $url2=getinput($ds['url2']);
              $url3=getinput($ds['url3']);
              $url4=getinput($ds['url4']);
              
        if($ds['window1']) $window1='<input class="input" name="window1" type="radio" value="1" checked="checked" /> '.$_language->module['new_window'].' <input class="input" type="radio" name="window1" value="0" /> '.$_language->module['self'].'';
              else $window1='<input class="input" name="window1" type="radio" value="1" /> '.$_language->module['new_window'].' <input class="input" type="radio" name="window1" value="0" checked="checked" /> '.$_language->module['self'].'';

              if($ds['window2']) $window2='<input class="input" name="window2" type="radio" value="1" checked="checked" /> '.$_language->module['new_window'].' <input class="input" type="radio" name="window2" value="0" /> '.$_language->module['self'].'';
              else $window2='<input class="input" name="window2" type="radio" value="1" /> '.$_language->module['new_window'].' <input class="input" type="radio" name="window2" value="0" checked="checked" /> '.$_language->module['self'].'';

              if($ds['window3']) $window3='<input class="input" name="window3" type="radio" value="1" checked="checked" /> '.$_language->module['new_window'].' <input class="input" type="radio" name="window3" value="0" /> '.$_language->module['self'].'';
              else $window3='<input class="input" name="window3" type="radio" value="1" /> '.$_language->module['new_window'].' <input class="input" type="radio" name="window3" value="0" checked="checked" /> '.$_language->module['self'].'';

              if($ds['window4']) $window4='<input class="input" name="window4" type="radio" value="1" checked="checked" /> '.$_language->module['new_window'].' <input class="input" type="radio" name="window4" value="0" /> '.$_language->module['self'].'';
              else $window4='<input class="input" name="window4" type="radio" value="1" /> '.$_language->module['new_window'].' <input class="input" type="radio" name="window4" value="0" checked="checked" /> '.$_language->module['self'].'';

              $comments='<option value="0">'.$_language->module['no_comments'].'</option><option value="1">'.$_language->module['user_comments'].'</option>';
              $comments=str_replace('value="'.$ds['comments'].'"', 'value="'.$ds['comments'].'" selected="selected"', $comments);

              $bg1=BG_1;
              eval ("\$addbbcode = \"".gettemplate("addbbcode")."\";");
              eval ("\$addflags = \"".gettemplate("flags")."\";");

              eval ("\$articles_edit = \"".gettemplate("articles_edit")."\";");
              echo $articles_edit;
         }
         else redirect('index.php?site=articles', $_language->module['no_access']);
    }
    elseif($action=="show") {

         $_language->read_module('articles');

         eval ("\$title_articles = \"".gettemplate("title_articles")."\";");
         echo $title_articles;
         
         $articlesID = (int)$_GET['articlesID'];
         if(isset($_GET['page'])) $page = (int)$_GET['page'];
         else $page = 1;


         if($page==1) safe_query("UPDATE ".PREFIX."articles SET viewed=viewed+1 WHERE articlesID='".$articlesID."'");
         $result=safe_query("SELECT * FROM ".PREFIX."articles WHERE articlesID='".$articlesID."'");
         
         if(mysql_num_rows($result)) {
              
              $ds=mysql_fetch_array($result);
              $date = date("d.m.Y", $ds['date']);
              $time = date("H:i", $ds['date']);
              $title = clearfromtags($ds['title']);
              $content_a = htmloutput($ds['content_a']);
              
              $content = array();
              $query = safe_query("SELECT * FROM ".PREFIX."articles_contents WHERE articlesID = '".$articlesID."' ORDER BY page ASC");
              while($qs = mysql_fetch_array($query)) {
                   $content[] = $qs['content'];
              }

              $pages = count($content);
              $content = htmloutput($content[$page-1]);
              $content = toggle($content, $ds['articlesID']);

              if($pages>1) $page_link = makepagelink("index.php?site=articles&amp;action=show&amp;articlesID=$articlesID", $page, $pages);
              else $page_link='';
              
              
              $poster='<a href="index.php?site=profile&amp;id='.$ds['poster'].'"><b>'.getnickname($ds['poster']).'</b></a>';
              $related="";
                 if($ds['link1'] && $ds['url1']!="http://" && $ds['window1']) $related.='<a href="'.$ds['url1'].'" target="_blank">'.$ds['link1'].'</a> ';
              if($ds['link1'] && $ds['url1']!="http://" && !$ds['window1']) $related.='<a href="'.$ds['url1'].'">'.$ds['link1'].'</a> ';

              if($ds['link2'] && $ds['url2']!="http://" && $ds['window2']) $related.='<a href="'.$ds['url2'].'" target="_blank">'.$ds['link2'].'</a> ';
              if($ds['link2'] && $ds['url2']!="http://" && !$ds['window2']) $related.='<a href="'.$ds['url2'].'">'.$ds['link2'].'</a> ';

              if($ds['link3'] && $ds['url3']!="http://" && $ds['window3']) $related.='<a href="'.$ds['url3'].'" target="_blank">'.$ds['link3'].'</a> ';
              if($ds['link3'] && $ds['url3']!="http://" && !$ds['window3']) $related.='<a href="'.$ds['url3'].'">'.$ds['link3'].'</a> ';

              if($ds['link4'] && $ds['url4']!="http://" && $ds['window4']) $related.='<a href="'.$ds['url4'].'" target="_blank">'.$ds['link4'].'</a> ';
              if($ds['link4'] && $ds['url4']!="http://" && !$ds['window4']) $related.='<a href="'.$ds['url4'].'">'.$ds['link4'].'</a> ';
              if(empty($related)) $related="n/a";
              $rubricID = $ds['rubricID'];
              
              $comments_allowed = $ds['comments'];

              $kath=safe_query("SELECT * FROM ".PREFIX."articles_rubrics WHERE rubricID='".$rubricID."'");
              while($dk=mysql_fetch_array($kath)) {
              $rubname = "".$dk['rubric']."";
              }
              
              $ratings=array(0,0,0,0,0,0,0,0,0,0);
              for($i=0; $i<$ds['rating']; $i++) {
                   $ratings[$i]=1;
              }
              $ratingpic='<img src="images/icons/rating_'.$ratings[0].'_start.gif" width="1" height="5" alt="" />';
              foreach($ratings as $pic) {
                   $ratingpic.='<img src="images/icons/rating_'.$pic.'.gif" width="4" height="5" alt="" />';
              }


              

    if(($userID == $ds['poster'] or isnewsadmin($userID))) $actions='<td><input type="button" onclick="MM_openBrWindow(\'articles.php?action=edit&amp;articlesID='.$ds['articlesID'].'\',\'News\',\'toolbar=no,status=no,scrollbars=yes,width=520,height=500\');" value="'.$_language->module['edit'].'" /></td>
        <td><input type="button" onclick="MM_confirm(\''.$_language->module['really_delete'].'\', \'articles.php?delete=true&amp;articlesID='.$ds['articlesID'].'\');" value="'.$_language->module['delete'].'" /></td>';
    else $actions='';



              if($loggedin) {
                   $getarticles=safe_query("SELECT articles FROM ".PREFIX."user WHERE userID='$userID'");
                   $found=false;
                   if(mysql_num_rows($getarticles)) {
                        $ga=mysql_fetch_array($getarticles);
                        if($ga['articles']!="") {
                             $string=$ga['articles'];
                             $array=explode(":", $string);
                             $anzarray=count($array);
                             for($i=0; $i<$anzarray; $i++) {
                                  if($array[$i]==$articlesID) $found=true;
                             }
                        }
                   }
                   if($found) $rateform=$_language->module['already_rated'];
                   else $rateform='<form method="post" action="rating.php">
          <table cellspacing="0" cellpadding="2" align="right">
            <tr>
              <td>'.$_language->module['rate_with'].'
              <select name="rating">
                <option>0 - '.$_language->module['poor'].'</option>
                <option>1</option>
                <option>2</option>
                <option>3</option>
                <option>4</option>
                <option>5</option>
                <option>6</option>
                <option>7</option>
                <option>8</option>
                <option>9</option>
                <option>10 - '.$_language->module['perfect'].'</option>
              </select>
              <input type="hidden" name="userID" value="'.$userID.'" />
              <input type="hidden" name="type" value="ar" />
              <input type="hidden" name="id" value="'.$ds['articlesID'].'" />
              <input type="submit" name="Submit" value="'.$_language->module['rate'].'" /></td>
            </tr>
          </table>
          </form>';
              }
              else $rateform=$_language->module['login_for_rate'];

              $bg1=BG_1;
              eval ("\$articles = \"".gettemplate("articles")."\";");
              echo $articles;

              unset($related);
              unset($comments);
              unset($lang);
              unset($ds);
              unset($ratingpic);
              unset($page);
              unset($pages);

              $parentID = $articlesID;
              $type = "ar";
              $referer = "index.php?site=articles&amp;action=show&amp;articlesID=$articlesID";

              include("comments.php");
         }
         else echo $_language->module['no_entries'];
    }
    elseif($action=="rubric")  {

         $_language->read_module('articles');

         if(isset($_GET['page'])) $page=(int)$_GET['page'];
         else $page = 1;
         $sort="date";
         if(isset($_GET['sort'])){
           if(($_GET['sort']=='date') || ($_GET['sort']=='poster') || ($_GET['sort']=='rating') || ($_GET['sort']=='schwere') || ($_GET['sort']=='viewed')) $sort=$_GET['sort'];
         }
         $type="DESC";
         if(isset($_GET['type'])){
           if(($_GET['type']=='ASC') || ($_GET['type']=='DESC')) $type=$_GET['type'];
         }
                   $kath=safe_query("SELECT * FROM ".PREFIX."articles_rubrics WHERE rubricID='".$rubricID."'");
              while($dk=mysql_fetch_array($kath)) {
              $rubname = "".$dk['rubric']."";
              }
         
         
         $rubricID = $_GET['rubricID'];     
         $get = safe_query("SELECT * FROM ".PREFIX."articles_rubrics WHERE rubricID='".$rubricID."'");
         $dc = mysql_fetch_assoc($get);
         
         $map = $dc['map'];
         $ep = $dc['ep'];
         $spieler = $dc['spieler'];
         $tage = $dc['tage'];
         $sg = $dc['sg'];
         $rubname = $dc['rubric'];
         $typ = $dc['typ'];
         $erhaltbar = $dc['erhaltbar'];
         $spielerstufe = $dc['spielerstufe'];
         $unterrichtung = $dc['unterrichtung'];
         $siegbedingung = $dc['siegbedingung'];
         $niederlage = $dc['niederlage'];
         $missionserfolg = $dc['missionserfolg'];
         $truppen = $dc['truppen'];     
         
         eval ("\$title_articles = \"".gettemplate("title_articles_1")."\";");
         echo $title_articles;
         
      if(isnewswriter($userID)) echo'<input type="button" onclick="MM_openBrWindow(\'articles.php?action=new\',\'Articles\',\'toolbar=no,status=no,scrollbars=yes,width=520,height=500\');" value="'.$_language->module['new_article'].'" /><br>';




         $alle=safe_query("SELECT articlesID FROM ".PREFIX."articles WHERE saved='1' and rubricID='".$_GET['rubricID']."'");
         $gesamt = mysql_num_rows($alle);
         $pages=1;

         $max=$maxarticles;

         for ($n=$max; $n<=$gesamt; $n+=$max) {
              if($gesamt>$n) $pages++;
         }

         if($pages>1) $page_link = makepagelink("index.php?site=articles&amp;action=rubric&amp;rubricID=".$_GET['rubricID']."&amp;sort=".$sort."&amp;type=".$type, $page, $pages);
      else $page_link='';

         if ($page == "1") {
              $ergebnis = safe_query("SELECT * FROM ".PREFIX."articles WHERE saved='1' and rubricID='".$_GET['rubricID']."' ORDER BY $sort $type LIMIT 0,$max");
              if($type=="DESC") $n=$gesamt;
              else $n=1;
         }
         else {
              $start=$page*$max-$max;
              $ergebnis = safe_query("SELECT * FROM ".PREFIX."articles WHERE saved='1' and rubricID='".$_GET['rubricID']."' ORDER BY $sort $type LIMIT $start,$max");
              if($type=="DESC") $n = ($gesamt)-$page*$max+$max;
              else $n = ($gesamt+1)-$page*$max+$max;
         }
         if($gesamt) {

              if($type=="ASC")
              echo'<table cellspacing="1" border="0" cellpadding="4">
              <tr> 
              <td width="590"><a href="index.php?site=articles&amp;action=rubric&amp;rubricID='.$_GET['rubricID'].'&amp;page='.$page.'&amp;sort='.$sort.'&amp;type=DESC">'.$_language->module['sort'].'</a> <img src="images/icons/asc.gif" width="9" height="7" border="0" alt="" /></td>
              </tr>
              </table>';
              else
              echo'<table cellspacing="1" border="0" cellpadding="4">
              <tr> 
              <td width="590"><a href="index.php?site=articles&amp;action=rubric&amp;rubricID='.$_GET['rubricID'].'&amp;page='.$page.'&amp;sort='.$sort.'&amp;type=ASC">'.$_language->module['sort'].'</a> <img src="images/icons/desc.gif" width="9" height="7" border="0" alt="" /></td>
              </tr>
              </table>';


              if($pages>1) echo $page_link;
                   $rubricID=$_GET['rubricID'];
              
        eval ("\$articles_head = \"".gettemplate("articles_head")."\";");
              echo $articles_head;
        
              $n=1;
              while($ds=mysql_fetch_array($ergebnis)) {
                   if($n%2) {
                        $bg1=BG_1;
                        $bg2=BG_2;
                   }
                   else {
                        $bg1=BG_3;
                        $bg2=BG_4;
                   }
                   $date=date("d.m.Y", $ds['date']);
                   $title='<a href="index.php?site=articles&amp;action=show&amp;articlesID='.$ds['articlesID'].'">'.clearfromtags($ds['title']).'</a>';
                   $poster='<a href="index.php?site=profile&amp;id='.$ds['poster'].'">'.getnickname($ds['poster']).'</a>';
                   $viewed=$ds['viewed'];
                   $schwere = $ds['schwere'];
                   $general = $ds['general'];
                   $rubricpic=$ds['rubricpic'];
                   $ratings=array(0,0,0,0,0,0,0,0,0,0);
                   for($i=0; $i<$ds['rating']; $i++) {
                        $ratings[$i]=1;
                   }
                   $ratingpic='<img src="images/icons/rating_'.$ratings[0].'_start.gif" width="1" height="5" alt="" />';
                   foreach($ratings as $pic) {
                        $ratingpic.='<img src="images/icons/rating_'.$pic.'.gif" width="4" height="5" alt="" />';
                   }
                   if($ds['r_v'])
                   $r_v = '<img src="images/siedler/armee/'.$ds['r_v'].'">';
                   else $r_v = '';
                   
                   if($ds['b_v'])
                   $b_v = '<img src="images/siedler/armee/'.$ds['b_v'].'">';
                   else $b_v = '';
                   
                   if($ds['m_v'])
                   $m_v = '<img src="images/siedler/armee/'.$ds['m_v'].'">';
                   else $m_v = '';

                   if($ds['c_v'])
                   $c_v = '<img src="images/siedler/armee/'.$ds['c_v'].'">';
                   else $c_v = '';
                   
                   if($ds['lb_v'])
                   $lb_v = '<img src="images/siedler/armee/'.$ds['lb_v'].'">';
                   else $lb_v = '';
                   
                   if($ds['s_v'])
                   $s_v = '<img src="images/siedler/armee/'.$ds['s_v'].'">';
                   else $s_v = '';
                   
                   if($ds['a_v'])
                   $a_v = '<img src="images/siedler/armee/'.$ds['a_v'].'">';
                   else $a_v = '';

                   if($ds['e_v'])
                   $e_v = '<img src="images/siedler/armee/'.$ds['e_v'].'">';
                   else $e_v = '';
                   
                   if($ds['k_v'])
                   $k_v = '<img src="images/siedler/armee/'.$ds['k_v'].'">';
                   else $k_v = '';
                   
         $rubrikname=getrubname($ds['rubricID']);
         if(!file_exists($rubricpic)) $rubricpic.='<img src="./images/articles-rubrics/'.getrubpic($ds['rubricID']).'" alt="" />';
         else $rubricpic = '';


                   eval ("\$articles_content = \"".gettemplate("articles_content")."\";");
                   echo $articles_content;
                   unset($ratingpic);
                   $n++;
              }
              eval ("\$articles_foot = \"".gettemplate("articles_foot")."\";");
              echo $articles_foot;
              
              unset($ds);
         }
         else echo $_language->module['no_entries'];
    }else{
              $_language->read_module('articles');

         /*     
              
              echo '<table border="0" width="100%" cellspacing="0" cellpadding="0"><tr><td align="right">';
    include("login.php"); 
              echo '</td>';
              echo '<td align="left">';
    echo '
    <div id="mygallery" class="stepcarousel">
    <div class="belt">

    <div class="panel"><div class="menu_slide">
    <div class="menu_slide_kat">Neuste Taktikkarten</div>';
    include("sc_articles.php"); 
    echo '
    </div>
    </div>

    <div class="panel"><div class="menu_slide">
    <div class="menu_slide_kat">Zufalls Bild</div>';
    include("sc_randompic.php");
    echo '
    </div>
    </div>
    <div class="panel"><div class="menu_slide">
    <div class="menu_slide_kat">Umfrage</div>';
    include("poll.php"); 
    echo '
    </div>
    </div>
    <div class="panel">
    <div class="menu_slide">
    <div class="menu_slide_kat">Online Liste</div>';
    include("sc_useronline.php"); 
    echo '
    </div>
    </div>

    <div class="panel">
    <div class="menu_slide">
    <div class="menu_slide_kat">Letzten Registrationen</div>';
    include("sc_lastregistered.php"); 
    echo '
    </div>
    </div>
    </div>
    </div>';
              echo '</td>';
              echo '</tr>';
              echo '</table>';
    */          
         eval ("\$title_articles = \"".gettemplate("title_articles")."\";");
         echo $title_articles;

       // Create a MySQL table
         
     mysql_query("CREATE TABLE IF NOT EXISTS ".PREFIX."articles_rubrics (
      `rubricID` int(11) NOT NULL AUTO_INCREMENT,
      `rubric` varchar(255) NOT NULL DEFAULT '',
      `pic` varchar(255) NOT NULL DEFAULT '',
      `description` varchar(255) NOT NULL,
      PRIMARY KEY (`rubricID`)
    ) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ");
    mysql_query("ALTER TABLE `".PREFIX."articles` ADD `rubricID` INT( 11 ) NOT NULL DEFAULT '0' AFTER `title`");


     

         




              
              top5();
              
    $rubcats=safe_query("SELECT * FROM ".PREFIX."articles_rubrics ORDER BY farbe ASC, rubric ASC");
         $anzcats=mysql_num_rows($rubcats);
         if($anzcats) {

              eval ("\$artikel_category_head = \"".gettemplate("artikel_category_head")."\";");
              echo $artikel_category_head;
              $i=1;
              while($ds=mysql_fetch_array($rubcats)) {
                   $anzarticle=mysql_num_rows(safe_query("SELECT articlesID FROM ".PREFIX."articles WHERE rubricID='".$ds['rubricID']."'"));
                   if($i%2) {
                        $bg1=BG_1;
                        $bg2=BG_2;
                   }
                   else {
                        $bg1=BG_3;
                        $bg2=BG_4;
                   }
                   $spieler = $ds['spieler'];
                   $tage = $ds['tage'];
                   $sg = $ds['sg'];               
                   $ep_k = $ds['ep_k'];
                   $ep = $ds['ep'];
                   
                   $rubricID = $ds['rubricID'];
                   $rubname='<a href="index.php?site=articles&amp;action=rubric&amp;rubricID='.$ds['rubricID'].'"><b>'.$ds['rubric'].'</b></a>';
                   $description=htmloutput($ds['description']);
                   $rubpic='<a href="index.php?site=articles&amp;action=rubric&amp;rubricID='.$ds['rubricID'].'""><img src="./images/articles-rubrics/'.$ds['pic'].'" alt="'.$ds['rubric'].'" title="'.$ds['rubric'].'" /></a>';
                   eval ("\$artikel_category = \"".gettemplate("artikel_category")."\";");
                   echo $artikel_category;
                   $i++;
              }
              eval ("\$artikel_foot = \"".gettemplate("artikel_foot")."\";");
              echo $artikel_foot;
         }
         else echo $_language->module['no_entries'];



         
    }

    ?>


    Es wäre dringend, da meine seite täglich 600 - 1000 Besucher hat x.x
    Moderator
    1708 Posts
    26.04.2012, 11:19 online quote 

    M V P wrote:

    Das mit dem löschen geht leider immernoch nicht.
    Nun Kann ich zwar sachen löschen, aber der ersteller nicht.

    okey, ich glaub ich muss das ein bisschen genauer erklären.
    Mir ist grade aufgefallen das User die Artikel von anderen edtitieren können und da einige User isnewswriter rechte haben, ist das ein Problem.

    Das ganze ist so gedacht, das User Artikel erstellen können, aber sollen nur ihre eigenen Artikel Editieren/Löschen können.
    Den Button für das Editieren/löschen sehen sie nur in ihrem erstellten Artikel, aber können sofern sie den Link von den anderen Artikeln kennen..sprich den editierlink dann können die darauf zugreifen.


    So, das muss verhindert werden.
    Ich glaube die idee mit dem ''poster'' war nicht die beste idee.


    Könnte mir dabei wer helfen ?
    Ich glaube Aktuell ist noch keiner darauf gekommen das es möglich ist.


    Dann poste mal den ganzen Inhalt der articles.php
    webSPELL newbie
    69 Posts
    26.04.2012, 11:05 email offline quote 

    Das mit dem löschen geht leider immernoch nicht.
    Nun Kann ich zwar sachen löschen, aber der ersteller nicht.

    okey, ich glaub ich muss das ein bisschen genauer erklären.
    Mir ist grade aufgefallen das User die Artikel von anderen edtitieren können und da einige User isnewswriter rechte haben, ist das ein Problem.

    Das ganze ist so gedacht, das User Artikel erstellen können, aber sollen nur ihre eigenen Artikel Editieren/Löschen können.
    Den Button für das Editieren/löschen sehen sie nur in ihrem erstellten Artikel, aber können sofern sie den Link von den anderen Artikeln kennen..sprich den editierlink dann können die darauf zugreifen.


    So, das muss verhindert werden.
    Ich glaube die idee mit dem ''poster'' war nicht die beste idee.


    Könnte mir dabei wer helfen ?
    Ich glaube Aktuell ist noch keiner darauf gekommen das es möglich ist.
    Moderator
    1708 Posts
    26.04.2012, 01:39 online quote 

    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.
    elseif(isset($_GET['delete'])) {
         include("_mysql.php");
         include("_settings.php");
         include("_functions.php");
         $_language->read_module('articles');

         $ds=mysql_fetch_array(safe_query("SELECT screens,poster FROM ".PREFIX."articles WHERE articlesID='".$_GET['articlesID']."'"));
      
          if($userID != $ds['poster'] or !isnewsadmin($userID)) die($_language->module['no_access']);

         if($ds['screens']) {
              $screens=explode("|", $ds['screens']);
              if(is_array($screens)) {
                   $filepath = "./images/articles-pics/";
                   foreach($screens as $screen) {
                        if(file_exists($filepath.$screen)) @unlink($filepath.$screen);
                   }
              }
         }

         safe_query("DELETE FROM ".PREFIX."articles WHERE articlesID='".$_GET['articlesID']."'");
         safe_query("DELETE FROM ".PREFIX."articles_contents WHERE articlesID='".$_GET['articlesID']."'");
         safe_query("DELETE FROM ".PREFIX."comments WHERE parentID='".$_GET['articlesID']."' AND type='ar'");

         if(isset($close)) echo'<body onload="window.close()"></body>';
         else header("Location: index.php?site=articles");
    }
    webSPELL newbie
    69 Posts
    25.04.2012, 18:45 email offline quote 

    ok, ich bin nun verwirrt.
    Was genau stimmt den nun oder was soll ich alles ändern?

    Code:
    1.
    if($userID == $ds['poster'] || isnewsadmin($userID))


    Funktioniert leider nicht, User können die sachen zwar löschen, nur ich als Newsadmin nicht =(
    Administrator
    Member of webSPELL e.V.
    2565 Posts
    24.04.2012, 20:38 email online quote 

    Das ganze macht auch in dieser Form keinen Sinn.
    Denn $ds ist noch gar nicht an der Stelle definiert.
    Code:
    1.
    if(($userID != $ds['poster'] or !isnewsadmin($userID))) die($_language->module['no_access']);

    Muss also 2 Zeilen weiter runter als es derzeit ist
    webSPELL hero
    1799 Posts
    24.04.2012, 20:34 offline quote 

    Es wird wohl eher daran liegen das sie so keinen sinn macht.

    Code:
    1.
    if(($userID != $ds['poster'] or !isnewsadmin($userID))) die($_language->module['no_access']);


    Wäre wohl etwas sinnvoller.
    Denn deine voherige version, erlaubt es, dass jeder den Post löschen kann, außer der autor oder der newsadmin.
    Administrator
    Member of webSPELL e.V.
    3068 Posts
    24.04.2012, 11:05 offline quote 

    Zeile 7
    Code:
    1.
    if($userID == $ds['poster'] || isnewsadmin($userID))


    wird wohl an der komischen Klammerung gelegen haben lächeln
    Sort:      1 2  » printview


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

    register now
    login
  • » Support

    » Topics
    18.05.2013 - 14:00 - 0 Replies
    » [S] Tester für neuen Foru...
    [S] Tester für neuen ForumMod
    Last post: Argu
    Board: DE - Anfragen
    18.05.2013 - 14:00
    18.05.2013 - 13:21 - 34 Replies
    » Exklusiv Webseite zur Mie...
    Exklusiv Webseite zur Miete
    Last post: Philipp
    Board: DE - Biete
    18.05.2013 - 13:21
    18.05.2013 - 12:21 - 1 Replies
    » Query failed
    Query failed
    Last post: LoRd
    Board: DE - Allgemeiner Support
    18.05.2013 - 12:21
    18.05.2013 - 09:36 - 3 Replies
    » benötige hilfe bei paar k...
    benötige hilfe bei paar kleinigkeiten
    Last post: immostar
    Board: DE - Technischer Support
    18.05.2013 - 09:36
    18.05.2013 - 03:33 - 4 Replies
    » [SELL] Gaming Website
    [SELL] Gaming Website
    Last post: hornyst
    Board: EN - Offers
    18.05.2013 - 03:33
    18.05.2013 - 00:32 - 6 Replies
    » Hide BBCODE Echo
    Hide BBCODE Echo
    Last post: dado2106
    Board: EN - Technical support
    18.05.2013 - 00:32
    17.05.2013 - 21:42 - 0 Replies
    » website help
    website help
    Last post: envy0024
    Board: EN - Technical support
    17.05.2013 - 21:42
    17.05.2013 - 21:03 - 1 Replies
    » Need Coder!
    Need Coder!
    Last post: iG.ShAdOw
    Board: EN - Requests
    17.05.2013 - 21:03
    17.05.2013 - 20:44 - 9 Replies
    » Query failed!
    Query failed!
    Last post: LoRd
    Board: DE - Allgemeiner Support
    17.05.2013 - 20:44
    17.05.2013 - 18:08 - 0 Replies
    » [4 SALE] Layouts (Gaming,...
    [4 SALE] Layouts (Gaming, Portfolio and more)
    Last post: Freestyler92
    Board: EN - Offers
    17.05.2013 - 18:08
    17.05.2013 - 18:06 - 0 Replies
    » Design Ausverkauf - alles...
    Design Ausverkauf - alles unter 70€
    Last post: Freestyler92
    Board: DE - Biete
    17.05.2013 - 18:06
    17.05.2013 - 10:56 - 6 Replies
    » [Biete] Template Designs
    [Biete] Template Designs
    Last post: Marceld
    Board: DE - Biete
    17.05.2013 - 10:56
    17.05.2013 - 10:41 - 7 Replies
    » register captcha
    register captcha
    Last post: nappel.ger
    Board: DE - Allgemeiner Support
    17.05.2013 - 10:41
    17.05.2013 - 09:56 - 3 Replies
    » Suche Designer GGL:Geld
    Suche Designer GGL:Geld
    Last post: Freestyler92
    Board: DE - Suche
    17.05.2013 - 09:56
    17.05.2013 - 00:13 - 0 Replies
    » News
    News
    Last post: dado2106
    Board: EN - Modifications
    17.05.2013 - 00:13
    16.05.2013 - 15:04 - 2 Replies
    » [V] mehrere Webspell Temp...
    [V] mehrere Webspell Templates und Designs
    Last post: Dynamic-Webmedia
    Board: DE - Biete
    16.05.2013 - 15:04
    16.05.2013 - 13:09 - 2 Replies
    » Content laden
    Content laden
    Last post: Helgon
    Board: DE - Anfragen
    16.05.2013 - 13:09
    16.05.2013 - 13:07 - 18 Replies
    » [B] Web, Print und Logode...
    [B] Web, Print und Logodesign
    Last post: Helgon
    Board: DE - Suche
    16.05.2013 - 13:07
    15.05.2013 - 22:50 - 2 Replies
    » Query failed: errorno=105...
    Query failed: errorno=1054
    Last post: Tw0Player
    Board: DE - Technischer Support
    15.05.2013 - 22:50
    15.05.2013 - 18:59 - 5 Replies
    » [S] Team/Clan Logos (Upda...
    [S] Team/Clan Logos (Update: 2 new Logos)
    Last post: neiD-
    Board: EN - Offers
    15.05.2013 - 18:59
    » Partners
    Bilderkiste.org Image Hosting
    k3rmit.org
    PascalMh.de


    » Blog
    28.03.2013 - derchris
    » Those damn spammers