@@ -1325,93 +1325,53 @@ function getposttableselect() {
1325
1325
return $ posttableselect ;
1326
1326
}
1327
1327
1328
- function rewritereplace ($ content ){
1329
- global $ _G ;
1330
- if (in_array ('portal_topic ' , $ _G ['setting ' ]['rewritestatus ' ])) {
1331
- $ content = preg_replace_callback ("/ " .$ _G ['domain ' ]['pregxprw ' ]['portal ' ]."\?mod\=topic&(amp;)?topic\=([^#]+?)? \"([^\>]*)\>/ " , function ($ matches ) { return rewriteoutput ('portal_topic ' , 0 , $ matches [1 ], $ matches [3 ], $ matches [4 ]); }, $ content );
1332
- }
1333
-
1334
- if (in_array ('portal_article ' , $ _G ['setting ' ]['rewritestatus ' ])) {
1335
- $ content = preg_replace_callback ("/ " .$ _G ['domain ' ]['pregxprw ' ]['portal ' ]."\?mod\=view&(amp;)?aid\=(\d+)(&page\=(\d+))? \"([^\>]*)\>/ " , function ($ matches ) { return rewriteoutput ('portal_article ' , 0 , $ matches [1 ], $ matches [3 ], $ matches [5 ], $ matches [6 ]); }, $ content );
1336
- }
1337
-
1338
- if (in_array ('forum_forumdisplay ' , $ _G ['setting ' ]['rewritestatus ' ])) {
1339
- $ content = preg_replace_callback ("/ " .$ _G ['domain ' ]['pregxprw ' ]['forum ' ]."\?mod\=forumdisplay&(amp;)?fid\=(\w+)(&page\=(\d+))? \"([^\>]*)\>/ " , function ($ matches ) { return rewriteoutput ('forum_forumdisplay ' , 0 , $ matches [1 ], $ matches [3 ], $ matches [5 ], $ matches [6 ]); }, $ content );
1340
- }
1341
-
1342
- if (in_array ('forum_viewthread ' , $ _G ['setting ' ]['rewritestatus ' ])) {
1343
- $ content = preg_replace_callback ("/ " .$ _G ['domain ' ]['pregxprw ' ]['forum ' ]."\?mod\=viewthread&(amp;)?tid\=(\d+)(&extra\=(page\%3D(\d+))?)?(&page\=(\d+))? \"([^\>]*)\>/ " , function ($ matches ) { return rewriteoutput ('forum_viewthread ' , 0 , $ matches [1 ], $ matches [3 ], $ matches [8 ], $ matches [6 ], $ matches [9 ]); }, $ content );
1344
- }
1345
-
1346
- if (in_array ('group_group ' , $ _G ['setting ' ]['rewritestatus ' ])) {
1347
- $ content = preg_replace_callback ("/ " .$ _G ['domain ' ]['pregxprw ' ]['forum ' ]."\?mod\=group&(amp;)?fid\=(\d+)(&page\=(\d+))? \"([^\>]*)\>/ " , function ($ matches ) { return rewriteoutput ('group_group ' , 0 , $ matches [1 ], $ matches [3 ], $ matches [5 ], $ matches [6 ]); }, $ content );
1348
- }
1349
-
1350
- if (in_array ('home_space ' , $ _G ['setting ' ]['rewritestatus ' ])) {
1351
- $ content = preg_replace_callback ("/ " .$ _G ['domain ' ]['pregxprw ' ]['home ' ]."\?mod=space&(amp;)?(uid\=(\d+)|username\=([^&]+?)) \"([^\>]*)\>/ " , function ($ matches ) { return rewriteoutput ('home_space ' , 0 , $ matches [1 ], $ matches [4 ], $ matches [5 ], $ matches [6 ]); }, $ content );
1352
- }
1353
-
1354
- if (in_array ('home_blog ' , $ _G ['setting ' ]['rewritestatus ' ])) {
1355
- $ content = preg_replace_callback ("/ " .$ _G ['domain ' ]['pregxprw ' ]['home ' ]."\?mod=space&(amp;)?uid\=(\d+)&(amp;)?do=blog&(amp;)?id=(\d+) \"([^\>]*)\>/ " , function ($ matches ) { return rewriteoutput ('home_blog ' , 0 , $ matches [1 ], $ matches [3 ], $ matches [6 ], $ matches [7 ]); }, $ content );
1356
- }
1357
-
1358
- if (in_array ('forum_archiver ' , $ _G ['setting ' ]['rewritestatus ' ])) {
1359
- $ content = preg_replace_callback ("/<a href\= \"\?(fid|tid)\-(\d+)\.html(&page\=(\d+))? \"([^\>]*)\>/ " , function ($ matches ) { return rewriteoutput ('forum_archiver ' , 0 , $ matches [1 ], $ matches [2 ], $ matches [4 ], $ matches [5 ]); }, $ content );
1360
- }
1361
-
1362
- if (in_array ('plugin ' , $ _G ['setting ' ]['rewritestatus ' ])) {
1363
- $ content = preg_replace_callback ("/<a href\= \"plugin\.php\?id=([a-z]+[a-z0-9_]*):([a-z0-9_\-]+)(&|&)?(.*?)? \"([^\>]*)\>/ " , function ($ matches ) { return rewriteoutput ('plugin ' , 0 , $ matches [1 ], $ matches [2 ], $ matches [3 ], $ matches [4 ], $ matches [5 ]); }, $ content );
1364
- }
1365
- return $ content ;
1366
- }
1367
-
1368
1328
function rewritedata ($ alldata = 1 ) {
1369
1329
global $ _G ;
1370
1330
$ data = array ();
1371
1331
if (!$ alldata ) {
1372
1332
if (in_array ('portal_topic ' , $ _G ['setting ' ]['rewritestatus ' ])) {
1373
- $ data ['search ' ]['portal_topic ' ] = "/ " .$ _G ['domain ' ]['pregxprw ' ]['portal ' ]."\?mod\=topic&(amp;)?topic\=([^#]+?)? \"([^\>]*)\>/e " ;
1374
- $ data ['replace ' ]['portal_topic ' ] = " rewriteoutput('portal_topic', 0, ' \\ 1', ' \\ 3', ' \\ 4') " ;
1333
+ $ data ['search ' ]['portal_topic ' ] = "/ " .$ _G ['domain ' ]['pregxprw ' ]['portal ' ]."\?mod\=topic&(amp;)?topic\=([^#]+?)? \"([^\>]*)\>/ " ;
1334
+ $ data ['replace ' ]['portal_topic ' ] = ' rewriteoutput( \ 'portal_topic \ ', 0, $matches[1], $matches[3], $matches[4]) ' ;
1375
1335
}
1376
1336
1377
1337
if (in_array ('portal_article ' , $ _G ['setting ' ]['rewritestatus ' ])) {
1378
- $ data ['search ' ]['portal_article ' ] = "/ " .$ _G ['domain ' ]['pregxprw ' ]['portal ' ]."\?mod\=view&(amp;)?aid\=(\d+)(&page\=(\d+))? \"([^\>]*)\>/e " ;
1379
- $ data ['replace ' ]['portal_article ' ] = " rewriteoutput('portal_article', 0, ' \\ 1', ' \\ 3', ' \\ 5', ' \\ 6') " ;
1338
+ $ data ['search ' ]['portal_article ' ] = "/ " .$ _G ['domain ' ]['pregxprw ' ]['portal ' ]."\?mod\=view&(amp;)?aid\=(\d+)(&page\=(\d+))? \"([^\>]*)\>/ " ;
1339
+ $ data ['replace ' ]['portal_article ' ] = ' rewriteoutput( \ 'portal_article \ ', 0, $matches[1], $matches[3], $matches[5], $matches[6]) ' ;
1380
1340
}
1381
1341
1382
1342
if (in_array ('forum_forumdisplay ' , $ _G ['setting ' ]['rewritestatus ' ])) {
1383
- $ data ['search ' ]['forum_forumdisplay ' ] = "/ " .$ _G ['domain ' ]['pregxprw ' ]['forum ' ]."\?mod\=forumdisplay&(amp;)?fid\=(\w+)(&page\=(\d+))? \"([^\>]*)\>/e " ;
1384
- $ data ['replace ' ]['forum_forumdisplay ' ] = " rewriteoutput('forum_forumdisplay', 0, ' \\ 1', ' \\ 3', ' \\ 5', ' \\ 6') " ;
1343
+ $ data ['search ' ]['forum_forumdisplay ' ] = "/ " .$ _G ['domain ' ]['pregxprw ' ]['forum ' ]."\?mod\=forumdisplay&(amp;)?fid\=(\w+)(&page\=(\d+))? \"([^\>]*)\>/ " ;
1344
+ $ data ['replace ' ]['forum_forumdisplay ' ] = ' rewriteoutput( \ 'forum_forumdisplay \ ', 0, $matches[1], $matches[3], $matches[5], $matches[6]) ' ;
1385
1345
}
1386
1346
1387
1347
if (in_array ('forum_viewthread ' , $ _G ['setting ' ]['rewritestatus ' ])) {
1388
- $ data ['search ' ]['forum_viewthread ' ] = "/ " .$ _G ['domain ' ]['pregxprw ' ]['forum ' ]."\?mod\=viewthread&(amp;)?tid\=(\d+)(&extra\=(page\%3D(\d+))?)?(&page\=(\d+))? \"([^\>]*)\>/e " ;
1389
- $ data ['replace ' ]['forum_viewthread ' ] = " rewriteoutput('forum_viewthread', 0, ' \\ 1', ' \\ 3', ' \\ 8', ' \\ 6', ' \\ 9') " ;
1348
+ $ data ['search ' ]['forum_viewthread ' ] = "/ " .$ _G ['domain ' ]['pregxprw ' ]['forum ' ]."\?mod\=viewthread&(amp;)?tid\=(\d+)(&extra\=(page\%3D(\d+))?)?(&page\=(\d+))? \"([^\>]*)\>/ " ;
1349
+ $ data ['replace ' ]['forum_viewthread ' ] = ' rewriteoutput( \ 'forum_viewthread \ ', 0, $matches[1], $matches[3], $matches[8], $matches[6], $matches[9]) ' ;
1390
1350
}
1391
1351
1392
1352
if (in_array ('group_group ' , $ _G ['setting ' ]['rewritestatus ' ])) {
1393
- $ data ['search ' ]['group_group ' ] = "/ " .$ _G ['domain ' ]['pregxprw ' ]['forum ' ]."\?mod\=group&(amp;)?fid\=(\d+)(&page\=(\d+))? \"([^\>]*)\>/e " ;
1394
- $ data ['replace ' ]['group_group ' ] = " rewriteoutput('group_group', 0, ' \\ 1', ' \\ 3', ' \\ 5', ' \\ 6') " ;
1353
+ $ data ['search ' ]['group_group ' ] = "/ " .$ _G ['domain ' ]['pregxprw ' ]['forum ' ]."\?mod\=group&(amp;)?fid\=(\d+)(&page\=(\d+))? \"([^\>]*)\>/ " ;
1354
+ $ data ['replace ' ]['group_group ' ] = ' rewriteoutput( \ 'group_group \ ', 0, $matches[1], $matches[3], $matches[5], $matches[6]) ' ;
1395
1355
}
1396
1356
1397
1357
if (in_array ('home_space ' , $ _G ['setting ' ]['rewritestatus ' ])) {
1398
- $ data ['search ' ]['home_space ' ] = "/ " .$ _G ['domain ' ]['pregxprw ' ]['home ' ]."\?mod=space&(amp;)?(uid\=(\d+)|username\=([^&]+?)) \"([^\>]*)\>/e " ;
1399
- $ data ['replace ' ]['home_space ' ] = " rewriteoutput('home_space', 0, ' \\ 1', ' \\ 4', ' \\ 5', ' \\ 6') " ;
1358
+ $ data ['search ' ]['home_space ' ] = "/ " .$ _G ['domain ' ]['pregxprw ' ]['home ' ]."\?mod=space&(amp;)?(uid\=(\d+)|username\=([^&]+?)) \"([^\>]*)\>/ " ;
1359
+ $ data ['replace ' ]['home_space ' ] = ' rewriteoutput( \ 'home_space \ ', 0, $matches[1], $matches[4], $matches[5], $matches[6]) ' ;
1400
1360
}
1401
1361
1402
1362
if (in_array ('home_blog ' , $ _G ['setting ' ]['rewritestatus ' ])) {
1403
- $ data ['search ' ]['home_blog ' ] = "/ " .$ _G ['domain ' ]['pregxprw ' ]['home ' ]."\?mod=space&(amp;)?uid\=(\d+)&(amp;)?do=blog&(amp;)?id=(\d+) \"([^\>]*)\>/e " ;
1404
- $ data ['replace ' ]['home_blog ' ] = " rewriteoutput('home_blog', 0, ' \\ 1', ' \\ 3', ' \\ 6', ' \\ 7') " ;
1363
+ $ data ['search ' ]['home_blog ' ] = "/ " .$ _G ['domain ' ]['pregxprw ' ]['home ' ]."\?mod=space&(amp;)?uid\=(\d+)&(amp;)?do=blog&(amp;)?id=(\d+) \"([^\>]*)\>/ " ;
1364
+ $ data ['replace ' ]['home_blog ' ] = ' rewriteoutput( \ 'home_blog \ ', 0, $matches[1], $matches[3], $matches[6], $matches[7]) ' ;
1405
1365
}
1406
1366
1407
1367
if (in_array ('forum_archiver ' , $ _G ['setting ' ]['rewritestatus ' ])) {
1408
- $ data ['search ' ]['forum_archiver ' ] = "/<a href\= \"\?(fid|tid)\-(\d+)\.html(&page\=(\d+))? \"([^\>]*)\>/e " ;
1409
- $ data ['replace ' ]['forum_archiver ' ] = " rewriteoutput('forum_archiver', 0, ' \\ 1', ' \\ 2', ' \\ 4', ' \\ 5') " ;
1368
+ $ data ['search ' ]['forum_archiver ' ] = "/<a href\= \"\?(fid|tid)\-(\d+)\.html(&page\=(\d+))? \"([^\>]*)\>/ " ;
1369
+ $ data ['replace ' ]['forum_archiver ' ] = ' rewriteoutput( \ 'forum_archiver \ ', 0, $matches[1], $matches[2], $matches[4], $matches[5]) ' ;
1410
1370
}
1411
1371
1412
1372
if (in_array ('plugin ' , $ _G ['setting ' ]['rewritestatus ' ])) {
1413
- $ data ['search ' ]['plugin ' ] = "/<a href\= \"plugin\.php\?id=([a-z]+[a-z0-9_]*):([a-z0-9_\-]+)(&|&)?(.*?)? \"([^\>]*)\>/e " ;
1414
- $ data ['replace ' ]['plugin ' ] = " rewriteoutput('plugin', 0, ' \\ 1', ' \\ 2', ' \\ 3', ' \\ 4', ' \\ 5') " ;
1373
+ $ data ['search ' ]['plugin ' ] = "/<a href\= \"plugin\.php\?id=([a-z]+[a-z0-9_]*):([a-z0-9_\-]+)(&|&)?(.*?)? \"([^\>]*)\>/ " ;
1374
+ $ data ['replace ' ]['plugin ' ] = ' rewriteoutput( \ 'plugin \ ', 0, $matches[1], $matches[2], $matches[3], $matches[4], $matches[5]) ' ;
1415
1375
}
1416
1376
} else {
1417
1377
$ data ['rulesearch ' ]['portal_topic ' ] = 'topic-{name}.html ' ;
0 commit comments