PHP - error al instalar script openlist

 
Vista:
Imágen de perfil de javi
Val: 74
Ha aumentado 1 puesto en PHP (en relación al último mes)
Gráfica de PHP

error al instalar script openlist

Publicado por javi (33 intervenciones) el 19/05/2020 19:35:21
script; openlist (directorio clasificados similar a craigslist)

http://azat-co.github.io/openlist/

mensaje de error en navegador al instalarlo con xampp

http://localhost/openlist/install.php

Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /opt/lampp/htdocs/openlist/install.php:439 Stack trace: #0 {main} thrown in /opt/lampp/htdocs/openlist/install.php on line 439

/opt/lampp/htdocs/openlist/class/systemconsts.class.php

código original


1
2
3
4
5
6
7
8
9
<?php
class SystemConsts {
	const DB='test',
	HOST='localhost',
    DSN='mysql:dbname=test;host=localhost',
    USERNAME='root',
	PASSWORD='root';
}
?>

código modificado, evidentemente donde pone nombre de la base de datos y contraseña he puesto los datos correspondientes no los textos que se leen y el código puesto es todo el existente en este archivo

1
2
3
4
5
6
7
8
9
<?php
class SystemConsts {
	const DB='nombre de la base de datos',
	HOST='localhost',
    	DSN='mysql:dbname=dbone;host=localhost',
    	USERNAME='root',
	PASSWORD='contraseña';
}
?>

/opt/lampp/htdocs/openlist/install.php

línea 439, código sin tocar nada


$link=mysql_connect(SystemConsts::HOST, SystemConsts::USERNAME, SystemConsts::PASSWORD) or die(mysql_error());

/opt/lampp/htdocs/openlist/class/config.php

en línea 20 lo he probado con ruta original
define('SITE_URL','http://localhost/');
y ruta real xampp
define('SITE_URL','http://localhost/openlist/');

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
<?php
	error_reporting(0);//TODO: uncomment in prod
	define('DEFAULT_LANGUAGE','en.lang.php');
	// define('DEFAULT_LANGUAGE','ru.lang.php');
	//$page_limit=20;
	//$date_limit=60;
	define ('CONF_PAGE_LIMIT',100);  //number of ad per page
	define ('CONF_DATE_LIMIT',60); //limit after how many days ad won't show
	date_default_timezone_set('Europe/London');
	// date_default_timezone_set('Europe/Moscow');
	// define ('CONF_LANG','ru');
	define ('CONF_LANG','en-us');
 
	define('CONF_ENC','UTF-8');
	define('DATE_FORMAT','d/m/Y');
	//define(DATE_FORMAT,, d л Y');
	define('PHOTO_SIZE_LIMIT','50000');
	define ('PHOTO_TYPES','jpg,jpeg,pjpeg,gif,png,bmp,tiff');
 
	define('SITE_URL','http://localhost/');
	// define('SITE_URL','http://openlist.co/');
	define('TPL_PATH','tpl/');
 
	define('ADMIN_EMAIL','admin@openList.co');
	define('MONSTER_EMAIL','monster@openList.co');
	define('LOG_EMAIL','log@openList.co');
	define('CONF_VERSION_LANG','');
 
?>

instrucciones script

### Installation

1. Download application/package
1. Modify _class/systemconsts.class.php_ with your database parameters
1. Run _install.php_
1. Point localhost to your folder or change _class/config.php_ with a new host name
1. View application at localhost or your custom host name (*it will be pre-populated with data*)
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
Imágen de perfil de Joel
Val: 3.828
Oro
Ha mantenido su posición en PHP (en relación al último mes)
Gráfica de PHP

error al instalar script openlist

Publicado por Joel (1269 intervenciones) el 20/05/2020 09:58:17
Las funciones mysql_... ya no existe en PHP 7...

Tendras que utilizar PHP 5.x para poder utilizarlo... puedes crear un fork y actualizarlo a mysqli_... o PDO!!!
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
Imágen de perfil de javi
Val: 74
Ha aumentado 1 puesto en PHP (en relación al último mes)
Gráfica de PHP

error al instalar script openlist

Publicado por javi (33 intervenciones) el 20/05/2020 14:21:04
ok, muchas gracias, en el servidor creo que si puedo elegir versión de php ¿pero en xampp se puede?, (en realidad uso lampp, ubuntu)
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
Imágen de perfil de javi
Val: 74
Ha aumentado 1 puesto en PHP (en relación al último mes)
Gráfica de PHP

error al instalar script openlist

Publicado por javi (33 intervenciones) el 20/05/2020 22:18:49
solucionado, he desinstalado el xampp actual con PHP 7 y he instalado uno antiguo con PHP 5, muchas gracias por la solución Joel
la verdad es que ni siquiera esperaba que alguien se molestara en contestar, saludos.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
Imágen de perfil de joel
Val: 3.828
Oro
Ha mantenido su posición en PHP (en relación al último mes)
Gráfica de PHP

error al instalar script openlist

Publicado por joel (1269 intervenciones) el 21/05/2020 07:59:28
Me alegro que te sirviera... gracias por comentarlo
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
Imágen de perfil de javi
Val: 74
Ha aumentado 1 puesto en PHP (en relación al último mes)
Gráfica de PHP

error al instalar script openlist

Publicado por javi (33 intervenciones) el 22/05/2020 06:27:15
éste es otro script (ArticleSetUp) pero le pasaba lo mísmo sinembargo al instalarlo con xampp (php versión 5.6.3) me salen un montón de errores y al instalarlo en distintos servidores gratis de ifastnet tanto manualmente como con softaculous se instala correctamente sin errores
¿cual podría ser la causa?

ArticleSetup Installation (Step 1 of 2)

Notice: Undefined index: error in /opt/lampp/htdocs/articlesetup/install/index.php on line 501

Notice: Undefined index: error in /opt/lampp/htdocs/articlesetup/install/index.php on line 503

Site Name: <br /><b>Notice</b>: Undefined variable: oldname in <b>/opt/lampp/htdocs/articlesetup/install/index.php</b> on line <b>516</b><br />

Site URL: <br /><b>Notice</b>: Undefined variable: oldemail in <b>/opt/lampp/htdocs/articlesetup/install/index.php</b> on line <b>519</b><br />

Admin Email: <br /><b>Notice</b>: Undefined variable: oldname in <b>/opt/lampp/htdocs/articlesetup/install/index.php</b> on line <b>523</b><br />

Admin Name: <br /><b>Notice</b>: Undefined variable: oldname in <b>/opt/lampp/htdocs/articlesetup/install/index.php</b> on line <b>526</b><br />
-------------------------------------------------------------------------------------------------------------------------------
ArticleSetup Installation (Step 2 of 2)

Notice: Uninitialized string offset: 36 in /opt/lampp/htdocs/articlesetup/install/index.php on line 18

Notice: Undefined variable: string in /opt/lampp/htdocs/articlesetup/install/index.php on line 18

Notice: Uninitialized string offset: 36 in /opt/lampp/htdocs/articlesetup/install/index.php on line 18
------------------------------------------------------------------------------------------------------------------------------------------------------
página inicial web ya instalada

Notice: Undefined variable: sitetitle in /opt/lampp/htdocs/articlesetup/index.php on line 4

Notice: Undefined index: valid_user in /opt/lampp/htdocs/articlesetup/header.php on line 8

Notice: A session had already been started - ignoring session_start() in /opt/lampp/htdocs/articlesetup/header.php on line 66

Notice: A session had already been started - ignoring session_start() in /opt/lampp/htdocs/articlesetup/sidebar.php on line 8

Notice: Undefined variable: output in /opt/lampp/htdocs/articlesetup/sidebar.php on line 54

Notice: Undefined index: ipp in /opt/lampp/htdocs/articlesetup/paginator.php on line 25

