3 include('.\..\..\..\..\config.php');
\r
5 include_once ($DIR_PLUGINS.'gallery/config.php');
\r
10 $query = 'CREATE TABLE IF NOT EXISTS '.sql_table('plug_gallery_views').' ( '.
\r
11 'vpictureid int unsigned not null, '.
\r
12 'views int unsigned )';
\r
15 $query = 'CREATE TABLE IF NOT EXISTS '.sql_table('plug_gallery_views_log').' ( '.
\r
16 'vlpictureid int unsigned not null, '.
\r
23 if ($manager->pluginInstalled('NP_gallery'))
\r
25 $plugin =& $manager->getPlugin('NP_gallery');
\r
26 if ($plugin != NULL)
\r
27 if($plugin->getoption('deletetables')) $plugin->createOption('deletetables',__NPG_OPT_DONT_DELETE_TABLES,'yesno','no');
\r
31 if (!$NPG_CONF['viewtime']) setNPGoption('viewtime', 30 * 60);
\r
35 $query = 'CREATE TABLE IF NOT EXISTS '.sql_table('plug_gallery_template_desc').' ( '.
\r
36 'tdid int unsigned not null auto_increment PRIMARY KEY, '.
\r
37 'tdname varchar(20), '.
\r
38 'tddesc varchar(200) )';
\r
41 //if it already exists and there are no rows already, then add default
\r
42 $query = 'select * from '.sql_table('plug_gallery_template_desc');
\r
43 $res = sql_query($query);
\r
44 if(!mysql_num_rows($res)) {
\r
45 $query = 'insert into '.sql_table('plug_gallery_template_desc').' (tdid, tdname, tddesc) values (NULL, "061default", "default templates from 0.61")';
\r
47 $new_id = mysql_insert_id();
\r
48 if(!$NPG_CONF['template']) setNPGOption('template', $newid);
\r
51 //change previous template table and add reference to template_desc
\r
52 $query = 'show columns from '.sql_table('plug_gallery_template').' like "tdesc"';
\r
53 $res = sql_query($query);
\r
54 if(!mysql_num_rows($res)) {
\r
55 $query = 'ALTER TABLE '.sql_table('plug_gallery_template').
\r
56 ' add column tdesc int unsigned first ';
\r
58 if(!$new_id) $new_id = 1;
\r
59 $query = 'UPDATE '.sql_table('plug_gallery_template').' set tdesc = '.$new_id;
\r
64 $query = 'show columns from '.sql_table('plug_gallery_comment').' like "cuser"';
\r
65 $res = sql_query($query);
\r
66 if(!mysql_num_rows($res)) {
\r
67 $query = 'ALTER TABLE '.sql_table('plug_gallery_comment').
\r
68 ' add column cuser varchar(40), '.
\r
69 ' add column cmail varchar(100), '.
\r
70 ' add column chost varchar(60), '.
\r
71 ' add column cip varchar(15)';
\r
76 $query = 'show columns from '.sql_table('plug_gallery_album').' like "commentsallowed"';
\r
77 $res = sql_query($query);
\r
78 if(!mysql_num_rows($res)) {
\r
79 $query = 'ALTER TABLE '.sql_table('plug_gallery_album').
\r
80 ' add column commentsallowed tinyint DEFAULT 1 ';
\r
85 if (!NPG_TEMPLATE::exists('default075')) {
\r
86 $template = new NPG_TEMPLATE(NPG_TEMPLATE::createnew('default075','default 0.75 templates'));
\r
87 if(!$NPG_CONF['template']) setNPGOption('template', $template->getID());
\r
89 $name = 'LIST_HEADER';
\r
90 $content = '<%breadcrumb%><hr/><table width=100% ><thead>'
\r
91 .'<tr><th><a href="<%sortbytitle%>">Title</a></th>'
\r
92 .'<th><a href="<%sortbydescription%>">Description</a></th>'
\r
93 .'<th><a href="<%sortbyowner%>">Owner</a></th>'
\r
94 .'<th><a href="<%sortbymodified%>">Last Modified</a></th>'
\r
95 .'<th><a href="<%sortbynumber%>">Images</a></th></tr></thead><tbody>';
\r
96 $template->setTemplate($name, $content);
\r
98 $name = 'LIST_BODY';
\r
99 $content = '<tr><td><a href="<%albumlink%>"><%title%></a></td>'
\r
100 .'<td><%description%></td>'
\r
101 .'<td><%ownername%></td>'
\r
102 .'<td><%modified%></td>'
\r
103 .'<td><%numberofimages%></td></tr>';
\r
104 $template->setTemplate($name, $content);
\r
106 $name = 'LIST_FOOTER';
\r
107 $content = '</tbody></table><hr/><br />'
\r
108 .'<%if(canaddalbum)%>'
\r
109 .'<a href="<%addalbumlink%>">Add New Album | </a>'
\r
111 .'<%if(canaddpicture)%>'
\r
112 .'<a href="<%addpictureslink%>"onclick="window.open(this.href,\'addpicture\',\'status=no,toolbar=no,scrollbars=no,resizable=yes,width=600,height=400\');return false;">'
\r
113 .' Add Pictures</a>'
\r
115 $template->setTemplate($name, $content);
\r
118 $name = 'ALBUM_HEADER';
\r
119 $content = '<%breadcrumb%><hr/><div id="NPG_thumbnail"><ul class="thumbnail">';
\r
120 $template->setTemplate($name, $content);
\r
122 $name = 'ALBUM_BODY';
\r
123 $content = '<li><a href="<%picturelink%>"><img style="<%centeredtopmargin(140,-10)%>" src="<%thumbnail%>" /></a><br/><%picturetitle%><br/><%pictureviews%> views</li>';
\r
124 $template->setTemplate($name, $content);
\r
126 $name = 'ALBUM_FOOTER';
\r
127 $content = '</ul></div><div id="NPG_footer"><br /><hr/>'
\r
128 .'<%if(caneditalbum)%>'
\r
129 .'<a href="<%editalbumlink%>">Modify Album </a> | '
\r
131 .'<%if(canaddpicture)%>'
\r
132 .'<a href="<%addpicturelink%>"onclick="window.open(this.href,\'imagepopup\',\'status=no,toolbar=no,scrollbars=no,resizable=yes,width=480,height=360\');return false;">Add Picture</a>'
\r
135 $template->setTemplate($name, $content);
\r
138 $name = 'ITEM_HEADER';
\r
139 $content = '<%breadcrumb%><br/><a href="<%previouslink%>"> Previous |</a><a href="<%nextlink%>"> Next</a><hr/><div id="NPG_picture">';
\r
140 $template->setTemplate($name, $content);
\r
142 $name = 'ITEM_BODY';
\r
143 $content = '<a href="<%fullsizelink%>" onclick="window.open(this.href,\'imagepopup\',\'status=no,toolbar=no,scrollbars=auto,resizable=yes,width=<%width%>,height=<%height%>\');return false;">'
\r
144 .'<img src="<%intermediatepicture%>" /></a>';
\r
145 $template->setTemplate($name, $content);
\r
147 $name = 'ITEM_FOOTER';
\r
148 $content = '</div><div id="NPG_footer"><br /><%description%><br/><br/>Last modified by <%owner%> on <%date%> '
\r
149 .'<%if(caneditpicture)%>'
\r
150 .'<a href="<%editpicturelink%>">Edit</a>'
\r
151 .' | <a href="<%deletepicturelink%>">Delete</a>'
\r
154 .'<div class="contenttitle"><h2>Comments</h2></div><%comments%>'
\r
155 .'<div class="contenttitle"><h2>Add Comment</h2></div><%commentform%>';
\r
156 $template->setTemplate($name, $content);
\r
158 $name = 'COMMENT_BODY';
\r
159 $content = '<div class="itemcomment id<%memberid%>">'
\r
160 .'<h3><a href="<%userlinkraw%>"'
\r
161 .'title="<%ip%> | Click to visit <%user%>\'s website or send an email">'
\r
162 .'<%user%></a> wrote:</h3>'
\r
163 .'<div class="commentbody">'
\r
164 .'<%body%></div><div class="commentinfo"><%date%> <%time%></div></div>' ;
\r
165 $template->setTemplate($name, $content);
\r
168 setNPGoption('currentversion',75);
\r
170 include('np_gallery_update075.php');
\r