Pagination

Pagination

Beitragvon joker » 10.08.2011, 15:39

Hallo! Ich hoffe, Ihr könnt mir helfen. Ich habe folgendes Problem ich habe mir den newsscript N-13 News instralliert ich wolte mein pagination ändern mit dierser seite hT+p:/ / mis-algoritmospunkt com / 2007/03/16/some-styles-for-your-pagination deswegen habe ich den css script gespeichert


div.pagination {
margin-top: 20px;
margin-bottom: 10px;
}

div.pagination a {
padding: 2px 5px 2px 5px;
margin-right: 2px;
border: 1px solid #8DB5D7;
text-decoration: none;
color: #000;
}
div.pagination a:hover, div.pagination a:active {
padding: 2px 5px 2px 5px;
margin-right: 2px;
border: 1px solid red;
}
div.pagination span.current {
padding: 2px 5px 2px 5px;
margin-right: 2px;
border: 1px solid #E89954;
font-weight: bold;
background-color: #FFCA7D;
color: #000;
}
div.pagination span.disabled {
padding: 2px 5px 2px 5px;
margin-right: 2px;
border: 1px solid #ccc;
color: #ccc;
}
dann war ich bei N-13 news im Options > Templates > News Pagination dann habe ich diesen

<span style="font-family: Verdana; font-size: 12pt">Older news.</span><br >
<div style="font-family: Verdana; font-size: 10pt">[prev-link]<[/prev-link] {pages} [next-link]>[/next-link]
</div>
<br>
script mit mit diesen verändert

<link rel="stylesheet" type="text/css" href="page.css" />
<div class="pagination">[prev-link]<[/prev-link] {pages} [next-link]>[/next-link]
</div>
<br style="clear:both" />

es hatt auch fast alles geklappt aber wenn ich z.B auf seite 1 bin funktioniert es dann nicht .
Dateianhänge
Unbenannt.jpg
Unbenannt.jpg (2.61 KiB) 202-mal betrachtet
joker
neu hier
 
Beiträge: 5
Registriert: 10.08.2011, 15:08

Re: Pagination

Beitragvon joker » 10.08.2011, 18:32

Kann mir wirklich niemand helfen?
joker
neu hier
 
Beiträge: 5
Registriert: 10.08.2011, 15:08

Re: Pagination

Beitragvon Azra » 11.08.2011, 10:53

Was genau funktioniert nicht, bzw. woher weißt du dass es ein CSS Fehler ist?
“HTML is the language for describing the structure of Web pages.”
“CSS is the language for describing the presentation of Web pages, including colors, layout, and fonts.”
Noch weitere Probleme? Kontakt über meine Webseite - simonduda.ch
Benutzeravatar
Azra
Stammuser
 
Beiträge: 422
Registriert: 04.02.2010, 08:36
Wohnort: (Alten)bochum

Re: Pagination

Beitragvon joker » 11.08.2011, 15:57

Meine aktive seite hat keinen rahmen und keinen farbe
joker
neu hier
 
Beiträge: 5
Registriert: 10.08.2011, 15:08

Re: Pagination

Beitragvon Azra » 12.08.2011, 13:15

joker hat geschrieben:Meine aktive seite hat keinen rahmen und keinen farbe

Das hier ist leider so ein Fall wo nur Code nicht reicht. Ich kann nicht nachvollziehen warum nur auf Seite 1 keinen Rahmen/Farbe zu sehen ist, daher müsste schon eine online Ansicht sinnvoll.

Oder einfach mal selber Firebug herunterladen und benutzen lernen.
“HTML is the language for describing the structure of Web pages.”
“CSS is the language for describing the presentation of Web pages, including colors, layout, and fonts.”
Noch weitere Probleme? Kontakt über meine Webseite - simonduda.ch
Benutzeravatar
Azra
Stammuser
 
Beiträge: 422
Registriert: 04.02.2010, 08:36
Wohnort: (Alten)bochum

Re: Pagination

Beitragvon joker » 12.08.2011, 16:25

Ich habe es geschafft jetzt funktioniert es aber ich habe jetzt ein weiteren problem ich will dass nur eine bestimmte Anzahl von Seiten angezeigt werden soll also z.B nur 8 seiten <12345678>
bei mir ist es aber 20 seiten <1234567891011121314151617181920>
joker
neu hier
 
Beiträge: 5
Registriert: 10.08.2011, 15:08

Re: Pagination

Beitragvon Azra » 15.08.2011, 07:09

Du musst begreifen dass hier noch keiner Hellsehen kann :wink:
Ich rate einfach mal und sage dir, dass diese Einstellung wahrscheinlich in JavaScript oder PHP gemacht werden muss.
“HTML is the language for describing the structure of Web pages.”
“CSS is the language for describing the presentation of Web pages, including colors, layout, and fonts.”
Noch weitere Probleme? Kontakt über meine Webseite - simonduda.ch
Benutzeravatar
Azra
Stammuser
 
Beiträge: 422
Registriert: 04.02.2010, 08:36
Wohnort: (Alten)bochum

Re: Pagination

Beitragvon joker » 15.08.2011, 19:00