Notice: Undefined index: page in /opt/lampp/htdocs/articlesetup/paginator.php on line 35

Notice: Undefined index: ipp in /opt/lampp/htdocs/articlesetup/paginator.php on line 82

Notice: Undefined index: ipp in /opt/lampp/htdocs/articlesetup/paginator.php on line 83

Notice: Undefined variable: allrows in /opt/lampp/htdocs/articlesetup/index.php on line 137

Notice: A session had already been started - ignoring session_start() in /opt/lampp/htdocs/articlesetup/rightsidebar.php on line 75

Notice: Undefined variable: rightcatoutput in /opt/lampp/htdocs/articlesetup/rightsidebar.php on line 135
----------------------------------------------------------------------------------------------------------------------------------------------------------------
ARCHIVOS

/opt/lampp/htdocs/articlesetup/install/index.php

/opt/lampp/htdocs/articlesetup/index.php

/opt/lampp/htdocs/articlesetup/header.php

/opt/lampp/htdocs/articlesetup/sidebar.php

/opt/lampp/htdocs/articlesetup/paginator.php

/opt/lampp/htdocs/articlesetup/rightsidebar.php
--------------------------------------------------------------------------
CODIGOS ARCHIVOS
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
Imágen de perfil de joel
Val: 3.828
Oro
Ha mantenido su posición en PHP (en relación al último mes)
Gráfica de PHP

error al instalar script openlist

Publicado por joel (1269 intervenciones) el 22/05/2020 10:48:26
Hola Javi, fijate que todo son Notice... notificaciones... nada importante.

En algunos servidores te aparece y otros no, ya que depende de la configuración del PHP... en unos tiene indicado que no muestre los "Notice" y en otros si.

Simplemente modifica tu php.ini para que no los muestre y listo.

aquí tienes como hacerlo: https://www.lawebdelprogramador.com/foros/PHP/1714254-Notice-Use-of-undefined-constant-var_usuario-assumed.html#i1714316
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
Imágen de perfil de javi
Val: 74
Ha aumentado 1 puesto en PHP (en relación al último mes)
Gráfica de PHP

error al instalar script openlist

Publicado por javi (33 intervenciones) el 22/05/2020 14:30:22
muchas gracias Joel, he modificado lo que me has dicho de 2 archivos en varias líneas

php.ini
php.ini-pre1.7.2

ha desaparecido todo pero ahora aparece ésto

Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /opt/lampp/htdocs/articlesetup/config.php on line 7


/opt/lampp/htdocs/articlesetup/config.php

<?php
$db_name ="dbone"; /** The name of the database for this install */
$dbusername = "root"; /** MySQL database username */
$dbpassword = ""; /** MySQL database password */
$server = "localhost:8080"; //** Probably don't need to change this */

7 $connection = mysql_connect($server, $dbusername, $dbpassword) or die(mysql_error());
$db = mysql_select_db($db_name,$connection)or die(mysql_error());
?>
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
Imágen de perfil de joel
Val: 3.828
Oro
Ha mantenido su posición en PHP (en relación al último mes)
Gráfica de PHP

error al instalar script openlist

Publicado por joel (1269 intervenciones) el 22/05/2020 22:31:16
Si, ese es otro mensaje... son los DEPRECATED... te esta indicando que estas utilizando comandos que van a desaparecer... exactamente en PHP7 ya no estaran.

Si quieres quitar los deprecated, es el mismo proceso que para los Noticia... tienes que añadir los DEPRECATED para que no te los muestre
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
Imágen de perfil de javi
Val: 74
Ha aumentado 1 puesto en PHP (en relación al último mes)
Gráfica de PHP

error al instalar script openlist

Publicado por javi (33 intervenciones) el 22/05/2020 22:34:42
1
error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED

así parece funcionar, muchas gracias Joel y perdona por las molestias, saludos

supongo que en el servidor real no hará falta hacer ésto...
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
1
Comentar
Imágen de perfil de joel
Val: 3.828
Oro
Ha mantenido su posición en PHP (en relación al último mes)
Gráfica de PHP

error al instalar script openlist

Publicado por joel (1269 intervenciones) el 23/05/2020 09:00:40
Exacto, así es perfecto!!
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
Imágen de perfil de javi
Val: 74
Ha aumentado 1 puesto en PHP (en relación al último mes)
Gráfica de PHP

error al instalar script openlist

Publicado por javi (33 intervenciones) el 22/05/2020 06:30:21
/opt/lampp/htdocs/articlesetup/install/index.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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
<?php
	include ('../config.php');
 
if(isset($_POST['create'])) {
 
		$sitename = $_POST['sitename'];
		$siteurl = $_POST['siteurl'];
		$name = mysql_real_escape_string($_POST['name']);
		$email = mysql_real_escape_string($_POST['email']);
		$pass1 = $_POST['pass1'];
		$pass2 = $_POST['pass2'];
		$avatar = "http://www.gravatar.com/avatar/".md5( strtolower( trim( $email ) ) )."?d=".$siteurl."/images/avatar.png&s=90";
 
		function genRandomString() {
    $length = 10;
    $characters = '0123456789abcdefghijklmnopqrstuvwxyz';
    for ($p = 0; $p < $length; $p++) {
18      $string .= $characters[mt_rand(0, strlen($characters))];
    }
    return $string;
	}
	$universalid = genRandomString();
 
 
	if (!$sitename || !$siteurl || !$name || !$email) {
		header('Location: index.php?error=missing');
		exit();
	}
 
 
	if ($pass1 != $pass2) {
		header('Location: index.php?error=nomatch');
		exit();
	}
 
 
 
// CREATE TABLES
 
		// adboxes
		$sql = "CREATE TABLE IF NOT EXISTS `adboxes` (
  `id` int(8) NOT NULL AUTO_INCREMENT,
  `adcode` text COLLATE utf8_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`) );";
		$query = mysql_query($sql);
 
		// admins
		$sql = "CREATE TABLE IF NOT EXISTS `admins` (
  `id` int(8) NOT NULL AUTO_INCREMENT,
  `email` varchar(256) COLLATE utf8_unicode_ci NOT NULL,
  `username` varchar(128) COLLATE utf8_unicode_ci NOT NULL,
  `password` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
  `name` varchar(128) COLLATE utf8_unicode_ci NOT NULL,
  `avatar` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`) );";
		$query = mysql_query($sql);
 
		//  articles
		$sql = "CREATE TABLE IF NOT EXISTS `articles` (
  `id` int(16) NOT NULL AUTO_INCREMENT,
  `status` int(1) NOT NULL,
  `authorid` int(16) NOT NULL,
  `date` datetime NOT NULL,
  `title` varchar(256) COLLATE utf8_unicode_ci NOT NULL,
  `categoryid` int(8) NOT NULL,
  `parentid` int(8) DEFAULT NULL,
  `body` text COLLATE utf8_unicode_ci NOT NULL,
  `resource` text COLLATE utf8_unicode_ci NOT NULL,
  `problem` text COLLATE utf8_unicode_ci,
  PRIMARY KEY (`id`));";
		$query = mysql_query($sql);
 
		//  articleviews
		$sql = "CREATE TABLE IF NOT EXISTS `articleviews` (
  `articleid` int(11) NOT NULL,
  `views` int(11) NOT NULL,
  PRIMARY KEY (`articleid`) ) ;";
		$query = mysql_query($sql);
 
		//  authors
		$sql = "CREATE TABLE IF NOT EXISTS `authors` (
  `id` int(16) NOT NULL AUTO_INCREMENT,
  `status` int(1) NOT NULL DEFAULT '0',
  `email` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
  `username` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
  `password` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
  `fname` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
  `displayname` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
  `bio` text COLLATE utf8_unicode_ci,
  `url` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL,
  `gravatar` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `mailopt` int(1) NOT NULL,
  PRIMARY KEY (`id`) ); ";
		$query = mysql_query($sql);
 
		//  categories
		$sql = "CREATE TABLE IF NOT EXISTS `categories` (
  `id` int(8) NOT NULL AUTO_INCREMENT,
  `parentid` int(8) DEFAULT NULL,
  `name` varchar(256) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id`));";
		$query = mysql_query($sql);
 
		//  comments
		$sql = "CREATE TABLE IF NOT EXISTS `comments` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `author` varchar(24) COLLATE utf8_unicode_ci NOT NULL,
  `email` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
  `comment` text COLLATE utf8_unicode_ci NOT NULL,
  `created_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `parent_id` int(11) NOT NULL DEFAULT '0',
  `post_id` int(11) NOT NULL DEFAULT '0',
  `accepted` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `parent` (`parent_id`,`id`)
  ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;";
		$query = mysql_query($sql);
 
		//  pages
		$sql = "CREATE TABLE IF NOT EXISTS `pages` (
  `id` int(8) NOT NULL AUTO_INCREMENT,
  `title` varchar(256) COLLATE utf8_unicode_ci NOT NULL,
  `body` text COLLATE utf8_unicode_ci NOT NULL,
  `onmenu` int(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)) ;";
		$query = mysql_query($sql);
 
		//  settings
		$sql = "CREATE TABLE IF NOT EXISTS `settings` (
  `title` varchar(256) COLLATE utf8_unicode_ci NOT NULL,
  `url` varchar(256) COLLATE utf8_unicode_ci NOT NULL,
  `minwords` int(8) NOT NULL,
  `maxwords` int(8) NOT NULL,
  `template` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
  `logourl` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL,
  `comments` int(1) NOT NULL,
  `commentmod` int(1) NOT NULL,
  `emailopt` int(1) NOT NULL,
  `skipqueue` int(1) NOT NULL,
  `distribution` int(1) NOT NULL,
  `universalid` varchar(16) DEFAULT NULL,
  `statcode` text COLLATE utf8_unicode_ci) ;";
		$query = mysql_query($sql);
 
 
