-
Notifications
You must be signed in to change notification settings - Fork 0
/
advertise.php
executable file
·114 lines (105 loc) · 3.63 KB
/
advertise.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
<?php
require ( 'admin/coreclass.php' );
session_start();
$db = new database;
$x = new online_tracker;
$x->tracker();
$gerger = new gerger_timer();
$gerger->start();
$gerger->setprecision(4);
/**
* Get the active banner ads 148x300
*/
$banner = new rotate_banner();
$bannerdata = $banner->view_banner( '148x300' );
$ads148x300 = '';
if ( $bannerdata ) {
if ( checkhttptext( $bannerdata->banner_clickURL )){
$ads148x300 .= '<p><a href="' . $PHP_SELF . '?bannerID='. $bannerdata->bannerID .'">';
$ads148x300 .= '<img src="' . makeRelativePath( $bannerdata->banner_imageurl, 7) .'" border="0" width="130" ></a>';
$ads148x300 .= '</p>';
}
else{
$ads148x300 .= '<p><a href="' . $PHP_SELF . '?bannerID='. $bannerdata->bannerID .'">';
$ads148x300 .= '<img src="' . makeRelativePath( $bannerdata->banner_imageurl, 7) .'" border="0" width="130" ></a>';
$ads148x300 .= '</p>';
}
}
/**
* Get the sponsored links.., esp. the active clients
*/
$sql = " select website from corporate_partners cp ";
$sql .= " where cp.status = '1' ";
if (!($result = $db->query($sql))){
die('Error:'. $db->error());
}
$links = array();
while($links[] = $db->fetcharray());
$db->freeresult();
$sponsoredlinks = '';
$n = count($links)-1;
for( $i = 0; $i < $n; $i++ ){ // Count the active banners
foreach( $links as $field => $values ){
if ( $field == 'clientID' ) {
if ( checkhttptext( $links[$i]->website )){
$url =splithttptext($links[$i]->website);
$sponsoredlinks .= '<li><a href="' . $links[$i]->website . '">' . $url[1] . '</a></li>';
}
else{
$sponsoredlinks .= '<li><a href="http://' . $links[$i]->website . '">' . $links[$i]->website . '</a></li>';
}
}
}
}
/**
* obtain list of the category
*/
$sql = "select * from category order by category_name ASC";
if (!($result = $db->query($sql))){
die('Error:'. $db->error());
}
$categories = array();
while($categories[] = $db->fetcharray());
$totalcategories = count($categories);
$categorylist = '';
for( $i = 0; $i < $totalcategories-1; $i++ ) {
foreach($categories as $field => $value){
if ($field == 'category_name'){
$categorylist .= '<li><a href="' . VIEW_CATEGORY_URL . $categories[$i]->categoryID.'">'.$categories[$i]->category_name.'</a></li>';
}
}
}
/*
* Get the default stylesheets
*/
include( 'admin/template.configuration.php' );
$stylesheet = ' themes/'.$default_template_name.'/'.$default_template_stylesheet;
$db->close();
$gerger->stop();
$pagegenerated = $gerger->display();
// Generate the page now
$tpl = new template_parser( 'themes/templates/advertise.tpl.php' );
$tags = array(
'{DATELINE}' => niceDate( $headline[0]->dateline ) ,
'{ARTICLEID}' => $headline[0]->articleID ,
'{HEADLINE}' => $headline[0]->title ,
'{AUTHOR}' => 'By '. getArticle_authors_info( $headline[0]->articleID, 'fullname' ) . ' / BR</p>' ,
'{ARTICLE_BODY}' => makeAShortIntro( strip_tags($headline[0]->article_body)) ,
'{PHOTO}' => $photo,
'{VIEW_ARTICLE_URL}' => $my_profile[0]->homeaddress ,
'{OTHER_HEADLINES}' => $other_headlines ,
'{OTHER_TOPSTORIES}' => $other_topstories ,
'{QUOTE_OF_THE_DAY}' => $quote ,
'{SUBSECTIONS}' => $subsections ,
'{ADS_148x300}' => $ads148x300 ,
'{MESSAGE}' => $message,
'{PAGE_GENERATED}' => ' '.$pagegenerated,
'{SPONSORED_LINKS}' => $sponsoredlinks ,
'{SUBSECTIONS}' => $subsections ,
'{CATEGORY}' => $categorylist ,
'{FOOTER}' => 'themes/templates/footer.tpl.php' ,
'{STYLESHEET}' => $stylesheet
);
$tpl->parse_template( $tags );
print $tpl->display();
?>