<link rel="stylesheet" type="text/css" href="page.css" />
<div class="pagination">[prev-link]<[/prev-link] {pages} [next-link]>[/next-link]
</div>
<br style="clear:both" /> ich habe bei diesem script {pages} mit {newpages} verändert weil da steht {newpages} - Zeigt nur 3 Seiten in einer Zeit, jetzt zeigt es 3 seiten damit es 7 seiten anzeigt habe ich bei functions.php function newspagintation if($type == "newpages"){
$d = 1;
$newpages = '';
$maxtoshow = 7; gemacht da stant vorher $maxtoshow = 3;
jetzt zeigt es 7 seiten aber wenn ich zur nächste seite gehe funktionier die pagination style nicht mehr http://www.tube.bplaced.net/www.php mein test seite.
functions.php
Code: Alles auswählen
function newspagintation($type){
    global $amountofpages, $linkprefix, $page;
    if($type == "currentpage"){
        $currentpage = $page;
        return $currentpage;
    }
    if($type == "previouspage"){
        if($page <= 1){
            $previouspage = 1;
        }else{
            $previouspage = ($page - 1);
        }

        return $previouspage;
    }
    if($type == "nextpage"){
        $nextpage = ($page + 1);
        if($nextpage >= $amountofpages){
            $nextpage = $amountofpages;
        }else{

        }
        return $nextpage;
    }
    if($type == "pages"){
        $pages = '';
        $d = 1;
        while($d <= $amountofpages){
            if($amountofpages == 1){
            }else{
                if($d == $page){
                    $pages .= "<span class=\"n13_pages_active\">$d</span> ";
                }else{
                    if(FRIENDLY){
                        $pages .= sprintf("<a class=\"n13_pages_nonactive\" href=\"%s%s-%s-%s\">%s</a> ", PREFIX, '0', $d, NEWSSUFFIX, $d);
                    }else{
                        $pages .= sprintf("<a class=\"n13_pages_nonactive\" href=\"?%spage=%s\">%s</a> ", $linkprefix, $d, $d);
                    }
                }
            }
            $d++;
        }
        return $pages;
    }
    if($type == "newpages"){
        $d = 1;
        $newpages = '';
        $maxtoshow = 7;
        if($amountofpages <= $maxtoshow){
            while($d <= $amountofpages){
                if($amountofpages !== 1){
                    if($d == $page){
                        $newpages .= "<span class=\"n13_pages_active\">$d</span> ";
                    }else{
                        if(FRIENDLY){
                            $newpages .= sprintf("<a class=\"n13_pages_nonactive\" href=\"%s0-%s-%s\">%s</a> ", PREFIX, $d, NEWSSUFFIX, $d);
                        }else{
                            $newpages .= "<a class=\"n13_pages_nonactive\" href=\"?$linkprefix" . "page=$d\">$d</a> ";
                        }
                    }
                }
                $d++;
            }
        }else{
            if($page <= 1){
                $r = 1;
                while($r <= $maxtoshow){
                    if($r == $page){
                        $newpages .= "<span class=\"n13_pages_active\">$r</span> ";
                    }else{
                        if(FRIENDLY){
                            $newpages .= sprintf("<a class=\"n13_pages_nonactive\" href=\"%s0-1-%s\">%s</a> ", PREFIX, NEWSSUFFIX, $r);
                        }else{
                            $newpages .= sprintf("<a class=\"n13_pages_nonactive\" href=\"?%spage=%s\">%s</a> ", $linkprefix, $r, $r);
                        }
                    }
                $r++;
                }
            }elseif($page >= $amountofpages){
                $r = $page - $maxtoshow;
                while($r <= $amountofpages){
                    if($r == $page){
                        $newpages .= sprintf("<span class=\"n13_pages_active\">%s</span> ", $r);
                    }else{
                        if(FRIENDLY){
                            $newpages .= sprintf("<a class=\"n13_pages_nonactive\" href=\"%s0-%s-%s\">%s</a> ", PREFIX, $r, NEWSSUFFIX, $r);
                        }else{
                            $newpages .= sprintf("<a class=\"n13_pages_nonactive\" href=\"?%spage=%s\">%s</a> ", $linkprefix, $r, $r);
                        }
                    }
                $r++;
                }
            }else{
                $d = $page - 1;
                $r = 1;
                while($r <= $maxtoshow){
                    if($d == $page){
                        $newpages .= "class=\"n13_pages_active\">$d</span> ";
                    }else{
                        if(FRIENDLY){
                            $newpages .= sprintf("<a class=\"n13_pages_nonactive\" href=\"%s0-%s-%s\">%s</a> ", PREFIX, $d, NEWSSUFFIX, $d);
                        }else{
                            $newpages .= sprintf("<a class=\"n13_pages_nonactive\" href=\"?%spage=%s\">%s</a> ", $linkprefix, $d, $d);
                        }
                    }
                    $d++;
                    $r++;
                }
            }
        }
        return $newpages;
    }

    if($type == "firstpage"){
        # [firstpage] & [/firstpage]
        if($amountofpages == 1 || $page == 1){
            $firstpagelink = "";
        }else{
            if(FRIENDLY){
                $firstpagelink = sprintf("<a class=\"n13_pages_firstpage\" href=\"%s0-1-%s\"> ", PREFIX, NEWSSUFFIX);
            }else{
                $firstpagelink = sprintf("<a class=\"n13_pages_firstpage\" href=\"?%spage=1\"> ", $linkprefix);
            }
        }
        return $firstpagelink;
    }

    if($type == "prevlink"){
        # [prev-link] & [/prev-link]
        if($amountofpages == 1 || $page == 1){
            $plink = "";
        }else{
            $g = $page - 1;
            if(FRIENDLY){
                $plink = sprintf("<a class=\"n13_pages_prevlink\" href=\"%s0-%s-%s\"> ", PREFIX, $g, NEWSSUFFIX);
            }else{
                $plink = sprintf("<a class=\"n13_pages_prevlink\" href=\"?%spage=%s\"> ", $linkprefix, $g);
            }

        }
        return $plink;
    }

    if($type == "lastpage"){
        # [lastpage] & [/lastpage]
        if($amountofpages == $page || $amountofpages == 0){
            $lastpagelink = "";
        }else{
            $g = $page + 1;
            if(FRIENDLY){
                $lastpagelink = sprintf("<a class=\"n13_pages_lastpage\" href=\"%s0-%s-%s\">", PREFIX, $amountofpages, NEWSSUFFIX);
            }else{
                $lastpagelink = sprintf("<a class=\"n13_pages_lastpage\" href=\"?%spage=%s\">", $linkprefix, $amountofpages);
            }
        }
        return $lastpagelink;
    }

    if($type == "nextlink"){
        # [next-link] & [/next-link]
        if($amountofpages == $page || $amountofpages == 0){
            $nlink = "";
        }else{
            $g = $page + 1;
            if(FRIENDLY){
                $nlink = sprintf("<a class=\"n13_pages_nextlink\" href=\"%s0-%s-%s\">", PREFIX, $g, NEWSSUFFIX);
            }else{
                $nlink = sprintf("<a class=\"n13_pages_nextlink\" href=\"?%spage=%s\">", $linkprefix, $g);
            }
        }
        return $nlink;
    }

}
function formatcommentspagintation(){
    global $cpagintation, $plink, $firstpagelink, $nlink, $lastpagelink, $pages, $newpages, $ccurrentpage, $cpreviouspage, $cnextpage, $cpid, $cfriendlytitle;
    if(!$plink){
        $cpagintation = preg_replace('#\[prev-link\](.*?)\[\/prev-link\]#se','', $cpagintation);
    }
    if(!$firstpagelink){
        $cpagintation = preg_replace('#\[firstpage\](.*?)\[\/firstpage\]#se','', $cpagintation);
    }
    if(!$lastpagelink){
        $cpagintation = preg_replace('#\[lastpage\](.*?)\[\/lastpage\]#se','', $cpagintation);
    }
    if(!$nlink){
        $cpagintation = preg_replace('#\[next-link\](.*?)\[\/next-link\]#se','', $cpagintation);
    }
    $cpagintation = str_replace("[prev-link]", $plink,$cpagintation);
    $cpagintation = str_replace("[firstpage]", $firstpagelink,$cpagintation);

    if($plink == ""){
        $cpagintation = str_replace("[/prev-link]", "",$cpagintation);
        $cpagintation = str_replace("[/firstpage]", "",$cpagintation);
    }else{
        $cpagintation = str_replace("[/prev-link]", "</a>",$cpagintation);
        $cpagintation = str_replace("[/firstpage]", "</a>",$cpagintation);
    }
    $cpagintation = str_replace("[next-link]", $nlink,$cpagintation);
    $cpagintation = str_replace("[lastpage]", $lastpagelink,$cpagintation);
    if($nlink == ""){
        $cpagintation = str_replace("[/next-link]", "",$cpagintation);
        $cpagintation = str_replace("[/lastpage]", "",$cpagintation);
    }else{
        $cpagintation = str_replace("[/next-link]", "</a>",$cpagintation);
        $cpagintation = str_replace("[/lastpage]", "</a>",$cpagintation);
    }
    $cpagintation = str_replace("{pages}", $pages,$cpagintation);
    $cpagintation = str_replace("{newpages}", $newpages,$cpagintation);

    $cpagintation = str_replace("{currentpage}", $ccurrentpage, $cpagintation);
    $cpagintation = str_replace("{previouspage}", $cpreviouspage, $cpagintation);
    $cpagintation = str_replace("{nextpage}", $cnextpage, $cpagintation);
    $cpagintation = str_replace("{pid}", ID, $cpagintation);
    $cpagintation = str_replace("{friendlytitle}", $cfriendlytitle, $cpagintation);
    return $cpagintation;
}
function formatnewspagintation(){
    global $npagintation, $pages,$newpages,$firstpagelink,$plink,$lastpagelink,$nlink, $currentpage, $nextpage, $previouspage;
    if(!$plink){
        $npagintation = preg_replace('#\[prev-link\](.*?)\[\/prev-link\]#se','', $npagintation);
    }
    if(!$firstpagelink){
        $npagintation = preg_replace('#\[firstpage\](.*?)\[\/firstpage\]#se','', $npagintation);
    }
    if(!$lastpagelink){
        $npagintation = preg_replace('#\[lastpage\](.*?)\[\/lastpage\]#se','', $npagintation);
    }
    if(!$nlink){
        $npagintation = preg_replace('#\[next-link\](.*?)\[\/next-link\]#se','', $npagintation);
    }

    $npagintation = str_replace("[prev-link]", $plink,$npagintation);
    $npagintation = str_replace("[firstpage]", $firstpagelink,$npagintation);

    if($plink == ""){
        $npagintation = str_replace("[/prev-link]", "",$npagintation);
        $npagintation = str_replace("[/firstpage]", "",$npagintation);
    }else{
        $npagintation = str_replace("[/prev-link]", "</a>",$npagintation);
        $npagintation = str_replace("[/firstpage]", "</a>",$npagintation);
    }
    $npagintation = str_replace("[next-link]", $nlink,$npagintation);
    $npagintation = str_replace("[lastpage]", $lastpagelink,$npagintation);
    if($nlink == ""){
        $npagintation = str_replace("[/next-link]", "",$npagintation);
        $npagintation = str_replace("[/lastpage]", "",$npagintation);
    }else{
        $npagintation = str_replace("[/next-link]", "</a>",$npagintation);
        $npagintation = str_replace("[/lastpage]", "</a>",$npagintation);
    }
    $npagintation = str_replace("{pages}", $pages,$npagintation);
    $npagintation = str_replace("{newpages}", $newpages,$npagintation);

    $npagintation = str_replace("{currentpage}", $currentpage, $npagintation);
    $npagintation = str_replace("{previouspage}", $previouspage, $npagintation);
    $npagintation = str_replace("{nextpage}", $nextpage, $npagintation);
    return $npagintation;
}
function strip_only($str, $tags, $stripContent = false) {
    $content = '';
    if(!is_array($tags)) {
        $tags = (strpos($str, '>') !== false ? explode('>', str_replace('<', '', $tags)) : array($tags));
        if(end($tags) == '') array_pop($tags);
    }
    foreach($tags as $tag) {
        if ($stripContent)
            $content = '(.+</'.$tag.'[^>]*>|)';
        $str = preg_replace('#</?'.$tag.'[^>]*>'.$content.'#is', '', $str);
    }
    return $str;
}
function displayhtml($str){
    $str = str_replace("&","&amp;",$str);
    $str = str_replace("<","&lt;",$str);
    $str = str_replace(">","&gt;",$str);
    $str = str_replace("\"","&quot;",$str);
    return $str;
}
function addrating($parent, $value){
    ###update rating system
    if($value){
        $ip = $_SERVER['REMOTE_ADDR'];
        $alreadyrated = DataAccess::fetch("SELECT COUNT(uid) AS alreadyrated FROM " . NEWS_RATING . " WHERE ip = ? AND storyid = ?", $ip, $parent);
        $alreadyrated = $alreadyrated['0']['alreadyrated'];
        if($alreadyrated == (int)"1"){
            return "Already rated";
        }else{
            #make sure the user enters onl 1-5
            if($value == (int)"1" || $value == (int)"2" || $value == (int)"3" || $value == (int)"4" || $value == (int)"5"){
                #add rating
                DataAccess::put("INSERT INTO " . NEWS_RATING . " (vote,ip,storyid) VALUES (?, ?, ?)", $value, $ip, $parent);
                $average = DataAccess::fetch("SELECT avg(vote) AS average FROM " . NEWS_RATING . " WHERE storyid = ?", $parent);
                $average = $average['0']['average'];
                DataAccess::put("UPDATE " . NEWS_ARTICLES . " SET rating = ? WHERE id = ?", $average, $parent);
                return "Success";
            }else{
                #incase the user tries to post with a value other than 1-5
                #do nothing
                return false;
            }
        }
        #$ratingvalue = slash2($_POST['ratingvalue']);
        #echo $ratingvalue;
    }
}
function nothingtoseehere($str){
    //move along now
    return $str . base64_decode("PGRpdiBzdHlsZT0idGV4dC1hbGlnbjogY2VudGVyOyBmb250LWZhbWlseTogVmVyZGFuYTsgZm9udC1zaXplOiA4cHQiPlBvd2VyZWQgYnkgPGEgaHJlZj0iaHR0cDovL25ldHdvcmstMTMuY29tIj5OLTEzIE5ld3M8L2E+PC9kaXY+");
}
function dologout(){
    DataAccess::put("UPDATE " . NEWS_USERS . " SET cookie = ? , language = ? WHERE uid = ?", "", "", $_SESSION['uid']);
    setcookie('data', false);
    setcookie('name', false);
    setcookie('language', false);
    session_destroy();
    header ("Location: ?");
}
function setcookies($name,$uid,$language){
    $hash    = rand(0,9999999);
    $hash    = md5(SALT . $hash);
    if(!file_exists(ABSPATH . '/language/' . basename($_SESSION['language']) . '.php')){
        $language = 'English';
    }

    DataAccess::put("UPDATE " . NEWS_USERS . " SET cookie = ?, language = ? WHERE user = ?", $hash, $language, $name);
    setcookie("data", $hash, time()+60*60*24*90);
    setcookie("name", $name, time()+60*60*24*90);
    setcookie("language", $language, time()+60*60*24*90);
}

function checkcookie(){
    $_COOKIE['data']    = (empty($_COOKIE['data'])) ? '' : $_COOKIE['data'];

    $_COOKIE['name']    = (empty($_COOKIE['name'])) ? '' : $_COOKIE['name'];
    if($_COOKIE['data']){
        $data = $_COOKIE['data'];
        $user = $_COOKIE['name'];
        $cookie_exists = DataAccess::fetch("SELECT email, user, uid, language FROM " . NEWS_USERS . " WHERE user = ? AND cookie = ?", $user, $data);
        if(count($cookie_exists) > 0){
            $uid        = $cookie_exists['0']['uid'];
            $language    = $cookie_exists['0']['language'];
            $name        = $cookie_exists['0']['user'];
            $email        = $cookie_exists['0']['email'];
            $_SESSION['userlogged20']    = "true";
            $_SESSION['name']            = $name;
            $_SESSION['email']            = $email;
            $_SESSION['uid']            = $uid;
            $_SESSION['language']        = $language;
        }
    }
}


function uniqueid2(){
    $id = md5(uniqid(rand(), true));
    $id = md5($id);
    $id = substr($id,0,20);
    return $id;
}
function makefriendly($str){
    $str = str_replace("%20","-",$str);
    $str = preg_replace("/[^a-z\d]/i", "-", $str);
    $str = str_replace("--", "-", $str);
    $str = str_replace("--", "-", $str);
    $str = trim($str, "-");
    $str = $str . SUFFIX;
    return $str;
}
function ascii_encode($string) {
    $i = strlen($string);
    $s = 0;
    $encoded = '';
    while($s < $i){
    $encoded .= "&#" . ord(substr($string,$s)) . ";";
    $s++;
    }
    return $encoded;
}
function slash2($string) {
#    if(get_magic_quotes_gpc()) {
#        return $string;
#    }else{
#        return addslashes($string);
#    }
return $string;
}
function uniqueid(){
    $str = md5(uniqid(rand(), true));
    $str = substr($str,rand(0,16),16);
    return $str;
}
function bbcode($str,$usehtml,$style){
    global $image_clickable;
    $str = bb2html($str,$usehtml,$style);
    return $str;
}
function getsmilies(){
    $allsmilies = DataAccess::fetch("SELECT keycode,path FROM " . NEWS_SMILIES . " WHERE showhide = ? ORDER BY 0+ID", "1");
    $smilies = '';
    foreach($allsmilies AS $smiley){
        $smilies .= "<a href=\"javascript:insertsmiley('" . $smiley['keycode'] . "');\"><img border=\"0\" src=\"" . $smiley['path'] . "\" alt=\"" . $smiley['keycode'] . "\"></a>\n";
    }
    $jscript    = "\n<script type=\"text/javascript\">\n";
    $jscript    .= " //<![CDATA[\n";
    $jscript    .= " function insertsmiley(key){\n";
    $jscript    .= " document.commentsform.message.value=document.commentsform.message.value+' '+ key;\n";
    $jscript    .= " document.commentsform.message.focus();\n";
    $jscript    .= "}\n";
    $jscript    .= "//]]>";
    $jscript    .= "\n</script>\n";
    return $jscript . $smilies;
}

function allnews(){
    global $langmsg, $postids;
    $all = DataAccess::fetch("SELECT access, " . NEWS_USERS . ".uid, " . NEWS_ACCESS . ".accesslevel as accesslevel FROM " . NEWS_USERS . "
    LEFT JOIN " . NEWS_ACCESS . " ON " . NEWS_USERS . ".access = " . NEWS_ACCESS . ".uid
    WHERE user = ?", $_SESSION['name']);
    $all    = $all['0'];
    $access    = $all['accesslevel'];
    $id        = $all['uid'];
    if($_GET['archives'] == "true"){
        $showarchives = '1';
    }else{
        $showarchives = '0';
    }
    $_GET['filtercat'] = (empty($_GET['filtercat'])) ? '' : $_GET['filtercat'];
    if($access == "3"){
        if($_GET['filtercat']){
            $sql = "SELECT DISTINCT " . NEWS_ARTICLES . ".id FROM " . NEWS_ARTICLES . "
            LEFT JOIN " . NEWS_GROUPCATS . " ON " . NEWS_ARTICLES . ".id = " . NEWS_GROUPCATS . ".storyid
            WHERE archived = '$showarchives'";
            $sql .= " AND " . NEWS_GROUPCATS . ".type = 'news' AND " . NEWS_GROUPCATS . ".catid = ?";
            $allnews = DataAccess::fetch($sql, $_GET['filtercat']);
        }else{
            $sql = "SELECT DISTINCT " . NEWS_ARTICLES . ".id FROM " . NEWS_ARTICLES . "
            LEFT JOIN " . NEWS_GROUPCATS . " ON " . NEWS_ARTICLES . ".id = " . NEWS_GROUPCATS . ".storyid
            WHERE archived = '$showarchives'";
            $allnews = DataAccess::fetch($sql);
        }
    }elseif($access == 2){
        if($_GET['filtercat']){
            $sql = "SELECT DISTINCT " . NEWS_ARTICLES . ".id FROM " . NEWS_ARTICLES . "
            LEFT JOIN " . NEWS_USERS . " ON " . NEWS_ARTICLES . ".author = " . NEWS_USERS . ".uid
            LEFT JOIN " . NEWS_ACCESS . " ON " . NEWS_USERS . ".access = " . NEWS_ACCESS . ".uid
            LEFT JOIN " . NEWS_GROUPCATS . " ON " . NEWS_ARTICLES . ".id = " . NEWS_GROUPCATS . ".storyid
            WHERE (author = '$id' OR " . NEWS_ACCESS . ".accesslevel = '1') AND archived = '$showarchives'";
            $sql .= " AND " . NEWS_GROUPCATS . ".type = 'news' AND " . NEWS_GROUPCATS . ".catid = ?";
            $allnews = DataAccess::fetch($sql, $_GET['filtercat']);
        }else{
            $sql = "SELECT DISTINCT " . NEWS_ARTICLES . ".id FROM " . NEWS_ARTICLES . "
            LEFT JOIN " . NEWS_USERS . " ON " . NEWS_ARTICLES . ".author = " . NEWS_USERS . ".uid
            LEFT JOIN " . NEWS_ACCESS . " ON " . NEWS_USERS . ".access = " . NEWS_ACCESS . ".uid
            LEFT JOIN " . NEWS_GROUPCATS . " ON " . NEWS_ARTICLES . ".id = " . NEWS_GROUPCATS . ".storyid
            WHERE (author = '$id' OR " . NEWS_ACCESS . ".accesslevel = '1') AND archived = '$showarchives'";
            $allnews = DataAccess::fetch($sql);
        }
    }elseif($access == 1){
        if($_GET['filtercat']){
            $sql = "SELECT DISTINCT " . NEWS_ARTICLES . ".id FROM " . NEWS_ARTICLES . "
            LEFT JOIN " . NEWS_GROUPCATS . " ON " . NEWS_ARTICLES . ".id = " . NEWS_GROUPCATS . ".storyid
            WHERE author = '$id' AND archived = '$showarchives'";
            $sql .= " AND " . NEWS_GROUPCATS . ".type = 'news' AND " . NEWS_GROUPCATS . ".catid = ?";
            $allnews = DataAccess::fetch($sql, $_GET['filtercat']);
        }else{
            $sql = "SELECT DISTINCT " . NEWS_ARTICLES . ".id FROM " . NEWS_ARTICLES . "
            LEFT JOIN " . NEWS_GROUPCATS . " ON " . NEWS_ARTICLES . ".id = " . NEWS_GROUPCATS . ".storyid
            WHERE author = '$id' AND archived = '$showarchives'";
            $allnews = DataAccess::fetch($sql);
        }
    }

    $totalnews = count($allnews);
    $_SESSION['newsoptions'] = (empty($_SESSION['newsoptions'])) ? '' : $_SESSION['newsoptions'];
    if($_SESSION['newsoptions'] == true){
        $_POST['changeoptions'] = (empty($_POST['changeoptions'])) ? '' : $_POST['changeoptions'];
        if($_POST['changeoptions']){
            $_SESSION['amounttoshow']    = $_POST['newsoptions_amount'];
            $_SESSION['sortby']            = $_POST['newsoptions_sort'];
            $_SESSION['order']            = $_POST['newsoptions_order'];
            $_SESSION['newsoptions']    = true;
            $amounttoshow                = $_SESSION['amounttoshow'];
            $sortby                        = $_SESSION['sortby'];
            $order                        = $_SESSION['order'];
        }else{
            $amounttoshow    = $_SESSION['amounttoshow'];
            $sortby            = $_SESSION['sortby'];
            $order            = $_SESSION['order'];
            if(!$order){ $order = 'DESC'; }
        }
    }else{
        $_POST['changeoptions'] = (empty($_POST['changeoptions'])) ? '' : $_POST['changeoptions'];
        if($_POST['changeoptions']){
            $_SESSION['amounttoshow']    = $_POST['newsoptions_amount'];
            $_SESSION['sortby']            = $_POST['newsoptions_sort'];
            $_SESSION['order']            = $_POST['newsoptions_order'];
            $_SESSION['newsoptions']    = true;
            $amounttoshow                = $_SESSION['amounttoshow'];
            $sortby                        = $_SESSION['sortby'];
            $order                        = $_SESSION['order'];
        }else{
            $sortby                        = NEWS_ARTICLES . '.timestamp';
            $amounttoshow                = 15;
            $order                        = 'DESC';
            $_SESSION['order']            = $order;
            $_SESSION['newsoptions']    = true;
            $_SESSION['amounttoshow']    = $amounttoshow;
            $_SESSION['sortby']            = $sortby;
            $_SESSION['newsoptions']    = true;
        }
    }


    #$amounttoshow = 15;
    #$amounttoshow = $_POST['newsoptions_amount'];
    $_GET['page'] = (empty($_GET['page'])) ? '' : $_GET['page'];
    $page = $_GET['page'];
    $amountofpages = ceil($totalnews / $amounttoshow);
    if(!$page){
        $start = 0;
        $page = 1;
    }else{
        if(!is_numeric($page)){
            $page = 1;
        }
        if($page > $amountofpages){
            $start = 0;
            $page = 1;
        }else{
            $start = $page * $amounttoshow - $amounttoshow;
        }
    }

    if($access == "3"){
        $sql    = "SELECT DISTINCT title, story, shortstory, author, origauthor, ip, timestamp, allowcomments, short, approved, id, (SELECT COUNT(id) FROM " . NEWS_COMMENTS . " WHERE " . NEWS_COMMENTS . ".pid = " . NEWS_ARTICLES . ".id) AS numcomments,
                " . NEWS_ARTICLES . ".id AS postid, " . NEWS_ARTICLES . ".approved AS postapproved,
                (SELECT COUNT(uid) FROM " . NEWS_LINKEDFILES . " WHERE storyid = " . NEWS_ARTICLES . ".id) AS totalfiles,
                (SELECT " . NEWS_USERS . ".user FROM " . NEWS_USERS . " WHERE " . NEWS_USERS . ".uid = " . NEWS_ARTICLES . ".author) AS authorname,
                " . NEWS_USERS . ".user FROM " . NEWS_ARTICLES . "
                LEFT JOIN " . NEWS_USERS . " ON " . NEWS_ARTICLES . ".author = " . NEWS_USERS . ".uid
                LEFT JOIN " . NEWS_GROUPCATS . " ON " . NEWS_ARTICLES . ".id = " . NEWS_GROUPCATS . ".storyid
                WHERE archived = '$showarchives' ";
        if($_GET['filtercat']){
            $sql .= "AND " . NEWS_GROUPCATS . ".type = 'news' AND " . NEWS_GROUPCATS . ".catid = ?";
        }
        $sql .= " ORDER BY $sortby $order LIMIT $start, $amounttoshow";
    }elseif($access == "2"){
        $sql    = "SELECT DISTINCT title, story, shortstory, author, origauthor, ip, timestamp, allowcomments, short, approved, id, " . NEWS_ARTICLES . ".approved AS postapproved, (SELECT COUNT(id) FROM " . NEWS_COMMENTS . " WHERE " . NEWS_COMMENTS . ".pid = " . NEWS_ARTICLES . ".id) AS numcomments,
                " . NEWS_ARTICLES . ".id AS postid,
                (SELECT COUNT(uid) FROM " . NEWS_LINKEDFILES . " WHERE storyid = " . NEWS_ARTICLES . ".id) AS totalfiles,
                (SELECT " . NEWS_USERS . ".user FROM " . NEWS_USERS . " WHERE " . NEWS_USERS . ".uid = " . NEWS_ARTICLES . ".author) AS authorname,
                " . NEWS_USERS . ".user FROM " . NEWS_ARTICLES . "
                LEFT JOIN " . NEWS_USERS . " ON " . NEWS_ARTICLES . ".author = " . NEWS_USERS . ".uid
                LEFT JOIN " . NEWS_ACCESS . " on " . NEWS_USERS . ".access = " . NEWS_ACCESS . ".uid
                LEFT JOIN " . NEWS_GROUPCATS . " ON " . NEWS_ARTICLES . ".id = " . NEWS_GROUPCATS . ".storyid
                WHERE (author = '$id' OR " . NEWS_ACCESS . ".accesslevel = '1')
                AND archived = '$showarchives' ";
        if($_GET['filtercat']){
            $sql .= "AND " . NEWS_GROUPCATS . ".type = 'news' AND " . NEWS_GROUPCATS . ".catid = ?";
        }
        $sql .= " ORDER BY $sortby $order LIMIT $start, $amounttoshow";
    }elseif($access == "1"){
        $sql    = "SELECT DISTINCT title, story, shortstory, author, origauthor, ip, timestamp, allowcomments, short, approved, id, (SELECT COUNT(id) FROM " . NEWS_COMMENTS . " WHERE " . NEWS_COMMENTS . ".pid = " . NEWS_ARTICLES . ".id) AS numcomments,
                " . NEWS_ARTICLES . ".id AS postid, " . NEWS_ARTICLES . ".approved AS postapproved,
                (SELECT COUNT(uid) FROM " . NEWS_LINKEDFILES . " WHERE storyid = " . NEWS_ARTICLES . ".id) AS totalfiles,
                (SELECT " . NEWS_USERS . ".user FROM " . NEWS_USERS . " WHERE " . NEWS_USERS . ".uid = " . NEWS_ARTICLES . ".author) AS authorname,
                " . NEWS_USERS . ".user FROM " . NEWS_ARTICLES . "
                LEFT JOIN " . NEWS_USERS . " ON " . NEWS_ARTICLES . ".author = " . NEWS_USERS . ".uid
                LEFT JOIN " . NEWS_GROUPCATS . " ON " . NEWS_ARTICLES . ".id = " . NEWS_GROUPCATS . ".storyid
                WHERE author = '$id'
                AND archived = '$showarchives' ";
        if($_GET['filtercat']){
            $sql .= "AND " . NEWS_GROUPCATS . ".type = 'news' AND " . NEWS_GROUPCATS . ".catid = ?";
        }
        $sql .= " ORDER BY $sortby $order LIMIT $start, $amounttoshow";
    }
    $d = 1;
    $pages = '';
    while($d <= $amountofpages){
        if($amountofpages !== 1){
            if($d == $page){
                $pages .= "<span class=\"page2\">$d</span> ";
            }else{
                $pages .= "<a class=\"page1\" href=\"admin.php?action=editnews&filtercat=$_GET[filtercat]&archives=$_GET[archives]&page=$d\">$d</a> ";
            }
        }
        $d++;
    }
    if($amountofpages == 1 || $page == 1){
        $plink = "";
    }else{
        $g = $page - 1;
        $plink = "<a class=\"page1\" href=\"admin.php?action=editnews&filtercat=$_GET[filtercat]&archives=$_GET[archives]&page=$g\"><</a> ";
    }

    if($amountofpages == $page || $amountofpages == 0){
        $nlink = "";
    }else{
        $g = $page + 1;
        $nlink = "<a class=\"page1\" href=\"admin.php?action=editnews&filtercat=$_GET[filtercat]&archives=$_GET[archives]&page=$g\">></a>";
    }
    if($_GET['filtercat']){
        $allnews = DataAccess::fetch($sql, $_GET['filtercat']);
    }else{
        $allnews = DataAccess::fetch($sql);
    }
    $shownnews = count($allnews);
    $langmsg['editnews'][1] = $langmsg['editnews'][1] . " <b>$shownnews</b> " . $langmsg['editnews'][21] . " <b>$totalnews</b> " . $langmsg['editnews'][22];
    echo "<div onclick=\"toggle_section2('newsoptions')\" class=\"subheaders subheaders2 slink\" style=\"cursor: pointer\"><div style=\"float: right\">";

    echo "<span style=\"cursor: pointer; text-decoration: underline;\">".$langmsg['editnews'][2]."</span>&nbsp;</div>".$langmsg['editnews'][1]."</div><form style=\"margin: 0px\" method=\"POST\" name=\"editform\" id=\"editform\" action=\"?action=editnews&archives=" . $_GET['archives'] . "&filtercat=" . $_GET['filtercat'] . "\">\n";
    echo "<div class=\"subheaders_body displaytable\" style=\"";
    if($_POST['changeoptions']){
        echo "display: table";
    }else{
        echo "display: none;";
    }
    echo "text-align: left; margin-bottom: 18px; width: 691px\" id=\"section_newsoptions\">";
    if($_GET['archives']){ $archives = "true"; }else{ $archives = ''; }
    echo $langmsg['editnews'][25] . " <select onchange=\"editnews_filtercat('$archives');\" id=\"filter_cat\" style=\"margin-right: 6px; margin-top: -2px\" name=\"filter_cat\">";


    $allowedcats = DataAccess::fetch("SELECT " . NEWS_ACCESS . ".cats FROM " . NEWS_USERS . " LEFT JOIN " . NEWS_ACCESS . " ON " . NEWS_USERS . ".access = " . NEWS_ACCESS . ".uid WHERE " . NEWS_USERS . ".user = ?", $_SESSION['name']);
    $allowedcats = $allowedcats['0']['cats'];

    $d = '';
    if($allowedcats !== "all"){
        $a = explode(",",$allowedcats);
        foreach($a as $c){
            $d .= "id LIKE '$c' OR ";
        }
    $d = substr($d,0,(strlen($d) - 3));
    $d = "WHERE " . $d;
    }

    $sql = "SELECT * FROM " . NEWS_CATS . " $d ORDER BY name";

    $selcats = DataAccess::fetch($sql);
    echo "<option value=\"\"></option>";
    foreach($selcats AS $row){
        echo "<option value=\"$row[id]\"";
        if($_GET['filtercat'] == $row['id']){
            echo " selected=\"selected\"";
        }
        echo ">" . $row['name'] . "</option>";
    }

    echo "</select>";
    echo "<hr />";
    echo $langmsg['editnews'][3] . " <select name=\"newsoptions_amount\">";
    $amount = $_SESSION['amounttoshow'];
    for($i=1; $i<=50; $i++){
        echo "<option";
        if($amount == $i){
            echo " selected=\"selected\"";
        }
        echo " value=\"$i\">$i</option>";
    }
    $sort = $_SESSION['sortby'];
    echo "</select> ".$langmsg['editnews'][4]." <select name=\"newsoptions_sort\">";
    echo "<option value=\"" . NEWS_ARTICLES . ".timestamp\""; if($sort == NEWS_ARTICLES . ".timestamp"){ echo " selected=\"selected\""; } echo ">".$langmsg['selectfield'][11]."</option>";
    echo "<option value=\"" . NEWS_ARTICLES . ".title\""; if($sort == NEWS_ARTICLES . ".title"){ echo " selected=\"selected\""; } echo ">".$langmsg['selectfield'][12]."</option>";
    echo "<option value=\"" . NEWS_ARTICLES . ".author\""; if($sort == NEWS_ARTICLES . ".author"){ echo " selected=\"selected\""; } echo ">".$langmsg['selectfield'][13]."</option>";
    echo "<option value=\"numcomments\""; if($sort == "numcomments"){ echo " selected=\"selected\""; } echo ">".$langmsg['selectfield'][15]."</option>";
    echo "<option value=\"" . NEWS_ARTICLES . ".approved\""; if($sort == NEWS_ARTICLES . ".approved"){ echo " selected=\"selected\""; } echo ">Approval</option>";
    echo "</select>";
    echo " ".$langmsg['editnews'][5]." ";
    $order = $_SESSION['order'];
    echo "<select name=\"newsoptions_order\">";
    echo "<option value=\"ASC\""; if($order == "ASC"){ echo " selected=\"selected\""; } echo ">Ascending</option>";
    echo "<option value=\"DESC\""; if($order == "DESC"){ echo " selected=\"selected\""; } echo ">Descending</option>";
    echo "</select> <input type=\"submit\" name=\"changeoptions\" value=\"".$langmsg['submitfield'][0]."\" />";
    echo "<br><br></div>";


    $i = 0;
    $allcats = DataAccess::fetch("SELECT * FROM " . NEWS_CATS . "");
    $cats = array();
    foreach($allcats AS $row2){
        $cats[$i] = array("name" => $row2['name'], "id" => $row2['id']);
        $i++;
    }
    echo "<br />";
    echo "<table id=\"rows\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n";
    echo "<tr><td class=\"tableshead tablerightborder\"></td><td class=\"tableshead tablerightborder\" width=\"25%\">".$langmsg['editnews'][7]."</td><td class=\"tableshead tablerightborder\" width=\"20%\">".$langmsg['editnews'][8]."</td><td class=\"tableshead tablerightborder\" width=\"15%\"><a href=\"javascript:void(0); showalleditnewscats()\">".$langmsg['editnews'][9]."</a></td><td class=\"tableshead tablerightborder\" width=\"11%\">".$langmsg['editnews'][10]."&nbsp;</td><td width=\"15%\" class=\"tableshead tablerightborder\" >".$langmsg['editnews'][11]."</td><td width=\"15%\" class=\"tableshead tablerightborder\">".$langmsg['editnews'][12]."</td><td class=\"tableshead tablerightborder\"><input name=\"allcheck\" id=\"allcheck\" onclick=\"selectall()\" type=\"checkbox\" /></td></tr>\n";

    $tmpcolor = "1";
    $d = 1;
    $postids = array();
    foreach($allnews AS $row){
        if($tmpcolor == 1){
            $class = "row1";
            $tmpcolor = 2;
        }elseif($tmpcolor = 2){
            $class = "row2";
            $tmpcolor = 1;
        }
        echo "  <tr onmouseover=\"markfield('$d')\" onmouseout=\"unmarkfield('$d')\" id=\"$d\" class=\"$class\">\n";
        $numcomments = $row['numcomments'];
        if($row['allowcomments'] == "0"){
            $numcomments = $langmsg['editnews'][20];
        }
        $title = $row['title'];
        $totalfiles = $row['totalfiles'];
        $title = "$title";
        if($row['totalfiles'] > 0){
            $hasfiles = "<img class=\"slink\" src=\"http://forum.shiftdelete.net/images/icons/page_white_office.png\" onclick=\"showhideeditnewsfiles('files_" . $d . "')\" style=\"\" />";
        }else{
            $hasfiles = '';
        }
        echo "    <td class=\"tablebody tablerightborder\"><a href=\"?action=editnews&id=$row[postid]\"><img src=\"http://forum.shiftdelete.net/images/icons/pencil.png\" alt=\"Edit\" Title=\"Edit\" /></a>$hasfiles</td><td class=\"tablebody tablerightborder\"><div style=\"height: 17px; width: 136px; overflow: hidden\">$title</div></td><td class=\"tablebody tablerightborder\">";
        unset($hasfiles);
        if(!$row['user']){
            echo $row['origauthor'];
        }else{
            echo $row['user'];
        }
        if($row['postapproved'] == "1"){
            $approved = "<span style=\"color: #00AA00\">" . $langmsg['editnews'][14] . "</span>";
        }else{
            $approved = "<span style=\"color: #AA0000\">" . $langmsg['editnews'][15] . "</span>";
        }
        $groupcats         = DataAccess::fetch("SELECT * FROM " . NEWS_GROUPCATS . " WHERE type = ? AND storyid = ?", "news", $row['postid']);
        $catsperstory    = count($groupcats);
        $dcats = '';
        foreach($groupcats AS $row2){
            $dcats .= ":".$row2['catid'].":";
        }
        if(count($cats) > 0){
            foreach($cats as $cat){
                $dcats = str_replace(":" . $cat['id'] . ":",$cat['name'] .", ",$dcats);
            }
        }
        $dcats = substr($dcats,0,strlen($dcats) - 2);
        if($catsperstory > 0){
            $g = "<a href=\"#\" id=\"showcatlink_$row[postid]\" onclick=\"this.style.display = 'none'; document.getElementById('showcats_$row[postid]').style.display = '';\">".$langmsg['editnews'][13]."</a>";
        }else{
            $g = "<a href=\"#\" id=\"showcatlink_$row[postid]\" onclick=\"this.style.display = 'none'; document.getElementById('showcats_$row[postid]').style.display = '';\"></a>";
        }
        echo "</td><td class=\"tablebody tablerightborder\">$g<span style=\"display: none\" id=\"showcats_$row[postid]\">$dcats</span>";
        echo "</td><td class=\"tablebody tablerightborder\">" . date("d-m-y" ,$row['timestamp']) . "</td><td class=\"tablebody tablerightborder\">$approved</td><td align=center class=\"tablebody tablerightborder\"><a href=\"?action=editcomments&pid=$row[postid]\">$numcomments</a></td><td class=\"tablebody\"><input type=\"checkbox\" onclick=\"if(document.getElementById('check_'+$d).checked == true){ markfield('$d'); }else{ unmarkfield('$d') }\" value=\"$row[postid]\" id=\"check_$d\" name=\"selectedposts[]\">";
        echo "</td></tr>\n";
        if($row['totalfiles'] > 0){
            echo "<tr style=\"display: none\" id=\"files_$d\"><td style=\"\" style=\"background-color: #FFFFFF\" colspan=\"8\">";
            echo "<table width=\"100%\" cellpadding=\"0\" style=\"background-color: #FFFFFF\" cellspacing=\"0\">";
            echo "<tr><td class=\"tableshead tablerightborder\" style=\"width: 136px;\">" . $langmsg['uploadedfiles'][23] . "</td><td class=\"tableshead tablerightborder\" >" . $langmsg['uploadedfiles'][12] . "</td><td class=\"tableshead tablerightborder\" >" . $langmsg['uploadedfiles'][33] . "</td><td class=\"tableshead tablerightborder\" >" . $langmsg['uploadedfiles'][24] . "</td><td class=\"tableshead tablerightborder\" >" . $langmsg['uploadedfiles'][34] . "</td><td class=\"tableshead\" >" . $langmsg['uploadedfiles'][25];
            $files = DataAccess::fetch("SELECT title, url, filesize, downloadcount, author, timestamp FROM " . NEWS_FILES . " WHERE uid IN (SELECT fileid FROM " . NEWS_LINKEDFILES . " WHERE storyid = ?)", $row['postid']);
            foreach($files AS $file){
                echo "<tr>";
                echo "<td class=\"tablebody tablerightborder\">";
                #echo "<img src=\"http://forum.shiftdelete.net/images/icons/page_white_office.png\" style=\"postition: absolute; float: left; margin-left: -20px;\" />";
                echo $file['title'] . "</td>";
                echo "<td class=\"tablebody tablerightborder\">" . basename($file['url']) . "</td>";
                echo "<td class=\"tablebody tablerightborder\">" . $file['downloadcount'] . "</td>";
                echo "<td class=\"tablebody tablerightborder\">" . round($file['filesize'],1) . " KB</td>";
                echo "<td class=\"tablebody tablerightborder\">" . date("j-m-y",$file['timestamp']) . "</td>";
                $uploader = DataAccess::fetch("SELECT user FROM " . NEWS_USERS . " WHERE uid = ?", $file['author']);
                $uploader = $uploader['0']['user'];
                echo "<td class=\"tablebody\">$uploader</td>";
                echo "</tr>";
            }
            echo "</table>";
        }
        $d++;
        $postids[] = $row['postid'];
    }


    echo "</table>\n";
    echo "<div align=\"right\" style=\"float: right\">";
    echo "<select name=\"action\" id=\"action\" onclick=\"editnewsaction();\">";
    echo "<option value=\"\">".$langmsg['selectfield'][0]."</option>";
    echo "<option value=\"addtoarchive\">Add to archive</option>";
    echo "<option value=\"removefromarchive\">Remove from archive</option>";
    echo "<option value=\"allowcomments\">".$langmsg['selectfield'][5]."</option>";
    $canapprove = DataAccess::fetch("SELECT " . NEWS_ACCESS . ".canapprove FROM " . NEWS_USERS . " LEFT JOIN " . NEWS_ACCESS . " ON " . NEWS_USERS . ".access = " . NEWS_ACCESS . ".uid WHERE " . NEWS_USERS . ".user = ?", $_SESSION['name']);
    $canapprove = $canapprove['0']['canapprove'];
    if($canapprove == "1"){
        echo "<option value=\"changeapproval\">".$langmsg['selectfield'][6]."</option>";
    }
    echo "<option value=\"resetview\">" . $langmsg['selectfield'][20] . "</option>";
    echo "<option value=\"resetratings\">" . $langmsg['selectfield'][21] . "</option>";
    echo "<option value=\"delete\">".$langmsg['selectfield'][3]."</option>";
    echo "</select>&nbsp;";
    echo "<select style=\"margin-right: 2px; display: none\" id=\"allowcomments\" name=\"allowcomments\"><option value=\"1\">".$langmsg['selectfield'][1]."</option><option value=\"0\">".$langmsg['selectfield'][2]."</option><option value=\"2\">".$langmsg['selectfield'][4]."</option></select>";
    echo "<select id=\"approveaction\" style=\"margin-right: 2px; display: none\" name=\"approveaction\">";
    echo "<option value=\"1\">".$langmsg['selectfield'][9]."</option>";
    echo "<option value=\"0\">".$langmsg['selectfield'][10]."</option>";
    echo "</select>";
    echo "<input type=\"button\" value=\"".$langmsg['submitfield'][0]."\" class=\"nostyle\" onclick=\"doeditaction();\" name=\"S1\" /></div>";
    if($amountofpages > 1){
        echo "<br />";
        echo "<br />";
        echo "<div style=\"float: right\">$plink $pages $nlink</div>";
    }
    $_SESSION['formauth'] = md5(HASH . time());
    echo "<input type=\"hidden\" name=\"formauth\" value=\"" . $_SESSION['formauth'] . "\" />";
    echo "</form>\n";
}
function selectimages(){
    global $langmsg, $imageuploaddir, $imageupload_thumbnails;
    echo "<div style=\"display: none\" id=\"whichbox\">x</div>";
    echo "<div style=\"position: absolute; width: 580px; left: 35%; display: none; z-index: 10001\" id=\"imagebox\">";
    echo "<div style=\"width:580px; height: 340px; background-color: [URL=http://forum.shiftdelete.net/misc.php?do=dbtech_usertag_hash&hash=FFFFFF]#FFFFFF[/URL] padding: 10px; border: 1px solid [URL=http://forum.shiftdelete.net/misc.php?do=dbtech_usertag_hash&hash=AAAAAA]#AAAAAA[/URL] position: absolute; left: -190px\">";
    echo "<a style=\"float: right; text-decoration: underline; cursor: pointer\" onclick=\"bbcode('image','story')\">[close]</a><span class=\"header\" style=\"padding-left: 0px; background-color: #FFFFFF\">" . $langmsg['newsform'][23] . "</span>";
    echo "<hr />";
    echo "<input id=\"imageurl\" type=\"text\" style=\"width: 300px\" value=\"http://\" /> <input type=\"button\" onclick=\"insertimage(document.getElementById('whichbox').innerHTML,''+ document.getElementById('imageurl').value + ''); bbcode('image','')\" value=\"" . $langmsg['newsform'][24] . "\" />";

    echo "<br />";
    echo "<br />";
    echo "<span style=\"float: right\">";
    echo "<select name=\"news_selectcat\" onchange=\"newschangecatgroup();\" id=\"news_selectcat\">";
    echo "<option value=\"1\"></option>";

    $allowedcats = DataAccess::fetch("SELECT " . NEWS_ACCESS . ".cats FROM " . NEWS_USERS . " LEFT JOIN " . NEWS_ACCESS . " ON " . NEWS_USERS . ".access = " . NEWS_ACCESS . ".uid WHERE " . NEWS_USERS . ".user = ?", $_SESSION['name']);
    if($allowedcats['0']['cats'] !== "all"){
        $e = $allowedcats['0']['cats'];
        if(!$e){ $e = ''; }else{ $e = "WHERE id IN ($e)"; }
        $allcats = DataAccess::fetch("SELECT name, id FROM " . NEWS_CATS . " $e ORDER BY name");
    }else{
        $allcats = DataAccess::fetch("SELECT name, id FROM " . NEWS_CATS . " ORDER BY name");
    }

    $g = 2;
    foreach($allcats AS $row){
        echo "<option value=\"$g\"";
        $_GET['catid'] = (empty($_GET['catid'])) ? '' : $_GET['catid'];
        if(in_array($_GET['catid'], $allcats)){
            echo " selected=\"selected\"";
        }
        echo ">" . $row['name'] . "</option>";
        $g++;
    }

    echo "</select>";
    echo "</span>";
    echo "<span class=\"header\" style=\"background-color: [URL=http://forum.shiftdelete.net/misc.php?do=dbtech_usertag_hash&hash=FFFFFF]#FFFFFF[/URL] padding-left: 0px\">" . $langmsg['newsform'][25] . "</span>";
    echo '<hr style="clear: both; background-color: [URL=http://forum.shiftdelete.net/misc.php?do=dbtech_usertag_hash&hash=FFFFFF]#FFFFFF[/URL] color: [URL=http://forum.shiftdelete.net/misc.php?do=dbtech_usertag_hash&hash=FFFFFF]#FFFFFF[/URL] border: 1px solid #FFFFFF" />
    <hr style="clear: both;" />';


    $b = 0;
    echo "<div style=\"height: 225px; width: 580px; overflow: auto\">";

    // container for loading thumbnails
    echo "<div id=\"thumbnails_container\">";

    #get all images not assigned to cats
    echo "<div id=\"imagecat_1\">";
    #echo $xsql;
    $noncatimages = DataAccess::fetch("SELECT file,filesize,uploader,height,width,uid FROM " . NEWS_IMAGES . " WHERE uid NOT IN (SELECT storyid FROM " . NEWS_GROUPCATS . " WHERE type = 'image') ORDER BY uid DESC");
    $totalfilesize = 0;
    foreach($noncatimages AS $row){
        $file = $row['file'];
        list($width, $height, $type, $attr) = getimagesize($imageuploaddir . $file);
        if($width > 80 || $height > 80){
            $new_width    = $width;
            $new_height    = $height;
            $percent = 0.9;
            while($new_width > 80|| $new_height > 80){
                $new_width    = $width * $percent;
                $new_height    = $height * $percent;
                $percent    = $percent - 0.01;
            }
        }else{
            $new_width    = $width;
            $new_height    = $height;
        }

        $filesize = round(filesize($imageuploaddir . $file) / 1024,0);
        $totalfilesize += $filesize;
        $filesize .= " KB";
        $x = "http://" . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
        $x = str_replace(basename($_SERVER['REQUEST_URI']),SCRIPTPATH . 'uploads/' . $file,$x);

        echo '<div style="float: left; width: 112px; height: 130px"><div id="'.$b.'" class="thumbnail" style="cursor: pointer">';
        echo '<div style="text-align: left">';
?>
joker
neu hier
 
Beiträge: 5
Registriert: 10.08.2011, 15:08


Moderatoren: Laus, Moderatoren

Zurück zu: CSS für Fortgeschrittene

Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 2 Gäste