// INSERT DATA INTO TABLES
 
		// admin
		$sql = "INSERT INTO `admins` VALUES (NULL, '".$email."', 'admin', '".md5($pass1)."', '".$name."', '".$avatar."');";
		$query = mysql_query($sql);
 
		// author (admin account)
		$sql = "INSERT INTO `authors` VALUES (NULL, 0, '".$email."', 'admin', '".md5($pass1)."', '".$name."', '".$name."', 'N/A', '".$siteurl."', '".$avatar."', 0);";
		$query = mysql_query($sql);
 
		// site settings
		$sql = "INSERT INTO `settings` VALUES ('".$sitename."', '".$siteurl."', 1, 1500, 'classic', NULL, 0, 0, 0, 1, 0, '".$universalid."', NULL);";
		$query = mysql_query($sql);
 
 
		// setup blank ad slots
		$sql = "INSERT INTO `adboxes` (`id`, `adcode`) VALUES  (1, '<img src=\"".$siteurl."/images/250.gif\" />'), (2, '<img src=\"".$siteurl."/images/468.gif\" />'), (3, '<img src=\"".$siteurl."/images/125.gif\" />');";
		$query = mysql_query($sql);
 
 
		// Insert Categories
		$sql = "INSERT INTO `categories` (`id`, `parentid`, `name`) VALUES
(1, NULL, 'Internet Business'),
(2, NULL, 'Arts & Entertainment'),
(3, NULL, 'Business'),
(4, NULL, 'Communications'),
(5, NULL, 'Computers'),
(6, NULL, 'Environment'),
(7, NULL, 'Fashion'),
(8, NULL, 'Finance'),
(9, NULL, 'Food & Beverage'),
(10, NULL, 'Health & Fitness'),
(11, NULL, 'Home & Family'),
(12, NULL, 'Politics'),
(13, NULL, 'Product Reviews'),
(14, NULL, 'Sports & Recreation'),
(15, NULL, 'Reference & Education'),
(16, NULL, 'Self Improvement'),
(17, NULL, 'Society'),
(18, NULL, 'Travel & Leisure'),
(19, NULL, 'Transportation'),
(20, NULL, 'Writing & Speaking'),
(21, 1, 'Ecommerce'),
(22, 1, 'Affiliate Programs'),
(23, 1, 'Auctions'),
(24, 1, 'Blogging'),
(25, 1, 'Domains'),
(26, 1, 'Ebooks'),
(27, 1, 'Email Marketing'),
(28, 1, 'Forums'),
(29, 1, 'Internet Marketing'),
(30, 1, 'Podcasts'),
(31, 1, 'PPC Advertising'),
(32, 1, 'RSS'),
(33, 1, 'Security'),
(34, 1, 'SEO'),
(35, 1, 'Site Promotion'),
(36, 1, 'Spam'),
(37, 1, 'Traffic Generation'),
(38, 1, 'Web Design'),
(39, 1, 'Web Hosting'),
(40, 2, 'Photography'),
(41, 2, 'Celebrities'),
(42, 2, 'Humanities'),
(43, 2, 'Humor'),
(44, 2, 'Music'),
(45, 2, 'Poetry'),
(46, 3, 'Advertising'),
(47, 3, 'Article Marketing'),
(48, 3, 'Careers'),
(49, 3, 'Customer Service'),
(50, 3, 'Entrepreneurs'),
(51, 3, 'Ethics'),
(52, 3, 'Home Based Business'),
(53, 3, 'Management'),
(54, 3, 'Marketing'),
(55, 3, 'Networking'),
(56, 3, 'Public Relations'),
(57, 3, 'Sales'),
(58, 3, 'Small Business'),
(59, 4, 'Broadband Internet'),
(60, 4, 'GPS'),
(61, 4, 'Mobile Phones'),
(62, 4, 'Satellite Radio'),
(63, 4, 'Satellite TV'),
(64, 4, 'Video Conferencing'),
(65, 4, 'VOIP'),
(66, 5, 'Computer Certification'),
(67, 5, 'Data Recovery'),
(68, 5, 'Games'),
(69, 5, 'Hardware'),
(70, 5, 'Networks'),
(71, 5, 'Software'),
(72, 5, 'Mobile'),
(73, 6, 'Agriculture'),
(74, 6, 'Green Living'),
(75, 7, 'Clothing'),
(76, 7, 'Jewelry'),
(77, 7, 'Runway'),
(78, 7, 'Shoes'),
(79, 8, 'Credit'),
(80, 8, 'Currency Trading'),
(81, 8, 'Debt Consolidation'),
(82, 8, 'Fundraising'),
(83, 8, 'Insurance'),
(84, 8, 'Investing'),
(85, 8, 'Investments'),
(86, 8, 'Leasing'),
(87, 8, 'Loans'),
(88, 8, 'Mortgage'),
(90, 8, 'Mutual Funds'),
(91, 8, 'Personal Finance'),
(92, 8, 'Real Estate'),
(93, 8, 'Stock Market'),
(94, 8, 'Taxes'),
(95, 8, 'Wealth Building'),
(96, 9, 'Coffee'),
(97, 9, 'Cooking'),
(98, 9, 'Gourmet'),
(99, 9, 'Recipes'),
(100, 9, 'Waiting Tables'),
(101, 9, 'Wine'),
(102, 10, 'Acne'),
(103, 10, 'Alternative Medicine'),
(104, 10, 'Beauty'),
(105, 10, 'Cardio'),
(106, 10, 'Depression'),
(107, 10, 'Diabetes'),
(108, 10, 'Exercise'),
(109, 10, 'Fitness Equipment'),
(110, 10, 'Hair Loss'),
(111, 10, 'Medicine'),
(112, 10, 'Meditation'),
(113, 10, 'Mens Issues'),
(114, 10, 'Muscle Building'),
(115, 10, 'Nutrition'),
(116, 10, 'Pollution'),
(117, 10, 'Supplements'),
(118, 10, 'Weight Loss'),
(119, 10, 'Womens Issues'),
(120, 10, 'Yoga'),
(121, 10, 'Disease'),
(122, 10, 'Cancer'),
(123, 11, 'Home Security'),
(124, 11, 'Babies'),
(125, 11, 'Crafts'),
(126, 11, 'Elderly Care'),
(127, 11, 'Gardening'),
(128, 11, 'Hobbies'),
(129, 11, 'Holidays'),
(130, 11, 'Home Improvement'),
(131, 11, 'Interior Design'),
(132, 11, 'Kids'),
(133, 11, 'Landscaping'),
(134, 11, 'Parental Care'),
(135, 11, 'Parenting'),
(136, 11, 'Pets'),
(137, 11, 'Pregnancy'),
(138, 12, 'Commentary'),
(139, 12, 'Current Events'),
(140, 12, 'History'),
(141, 13, 'Consumer Electronics'),
(142, 13, 'Digital Products'),
(143, 13, 'Movie Reviews'),
(144, 13, 'Music Reviews'),
(145, 14, 'Biking'),
(146, 14, 'Extreme'),
(147, 14, 'Fishing'),
(148, 14, 'Football'),
(149, 14, 'Gambling & Casinos'),
(150, 14, 'Golf'),
(151, 14, 'Hunting'),
(152, 14, 'Martial Arts'),
(153, 14, 'Running'),
(154, 14, 'Surfing'),
(155, 14, 'Tennis'),
(156, 15, 'Adult'),
(157, 15, 'College'),
(158, 15, 'Environmental'),
(159, 15, 'Homeschooling'),
(160, 15, 'K-12 Education'),
(161, 15, 'Language'),
(162, 15, 'Legal'),
(163, 15, 'Philosophy'),
(164, 15, 'Psychology'),
(165, 15, 'Science'),
(166, 15, 'Sociology'),
(167, 15, 'Weather'),
(168, 16, 'Attraction'),
(169, 16, 'Coaching'),
(170, 16, 'Creativity'),
(171, 16, 'Goal Setting'),
(172, 16, 'Grief'),
(173, 16, 'Happiness'),
(174, 16, 'Innovation'),
(175, 16, 'Inspirational'),
(176, 16, 'Leadership'),
(177, 16, 'Motivation'),
(178, 16, 'Organizing'),
(179, 16, 'Spirituality'),
(180, 16, 'Stress Management'),
(181, 16, 'Success'),
(182, 16, 'Time Management'),
(183, 17, 'Dating'),
(184, 17, 'Divorce'),
(185, 17, 'Marriage'),
(186, 17, 'Relationships'),
(187, 17, 'Religion'),
(188, 17, 'Sexuality'),
(189, 17, 'Weddings'),
(190, 18, 'Aviation'),
(191, 18, 'Boating'),
(192, 18, 'Cruises'),
(193, 18, 'Destinations'),
(194, 18, 'Outdoors'),
(195, 18, 'Travel Tips'),
(196, 18, 'Vacations'),
(197, 19, 'Boats'),
(198, 19, 'Cars'),
(199, 19, 'Motorcycles'),
(200, 19, 'RVs'),
(201, 19, 'Trucks-SUVS'),
(202, 20, 'Article Writing'),
(203, 20, 'Book Reviews');";
		$query = mysql_query($sql);
 
 
