forked from npds/npds_dune
/
topics.php
53 lines (52 loc) · 2.31 KB
/
topics.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
<?php
/************************************************************************/
/* DUNE by NPDS */
/* =========================== */
/* */
/* Based on PhpNuke 4.x source code */
/* */
/* NPDS Copyright (c) 2002-2019 by Philippe Brunier */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/************************************************************************/
if (!function_exists("Mysql_Connexion"))
include ("mainfile.php");
settype($op,'string');
if ($op!="maj_subscribe") {
include("header.php");
$inclusion=false;
if (file_exists("themes/$theme/html/topics.html"))
$inclusion="themes/$theme/html/topics.html";
elseif (file_exists("themes/default/html/topics.html"))
$inclusion="themes/default/html/topics.html";
else
echo 'html/topics.html / not find !<br />';
if ($inclusion) {
ob_start();
include($inclusion);
$Xcontent=ob_get_contents();
ob_end_clean();
echo meta_lang(aff_langue($Xcontent));
}
include("footer.php");
} else {
if ($subscribe) {
if ($user) {
$result = sql_query("DELETE FROM ".$NPDS_Prefix."subscribe WHERE uid='$cookie[0]' AND topicid!='NULL'");
$result = sql_query("SELECT topicid FROM ".$NPDS_Prefix."topics ORDER BY topicid");
while(list($topicid) = sql_fetch_row($result)) {
if (isset($Subtopicid)) {
if (array_key_exists($topicid,$Subtopicid)) {
if ($Subtopicid[$topicid]=="on") {
$resultX = sql_query("INSERT INTO ".$NPDS_Prefix."subscribe (topicid, uid) VALUES ('$topicid','$cookie[0]')");
}
}
}
}
redirect_url("topics.php");
}
}
}
?>