C:\xampp\htdocs\kptv2\ro\items.tpl.php


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
<?php
    
if(!array_key_exists('pg'$_GET)) {
        
header("location:index.php");
        exit();
    }

      require_once(
$LIBPATH "utilfunc.php");

    require_once(
"../conf_/siteconf_.php");

    require_once(
"../admin/dbconn.php");

        
    
$id $_GET['id'];
    
$mid $_GET['mid'];
    
$oid $_GET['oid'];
    
        
    if(
$dbConn) {

        
$sqlToLink "SELECT * FROM items WHERE MID = $mid AND Activs = 1 ORDER BY OrderID DESC, ID DESC LIMIT 1";
        
$res0 = @mysql_query($sqlToLink);
        
        
$sql "SELECT * FROM items WHERE ID = $id";

        
$res1 = @mysql_query($sql);
        
        
//urmatorul    //merge
        
$sql2 "SELECT * FROM items WHERE MID = $mid AND ID!=$id AND OrderID <= $oid AND Activs = 1 ORDER BY OrderID DESC, ID DESC LIMIT 1";
        
        
//antariorul
        
$sqlP "SELECT * FROM items WHERE MID = $mid AND OrderID >= $oid AND ID!=$id AND Activs = 1 ORDER BY OrderID ASC, ID ASC LIMIT 1 ";
        
            
        
$resP = @mysql_query($sqlP);
        
$rowTestP = @mysql_fetch_row($resP);
        
        
$res2 = @mysql_query($sql2);
        
$rowTest mysql_fetch_row($res2);
        
        
//anteriorul
        
if ($rowTestP)
        {
            
//echo "cseles";
            
$return['0']['id']    =    $rowTestP['0'];
            
$return['0']['oid']    =    $rowTestP['5'];
            
//echo $return['0']['id'];
            
if ($return['0']['id'] < $id && $return['0']['oid'] == $oid){
                
$sqlP "SELECT * FROM items WHERE MID = $mid AND ID>$id AND OrderID >= $oid AND Activs = 1 ORDER BY OrderID ASC, ID ASC LIMIT 1 ";
                
                
$resP = @mysql_query($sqlP);
                
$rowTestP2 = @mysql_fetch_row($resP);
                if (!
$rowTestP2)
                {
                    
//echo "nincs";
                    
$sqlP "SELECT * FROM items WHERE MID = $mid AND ID<$id AND OrderID > $oid AND Activs = 1 ORDER BY OrderID ASC, ID ASC LIMIT 1 ";
                }
                
//echo "test";
            
}
        }
                        
        
//urmatorul //merge
        
if ($rowTest)
        {
            
$return['0']['id']    =    $rowTest['0'];
            
$return['0']['oid']    =    $rowTest['5'];
            
//echo $return['0']['id'];
            
if ($return['0']['id'] > $id && $return['0']['oid'] == $oid)
                
$sql2 "SELECT * FROM items WHERE MID = $mid AND ID<$id AND OrderID <= $oid AND Activs = 1 ORDER BY OrderID DESC, ID DESC LIMIT 1";
        }        
        
//echo $sql2;        
        
        //merge    
        
$res2 = @mysql_query($sql2);
        
$resP = @mysql_query($sqlP);
        for(
$i=0;$i<=1;$i++){

            
$row0    mysql_fetch_row($res0);
            
$row     mysql_fetch_row($res1);
            
$row2     mysql_fetch_row($res2);
            
$rowP     mysql_fetch_row($resP);
            
            
$return0[$i]['id']             = $row0['0'];
            
$return0[$i]['oid']         = $row0['5'];
              
            
$return[$i]['id']             = $row['0'];
            
$return[$i]['titlu']         = $row['1'];
            
$return[$i]['contentro']    = $row['2'];
            
$return[$i]['datas']         = $row['3'];
            
            
//anteriorul
            
$return3[$i]['id']     = $rowP['0'];
            
$return3[$i]['oid']    = $rowP['5'];    
            
//urmatorul
            
$return2[$i]['id']     = $row2['0'];
            
$return2[$i]['oid'] = $row2['5'];    
            
        }
        
   }
    
    
//$title .=" - ".$ra_page[0]->NameRO;

?>


<main class="page">
    <section class="adr2 breadcrumbs">
        <a href="index.php" class="adr2">
            Home
        </a>
         &raquo;
        <a href="index.php?pg=items&id=<?= $return0['0']['id'];?>&mid=<?= $mid;?>&oid=<?= $return0['0']['oid'];?> " class="adr2">
            <?php if ($mid==1) echo "Headlines"; else if($mid==2) echo "History"; else if ($mid==3) echo "Rock info"?>
        </a>
         &raquo;
        <?= $return['0']['titlu']; ?>
    </section>
    <section><?= $return['0']['contentro']; ?></section>
    <section id="page_buttons">
        <? if ($return3['0']['id']) { ?>
            <a href="index.php?pg=items&amp;id=<?= $return3['0']['id']; ?>&amp;mid=<?= $mid?>&amp;oid=<?= $return3['0']['oid']; ?>">
                <img src="../ro/images/icon-back.png" data-srcover="../ro/images/icon-back_w.png"alt="Click inapoi">
            </a>
        <? ?>
        <? if ($return2['0']['id']) {    ?>
            <a href="index.php?pg=items&amp;id=<?= $return2['0']['id']; ?>&amp;mid=<?= $mid?>&amp;oid=<?= $return2['0']['oid']; ?>">
                <img class="image_button" src="../ro/images/icon-next.png" data-srcover="../ro/images/icon-next_w.png" alt="Click inainte">
            </a>
        <? ?>
    </section>
</main>
x

Windows NT KPTV 6.2 build 9200 (Windows Server 2012 Datacenter Edition) i586