// Post to Synergy
 
	$post_data['siteurl'] = $siteurl;
	$post_data['sitename'] = $sitename;
	$post_data['universalid'] = $universalid;
 
	//traverse array and prepare data for posting (key1=value1)
	foreach ( $post_data as $key => $value) {
		$post_items[] = $key . '=' . $value;
	}
 
	//create the final string to be posted using implode()
	$post_details = implode ('&', $post_items);
 
	//create cURL connection
	$curl_connection = curl_init('http://www.articlesynergy.com/listener.php');
 
	//set options
	curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30);
	curl_setopt($curl_connection, CURLOPT_USERAGENT,
	  "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");
	curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true);
	curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false);
	curl_setopt($curl_connection, CURLOPT_FOLLOWLOCATION, 0);
 
	//set data to be posted
	curl_setopt($curl_connection, CURLOPT_POSTFIELDS, $post_details);
 
	//perform our request
	$result = curl_exec($curl_connection);
 
	//close the connection
	curl_close($curl_connection);
 
?>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
 
	<title>ArticleSetup Installation</title>
 
	<style type="text/css">
		body { background: #ddd; font-family:Verdana, sans-serif;font-size:12px;line-height:16px;color:#222; }
		#container     { left: 50%; margin-left: -275px; position: relative; width: 550px; padding: 10px; background: white;}
		a:link, a:visited { color: #396EB7; text-decoration: none; }
		a:hover { text-decoration: underline; }
		p {line-height: 1.4em; font-size: 1em; padding: 5px 0 8px 5px; margin: 0; color: #666;}
		h1 { color: #333;font-size: 18px; color: #666; font-weight:lighter; margin:0 0 10px; padding: 10px 0; border-bottom: 1px solid #ECE8DA;}
		#footer	       { width:540px; border-top: 2px solid #F3F1E9; margin: 10px 0; height: 25px; padding: 5px;}
 
		#submitstyle { background-color:#f5f5f5;  border:1px solid #dedede;  border-top:1px solid #eee;    border-left:1px solid #eee;     font-family:"Lucida Grande", Tahoma, Arial, Verdana, sans-serif;    font-size:12px;    line-height:130%;    text-decoration:none;    font-weight:bold;    color:#336699;     cursor:pointer;     padding:5px 10px 6px 7px; /* Links */ }
 
 		#submitstyle:hover {     background-color:#dff4ff;   border:1px solid #c2e1ef;   color:#336699; }
		label { color: #666; float:left; width: 125px; padding: 5px 0;}
		input { color: #666; background: #fff; padding: 5px; border: 1px solid #ccc; }
 
	</style>
 
 
</head>
 
<body>
 
<div id="container">
 
<!-- CONTENT AREA -->
<div id="content">
 
 
<h1>ArticleSetup Installation (Step 2 of 2)</h1>
 
<p><b>Success!</b> <?php echo $sitename; ?> has been successfully installed. There are a few final steps you need to take: </p>
 
<p><b>Delete the install directory</b> - For security reasons, it's very important that you delete this /install folder in your server before you begin using your new directory. </p>
<p><b>Login to the admin dashboard</b> - ArticleSetup includes a fully-featured admin control panel that allows you to manage and monitor every aspect of your directory. The admin panel can be found at: <a href="<?php echo $siteurl; ?>/admin"><?php echo $siteurl; ?>/admin</a> and you will login with the username: <b>admin</b> and the password you chose on the previous page.</p>
<p><b>Polish your site's settings</b> - Once you've become comfortable with your admin panel, navigate to the site settings panel. From here, you can upload a logo, manage email settings, add stat tracking code and more. </p>
<p>Finally, if you need any support, feel free to visit our support forums at: <a href="http://articlesetup.com/forums">http://articlesetup.com/forums</a> for fast support. Thanks again for installing ArticleSetup, and good luck with your new directory! </p>
<?php } else { ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<title>ArticleSetup Installation</title>
	<style type="text/css">
		body { background: #ddd; font-family:Verdana, sans-serif;font-size:12px;line-height:16px;color:#222; }
		#container     { left: 50%; margin-left: -275px; position: relative; width: 550px; padding: 10px; background: white;}
		a:link, a:visited { color: #396EB7; text-decoration: none; }
		a:hover { text-decoration: underline; }
		p {line-height: 1.4em; font-size: 1em; padding: 5px 0 8px 5px; margin: 0; color: #666;}
		h1 { color: #333;font-size: 18px; color: #666; font-weight:lighter; margin:0 0 10px; padding: 10px 0; border-bottom: 1px solid #ECE8DA;}
		#footer	       { width:540px; border-top: 2px solid #F3F1E9; margin: 10px 0; height: 25px; padding: 5px;}
		#submitstyle { background-color:#f5f5f5;  border:1px solid #dedede;  border-top:1px solid #eee;    border-left:1px solid #eee;     font-family:"Lucida Grande", Tahoma, Arial, Verdana, sans-serif;    font-size:12px;    line-height:130%;    text-decoration:none;    font-weight:bold;    color:#336699;     cursor:pointer;     padding:5px 10px 6px 7px; /* Links */ }
 		#submitstyle:hover {     background-color:#dff4ff;   border:1px solid #c2e1ef;   color:#336699; }
		label { color: #666; float:left; width: 125px; padding: 5px 0;}
		input { color: #666; background: #fff; padding: 5px; border: 1px solid #ccc; }
	</style>
</head>
<body>
<div id="container">
<!-- CONTENT AREA -->
<div id="content">
	<h1>ArticleSetup Installation (Step 1 of 2)</h1>
				<?php
501	if($_GET["error"] == "nomatch") 
		echo '<p  style=" padding-left: 15px; color: red;">Passwords didn\'t Match</p>';
503	if($_GET["error"] == "missing")
		echo '<p  style="color: red; padding-left: 15px; color: red;">Please complete all fields</p>';
?>
 
 
<p><b>Welcome to Article Setup!</b> The installation process was designed to be simple, fast, and totally painless. Your brand new article directory should be up and running in less than 5 minutes. Let's get started!</p>
<p><b>NOTE</b> At this point, you should have already uploaded all files into your server, setup a fresh database, and entered your database information into the config.php file on your server. If you haven't already, please complete those steps before continuing.</p>
 
	<br/>
	<form style="padding-left: 15px;" name="submission" method="POST" action="index.php">
 
	<label>Site Name:</label>
516	<input type="text" name="sitename" style="width: 250px;" value="<?php echo $oldname; ?>">
	<br/>
	<label>Site URL:</label>
519	<input type="text" name="siteurl" style="width: 250px;" value="<?php echo $oldemail; ?>">
	<p style="font-size: .9em; padding: 0 35px 0 125px;"><em>NOTE: Site URL <u>must</u> be in exactly the following format: <b>http://www.example.com</b> OR <b>http://example.com</b> (no trailing slashes)</em></p>
	<br/>
	<label>Admin Email:</label>
523	<input type="text" name="email" style="width: 250px;" value="<?php echo $oldname; ?>">
	<br/>
	<label>Admin Name:</label>
526	<input type="text" name="name" style="width: 250px;" value="<?php echo $oldname; ?>">
	<br/>
	<label>Admin Username:</label>
	<p>admin</p>
	<label>Admin Password:</label>
	<input type="password" name="pass1" style="width: 250px;">
	<br/>
	<label>Password (again):</label>
	<input type="password" name="pass2" style="width: 250px;">
	<br/>
 
	<input name="create" type="hidden" id="create" />
	<div style="clear:both"></div>
	<br/><br/>
	<button type="submit" id="submitstyle">Continue to Step 2 &raquo;</button>
 
</form>
 
<?php } ?>
 
</body>
</html>
 
</div>
 
 
 
<!-- FOOTER -->
<div id="footer">
	<div style="float:right"><p>&copy; 2011 - ArticleSetup.com<br/></p></div>
</div>
 
 
</div>  <!-- close Container -->
 
</body>
</html>
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
Imágen de perfil de javi
Val: 74
Ha aumentado 1 puesto en PHP (en relación al último mes)
Gráfica de PHP

error al instalar script openlist

Publicado por javi (33 intervenciones) el 22/05/2020 06:32:57
/opt/lampp/htdocs/articlesetup/index.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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<?php
 
$cathead = 0;
4 $metatitle = $sitetitle;
 
include('config.php');
include('header.php');
include('sidebar.php');
 
	if ($seourls == 1) {
		include ('paginator-seo.php');
	} else {
		include ('paginator.php');
	}
 
// Setup the home template
	$home = new Template("templates/".$template."/home.tpl");
	$home->set("siteurl", $siteurl);
	$home->set("contenttitle", "Most Recent Articles");
 
 
 
// Setup pagination controls
	$rowsquery = "select * from articles where status=0";
	$rowsresults = mysql_query($rowsquery,$connection) or die(mysql_error());
	$rows_results = mysql_num_rows($rowsresults);
 
	$pages = new Paginator;
	if ($seourls == 1) {
		$pages->nav = $siteurl;
	} else {
		$pages->urlparam = "?";
	}
	$pages->items_total = $rows_results;
	$pages->mid_range = 9;
	$pages->paginate();
 
	if ($pages->items_total) {
		$query = "select * from articles where status=0 order by date desc ".$pages->limit;
	} else {
		$query = "select * from articles where status=0	order by date desc";
	}
 
	$articleresults = mysql_query($query,$connection) or die(mysql_error());
	$num_results = mysql_num_rows($articleresults);
 
 
// BEGIN LOOPING THROUGH ALL ARTICLES
 
	if ($num_results == 0) {
		echo "<p>No articles found!</p>";
 
	} else {
		for ($i=0; $i <$num_results; $i++) {
			$row = mysql_fetch_assoc($articleresults);
 
		//Get article info
			$id = $row['id'];
			$authorid = $row['authorid'];
			$date = strtotime($row['date']);
			$artdate = date('m/d/y', $date);
			$categoryid = $row['categoryid'];
			$title = $row['title'];
			if ($seourls == 1) { $scrubtitle = generate_seo_link($title); }
			$body = strip_tags(substr($row['body'], 0, 300));
 
		//get author info
			$authorquery = "select * from authors where id=".$authorid;
			$authorresult = mysql_query($authorquery,$connection) or die(mysql_error());
			$authorinfo = mysql_fetch_array($authorresult);
			$authorname = $authorinfo['displayname'];
			if ($seourls == 1) { $scrubauthor = generate_seo_link($authorname); }
 
		//get category info
			$catquery = "select * from categories where id=".$categoryid;
			$catresult = mysql_query($catquery,$connection) or die(mysql_error());
			$catinfo = mysql_fetch_array($catresult);
			$categoryname = $catinfo['name'];
			$catparent = $catinfo['parentid'];
			if ($seourls == 1) {  $scrubcatname = generate_seo_link($categoryname); }
 
		// If this article doesn't have a parent, display this:
			if ($catparent == NULL) {
				if ($seourls == 1) { // With SEO URLS
					$displaycat = "<a href=\"".$siteurl."/category/".$categoryid."/"
					.$scrubcatname."/\"><b>".$categoryname."</b></a>";
				} else {
					$displaycat = "<a href=\"".$siteurl."/category.php?id=".$categoryid
					."\"><b>".$categoryname."</b></a>";
				}
			} else {
		// if it does have a parent, display this:
				$query = "select * from categories where id=".$catparent;
				$result = mysql_query($query,$connection) or die(mysql_error());
				$info = mysql_fetch_array($result);
				$parentname = $info['name'];
				if ($seourls == 1) { $scrubparent = generate_seo_link($parentname); }
 
				if ($seourls == 1) { // With SEO URLS
					$displaycat = "<a href=\"".$siteurl."/category/".$catparent
					."/".$scrubparent."/\"><b>".$parentname."</b></a> >
				   <a href=\"".$siteurl."/category/".$categoryid."/".$scrubcatname
				   ."/\"><b>".$categoryname."</b></a>";
				} else {
					$displaycat = "<a href=\"".$siteurl."/category.php?id=".$catparent
					."\"><b>".$parentname."</b></a> >
				   <a href=\"".$siteurl."/category.php?id=".$categoryid."\"><b>"
				   .$categoryname."</b></a>";
				}
			}
		// Display the articles!
			if ($seourls == 1) { // With SEO URLS
				$thisrow = "<h2><a href=\"".$siteurl."/".$id."/".$scrubtitle."/\">".$title."</a></h2>";
				$thisrow .= $body;
				$thisrow .= "<div class=\"article-meta\">".$displaycat." | By: <a href=\""
							.$siteurl."/profile/".$authorid."/".$scrubauthor."/\"><b>"
							.$authorname."</b></a> (".$artdate.")</div><br/>";
			} else {
				$thisrow = "<h2><a href=\"".$siteurl."/article.php?id=".$id."\">".$title."</a></h2>";
				$thisrow .= $body;
				$thisrow .= "<div class=\"article-meta\">".$displaycat." |
							By: <a href=\"".$siteurl."/profile.php?a=".$authorid."\"><b>"
							.$authorname."</b></a> (".$artdate.")</div><br/>";
			}
		// add this row to the list of current rows
		$allrows .= $thisrow;
		} // closing the article loop
	}
137	$home->set("articlerows", $allrows);
//display pagination
		$home->set("paginationright", '<span style="float:right; margin: 10px 10px 2px 0;">
					<b>Page Navigation: '.$pages->display_pages().'</b></span>');
// Outputs the homepage template!
	echo $home->output();
	include('rightsidebar.php');
	include('obinclude.php');
?>
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
Imágen de perfil de javi
Val: 74
Ha aumentado 1 puesto en PHP (en relación al último mes)
Gráfica de PHP

error al instalar script openlist

Publicado por javi (33 intervenciones) el 22/05/2020 06:38:33
/opt/lampp/htdocs/articlesetup/header.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
<?php
 
include("template.class.php");
session_start();
 
//Initial DB Queries
	$query = 'select * from authors '
8			 ."where username ='".$_SESSION['valid_user']."'";
	$result = mysql_query($query,$connection) or die(mysql_error());
 
 
//Create user data variables
	$info = mysql_fetch_array($result);
	$id = $info['id'];
	$username = $info['username'];
	$password = $info['password'];
	$fname = htmlspecialchars($info['fname']);
	$lname = htmlspecialchars($info['lname']);
	$email = htmlspecialchars($info['email']);
	$displayname = htmlspecialchars($info['displayname']);
	$bio = htmlspecialchars($info['bio']);
	$avatar = $info['avatar'];
	$mailopt = $info['mailopt']; //0 == checked
 
 
//Create site settings variables
	$sitequery = 'select * from settings;';
	$siteresult = mysql_query($sitequery,$connection) or die(mysql_error());
	$siteinfo = mysql_fetch_array($siteresult);
	$sitetitle = $siteinfo['title'];
	$siteurl = $siteinfo['url'];
	$universalid = $siteinfo['universalid'];
	$logo = $siteinfo['logourl'];
	$statcode = $siteinfo['statcode'];
	$template = $siteinfo['template'];
 
	if (is_file('seourls.php')) {
		include ('seourls.php');
		$seourls = 1;
	} else {
		$seourls = 0;
	}
 
// Needed to control file paths of the templates
	$sidebardir = "";
 
 
// Setup this page's template information
	$header = new Template("templates/".$template."/header.tpl");
	$header->set("sitetitle", $sitetitle );
	$header->set("siteurl", $siteurl);
	$header->set("logo", $logo);
	$header->set("metatitle", $metatitle);
	$header->set("thistemp", $template);
// Create the logo
	if ($logo) {
		$header->set("sitelogo", '<a href="'.$siteurl.'"> <img border="0" alt="'.$sitetitle.'" src="'.$siteurl.'/admin/images/logo/'.$logo.'" /></a>');
	} else {
		$header->set("sitelogo", '<a href="'.$siteurl.'"><h1 style=\"padding-left: 10px;\">'.$sitetitle.'</h1></a>');
	}
// Checks if user is logged in. If so, display custom header
66	session_start();
	if (isset($_SESSION['valid_user'])) {
		$header->set("loginarea", 'Welcome, '.$fname.'
		(<a href="'.$siteurl.'/author/logout.php">Logout</a>)');
	} else {
		$header->set("loginarea", '<a href="'.$siteurl.'/login.php">Login</a>
		| <a href="'.$siteurl.'/login.php">Submit Articles</a>
		| <a href="'.$siteurl.'/login.php">Register</a>');
	}
 
 
// Populates the Top Menu list with all pages
	$query = "select * from pages where onmenu=0;";
	$result = mysql_query($query,$connection) or die(mysql_error());
	$num_results = mysql_num_rows($result);
 
	if ($num_results == 0) {
		$header->set("topmenuitems", "");
	} else {
		for ($i=0; $i <$num_results; $i++) {
			$row = mysql_fetch_assoc($result);
			if ($seourls == 1) { $scrubtitle = generate_seo_link($row['title']); }
 
			if ($seourls == 1) { // With SEO URLS
				$headlist = "<li><a href=\"".$siteurl."/page/".$row['id']
						."/".$scrubtitle."/\">".$row['title']."</a></li>";
				$headoutput .= $headlist;
			} else {
				$headlist = "<li><a href=\"".$siteurl."/page.php?p=".$row['id']."\">".$row['title']."</a></li>";
				$headoutput .= $headlist;
			}
			$header->set("topmenuitems", $headoutput);
		}
	}
// Checks if we need to create the category header
	if($cathead == 1) {
		$catheader = new Template("templates/".$template."/cathead.tpl");
		$catheader->set("catheadtitle", $catheadtitle);
		$query = "select * from adboxes where id=2;";
		$result = mysql_query($query,$connection) or die(mysql_error());
		$info = mysql_fetch_assoc($result);
 
		$catheader->set("468adcode", stripslashes($info['adcode']));
		$header->set("catheader", $catheader->output());
 
	} else {
		$header->set("catheader", "");
	}
 
// Outputs the page template!
 
	echo $header->output();
 
?>
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
Imágen de perfil de javi
Val: 74
Ha aumentado 1 puesto en PHP (en relación al último mes)
Gráfica de PHP

error al instalar script openlist

Publicado por javi (33 intervenciones) el 22/05/2020 06:39:27
/opt/lampp/htdocs/articlesetup/sidebar.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
<?php
 
// Setup this page's template information
// $sidebardir gets the relative directory from main site or /author
	$sidebar = new Template($sidebardir."templates/".$template."/sidebar.tpl");
// Check if  user is logged in. If so, display custom menu
8	session_start();
	if (isset($_SESSION['valid_user'])) {
		$sidebar->set("authormenu", '
		<h3>Author Navigation</h3>
		<div class="author-list">
		<ul>
			<li><a href="'.$siteurl.'/author/index.php">Dashboard Home</a></li>
			<li><a href="'.$siteurl.'/author/submit.php">Submit an Article</a></li>
			<li><a href="'.$siteurl.'/author/articles.php">View & Edit Articles</a></li>
			<li><a href="'.$siteurl.'/author/profile.php">Update Your Profile</a></li>
			<li><a href="'.$siteurl.'/author/settings.php">Account Settings</a></li>
			<li><a href="'.$siteurl.'/author/logout.php">Logout</a></li>
		</ul>
		<br style="clear:left"/>
		</div>
 
		<br/>');
	} else {
		$sidebar->set("authormenu", '');
	}
// Print the 120 x XXX sidebar code
	$query = "select * from adboxes where id=3;";
	$result = mysql_query($query,$connection) or die(mysql_error());
	$info = mysql_fetch_assoc($result);
	$sidebar->set("120adcode", stripslashes($info['adcode']));
// Populates the sidebar with all categories
	$query = "select * from categories where parentid is null order by name;";
	$result = mysql_query($query,$connection) or die(mysql_error());
	$num_results = mysql_num_rows($result);
	for ($i=0; $i <$num_results; $i++) {
		$row = mysql_fetch_assoc($result);
		if ($seourls == 1) { $scrubcatname = generate_seo_link($row['name']); }
		if ($seourls == 1) { // With SEO URLS
			$list = "<li><a href=\"".$siteurl."/category/".$row['id']."/".$scrubcatname."/\">
			".$row['name']."</a></li>";
54			$output .= $list;
		} else {
			$list = "<li><a href=\"".$siteurl."/category.php?id=".$row['id']."\">".$row['name']."</a></li>";
			$output .= $list;
		}
		$sidebar->set("sidecats", $output);
	}
// Populates the sidebar with all pages
	$query = "select * from pages;";
	$result = mysql_query($query,$connection) or die(mysql_error());
	$num_results = mysql_num_rows($result);
	if (!$num_results) {
		$sidebar->set("sidepages", "");
	} else {
		for ($i=0; $i <$num_results; $i++) {
			$row = mysql_fetch_assoc($result);
			if ($seourls == 1) { $scrubtitle = generate_seo_link($row['title']); }
			if ($seourls == 1) { // With SEO URLS
				$pagelist = "<li><a href=\"".$siteurl."/page/".$row['id']."/".$scrubtitle."/\">
				".$row['title']."</a></li>";
				$pageoutput .= $pagelist;
			} else {
				$pagelist = "<li><a href=\"".$siteurl."/page.php?p=".$row['id']."\">".$row['title']."</a></li>";
				$pageoutput .= $pagelist;
			}
			$sidebar->set("sidepages", $pageoutput);
		}
	}
// Outputs the sidebar template!
	echo $sidebar->output();
?>
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
Imágen de perfil de javi
Val: 74
Ha aumentado 1 puesto en PHP (en relación al último mes)
Gráfica de PHP

error al instalar script openlist

Publicado por javi (33 intervenciones) el 22/05/2020 06:40:35
/opt/lampp/htdocs/articlesetup/paginator.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
<?php
 
class Paginator{
	var $urlparam;
    var $items_per_page;
    var $items_total;
    var $current_page;
    var $num_pages;
    var $mid_range;
    var $low;
    var $high;
    var $limit;
    var $return;
    var $default_ipp = 15;
 
    function Paginator()
    {
        $this->current_page = 1;
        $this->mid_range = 7;
        $this->items_per_page = (!empty($_GET['ipp'])) ? $_GET['ipp']:$this->default_ipp;
    }
 
    function paginate()
    {
25        if($_GET['ipp'] == 'All')
        {
            $this->num_pages = ceil($this->items_total/$this->default_ipp);
            $this->items_per_page = $this->default_ipp;
        }
        else
        {
            if(!is_numeric($this->items_per_page) OR $this->items_per_page <= 0) $this->items_per_page = $this->default_ipp;
            $this->num_pages = ceil($this->items_total/$this->items_per_page);
        }
35       $this->current_page = (int) $_GET['page']; // must be numeric > 0
        if($this->current_page < 1 Or !is_numeric($this->current_page)) $this->current_page = 1;
        if($this->current_page > $this->num_pages) $this->current_page = $this->num_pages;
        $prev_page = $this->current_page-1;
        $next_page = $this->current_page+1;
 
        if($this->num_pages > 10)
        {
            $this->return = ($this->current_page != 1 And $this->items_total >= 10) ? "<a class=\"paginate\" href=\"$_SERVER[PHP_SELF]".$this->urlparam."&page=$prev_page&ipp=$this->items_per_page\"> Previous</a> ":"<span class=\"inactive\" href=\"#\"> Previous</span> ";
 
            $this->start_range = $this->current_page - floor($this->mid_range/2);
            $this->end_range = $this->current_page + floor($this->mid_range/2);
 
            if($this->start_range <= 0)
            {
                $this->end_range += abs($this->start_range)+1;
                $this->start_range = 1;
            }
            if($this->end_range > $this->num_pages)
            {
                $this->start_range -= $this->end_range-$this->num_pages;
                $this->end_range = $this->num_pages;
            }
            $this->range = range($this->start_range,$this->end_range);
 
            for($i=1;$i<=$this->num_pages;$i++)
            {
                if($this->range[0] > 2 And $i == $this->range[0]) $this->return .= " ... ";
                // loop through all pages. if first, last, or in range, display
                if($i==1 Or $i==$this->num_pages Or in_array($i,$this->range))
                {
                    $this->return .= ($i == $this->current_page And $_GET['page'] != 'All') ? "<a title=\"Go to page $i of $this->num_pages\" class=\"current\" href=\"#\">$i</a> ":"<a class=\"paginate\" title=\"Go to page $i of $this->num_pages\" href=\"$_SERVER[PHP_SELF]".$this->urlparam."&page=$i&ipp=$this->items_per_page\">$i</a> ";
                }
                if($this->range[$this->mid_range-1] < $this->num_pages-1 And $i == $this->range[$this->mid_range-1]) $this->return .= " ... ";
            }
            $this->return .= (($this->current_page != $this->num_pages And $this->items_total >= 10) And ($_GET['page'] != 'All')) ? "<a class=\"paginate\" href=\"$_SERVER[PHP_SELF]".$this->urlparam."&page=$next_page&ipp=$this->items_per_page\">Next </a>\n":"<span class=\"inactive\" href=\"#\">Next</span>\n";
            $this->return .= ($_GET['page'] == 'All') ? "(<a class=\"current\" style=\"margin-left:10px\" href=\"#\">All</a>) \n":"(<a class=\"paginate\" style=\"margin-left:10px\" href=\"$_SERVER[PHP_SELF]".$this->urlparam."&page=1&ipp=All\">All</a>) \n";
        }
        else
        {
            for($i=1;$i<=$this->num_pages;$i++)
            {
                $this->return .= ($i == $this->current_page) ? "<a class=\"current\" href=\"#\">$i</a> ":"<a class=\"paginate\" href=\"$_SERVER[PHP_SELF]".$this->urlparam."&page=$i&ipp=$this->items_per_page\">$i</a> ";
            }
            $this->return .= "(<a class=\"paginate\" href=\"$_SERVER[PHP_SELF]".$this->urlparam."&page=1&ipp=All\">All</a>) \n";
        }
        $this->low = ($this->current_page-1) * $this->items_per_page;
82   $this->high = ($_GET['ipp'] == 'All') ? $this->items_total:($this->current_page * $this->items_per_page)-1;
83   $this->limit = ($_GET['ipp'] == 'All') ? "":" LIMIT $this->low,$this->items_per_page";
    }
 
    function display_items_per_page()
    {
        $items = '';
        $ipp_array = array(15,25,50,100,'All');
        foreach($ipp_array as $ipp_opt)    $items .= ($ipp_opt == $this->items_per_page) ? "<option selected value=\"$ipp_opt\">$ipp_opt</option>\n":"<option value=\"$ipp_opt\">$ipp_opt</option>\n";
        return "<span class=\"paginate\">Items per page:</span><select class=\"paginate\" onchange=\"window.location='$_SERVER[PHP_SELF]".$this->urlparam."&page=1&ipp='+this[this.selectedIndex].value;return false\">$items</select>\n";
    }
 
    function display_jump_menu()
    {
        for($i=1;$i<=$this->num_pages;$i++)
        {
            $option .= ($i==$this->current_page) ? "<option value=\"$i\" selected>$i</option>\n":"<option value=\"$i\">$i</option>\n";
        }
        return "<span class=\"paginate\">Page:</span><select class=\"paginate\" onchange=\"window.location='$_SERVER[PHP_SELF]".$this->urlparam."&page='+this[this.selectedIndex].value+'&ipp=$this->items_per_page';return false\">$option</select>\n";
    }
 
    function display_pages()
    {
        return $this->return;
    }
}
?>
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
Imágen de perfil de javi
Val: 74
Ha aumentado 1 puesto en PHP (en relación al último mes)
Gráfica de PHP

error al instalar script openlist

Publicado por javi (33 intervenciones) el 22/05/2020 06:42:18
/opt/lampp/htdocs/articlesetup/rightsidebar.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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
<?php
 
// Create the right sidebar template
	$rightsidebar = new Template("templates/".$template."/rightsidebar.tpl");
 
 
// Print out the 250 x 300 code
	$query = "select * from adboxes where id=1;";
	$result = mysql_query($query,$connection) or die(mysql_error());
	$info = mysql_fetch_assoc($result);
 
	$rightsidebar->set("250adcode", stripslashes($info['adcode']));
 
// determine if this is category.php, article.php, or other
	$currentfile = $_SERVER["SCRIPT_NAME"];
    $parts = Explode('/', $currentfile);
    $currentfile = $parts[count($parts) - 1];
 
    if ($currentfile == "category.php") {
 
		$rightsidebar->set("righttitle", "Most Viewed - ".$cattitle."");
		$catquery = "select * from categories where id =".$_GET['id'];
		$query = "select title, views, id from articles, articleviews
		where articleviews.articleid = articles.id and status=0
		and (categoryid = ".$_GET['id']." OR parentid = ".$_GET['id'].")
		order by articleviews.views desc LIMIT 0, 12;";
 
// Otherwise, display articles from all categories
	} else {
		$rightsidebar->set("righttitle", "Most Viewed - All Categories");
		$catquery = "select * from categories";
		$query = "select title, views, id from articles, articleviews
		where articleviews.articleid = articles.id and status=0
		order by articleviews.views desc LIMIT 0, 12;";
	}
 
 
	$catresult = mysql_query($catquery,$connection) or die(mysql_error());
	$catinfo = mysql_fetch_array($catresult);
	$cattitle = $catinfo['name'];
 
	$articleresults = mysql_query($query,$connection) or die(mysql_error());
	$num_results = mysql_num_rows($articleresults);
 
 
//	If this category is empty...
	if ($num_results == 0) {
		$rightsidebar->set("rightarticles", "No Articles Found!");
	} else {
 
		for ($i=0; $i <$num_results; $i++) {
			$row = mysql_fetch_assoc($articleresults);
 
			//Get article info
			$id = $row['id'];
			$title = $row['title'];
			if ($seourls == 1) {  $scrubtitle = generate_seo_link($title); }
 
			// Display the article list
			if ($seourls == 1) { // With SEO URLS
				$rightlist = "<li><a href=\"".$siteurl."/".$id."/".$scrubtitle."/\">".$title."</a></li>";
				$rightoutput .= $rightlist;
			} else {
				$rightlist = "<li><a href=\"".$siteurl."/article.php?id=".$id."\">".$title."</a></li>";
				$rightoutput .= $rightlist;
			}
			$rightsidebar->set("rightarticles", $rightoutput);
		}
	}
 
 
/* OPTIONAL SIDBAR FEATURES FOR TEMPLATES TAHT ONLY USE A RIGHT SIDEBAR */
 
// Check if  user is logged in. If so, display custom menu
75	session_start();
	if (isset($_SESSION['valid_user'])) {
		$username = $_SESSION['valid_user'];
		$rightsidebar->set("authormenu", '
		<h3>Welcome, '.$username.':</h3>
		<div class="author-list">
		<ul>
			<li><a href="'.$siteurl.'/author/index.php">Dashboard Home</a></li>
			<li><a href="'.$siteurl.'/author/submit.php">Submit an Article</a></li>
			<li><a href="'.$siteurl.'/author/articles.php">View & Edit Articles</a></li>
			<li><a href="'.$siteurl.'/author/profile.php">Update Your Profile</a></li>
			<li><a href="'.$siteurl.'/author/settings.php">Account Settings</a></li>
			<li><a href="'.$siteurl.'/author/logout.php">Logout</a></li>
		</ul>
		<br style="clear:left"/>
		</div>
		<br/>');
	} else {
		$rightsidebar->set("authormenu", '<h2>Already a Member?</h3>
			<form method="post" action="'.$siteurl.'/login.php">
	<table>
	<tr><td style="width:100px;">Username:</td>
	<td><input type="text" name="userid" style="width:90px;"></td></tr>
	<tr><td>Password:</td>
	<td><input type="password" name="password" style="width:90px;"></td></tr>
	<tr><td>Remember Me:</td>
	<td><input type="checkbox" name="remember"></td></tr>
	<tr><td colspan="2" align="center">
	<input type="submit" id="submitstyle" value="Log in"></td></tr>
	</table></form>
		<br/>
		<center><a href="'.$siteurl.'/login.php">Signup to submit articles &raquo;</a></center>');
 
	}
 
 
// Print the 120 x XXX sidebar code
	$query = "select * from adboxes where id=3;";
	$result = mysql_query($query,$connection) or die(mysql_error());
	$info = mysql_fetch_assoc($result);
 
	$rightsidebar->set("120adcode", stripslashes($info['adcode']));
 
 
 
// Populates the sidebar with all categories
	$rightlistquery = "select * from categories where parentid is null order by name;";
	$rightlistresult = mysql_query($rightlistquery,$connection) or die(mysql_error());
	$right_num_results = mysql_num_rows($rightlistresult);
 
	for ($i=0; $i <$right_num_results; $i++) {
		$row = mysql_fetch_assoc($rightlistresult);
		if ($seourls == 1) { $scrubcatname = generate_seo_link($row['name']); }
 
		if ($seourls == 1) { // With SEO URLS
			$rightcatlist = "<li><a href=\"".$siteurl."/category/".$row['id']."/".$scrubcatname."/\">
			".$row['name']."</a></li>";
			$rightcatoutput .= $rightcatlist;
		} else {
			$rightcatlist = "<li><a href=\"".$siteurl."/category.php?id=".$row['id']."\">".$row['name']."</a></li>";
			$rightcatoutput .= $rightcatlist;
		}
135		$rightsidebar->set("sidecats", $rightcatoutput); 
	}
 
 
// Populates the sidebar with all pages
	$query = "select * from pages;";
	$result = mysql_query($query,$connection) or die(mysql_error());
	$num_results = mysql_num_rows($result);
 
	if (!$num_results) {
		$rightsidebar->set("sidepages", "");
	} else {
 
		for ($i=0; $i <$num_results; $i++) {
			$row = mysql_fetch_assoc($result);
 
			if ($seourls == 1) { $scrubtitle = generate_seo_link($row['title']); }
 
			if ($seourls == 1) { // With SEO URLS
				$rightpagelist = "<li><a href=\"".$siteurl."/page/".$row['id']."/".$scrubtitle."/\">
				".$row['title']."</a></li>";
				$rightpageoutput .= $rightpagelist;
			} else {
				$rightpagelist = "<li><a href=\"".$siteurl."/page.php?p=".$row['id']."\">".$row['title']."</a></li>";
				$rightpageoutput .= $rightpagelist;
			}
			$rightsidebar->set("sidepages", $rightpageoutput);
		}
	}
 
	$rightsidebar->set("siteurl", $siteurl);
 
 
// Outputs the right sidebar template!
 
	echo $rightsidebar->output();
 
?>
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar