commonorx Posted December 12, 2007 Share Posted December 12, 2007 Does anyone know how to make the following: There can be a index.php?c=6 page in a URL but there is no such page in the hosting servers file. Is there a way to make the index.php?c=6 page a static one? meaning I can go and edit that page specifically. That once I FTP into my hosting account I will see that page there so I can go and edit it alone. Quote Link to comment Share on other sites More sharing options...
jvrothjr Posted December 12, 2007 Share Posted December 12, 2007 basiclly the page is index.php and rhe ?c=6 is a variable pasted to the page that creates some kind or reaction so the page your looking to edit is the index.php page. Quote Link to comment Share on other sites More sharing options...
commonorx Posted December 12, 2007 Author Share Posted December 12, 2007 Is it possible to create a index.php?c=6 page so that when I FTP into the hosting server it shows it there? Quote Link to comment Share on other sites More sharing options...
PHP_PhREEEk Posted December 12, 2007 Share Posted December 12, 2007 index.php?c=6 is the following file: index.php The variable 'c' is passed to the index.php through $_GET, and has a value of '6'. PhREEEk Quote Link to comment Share on other sites More sharing options...
revraz Posted December 12, 2007 Share Posted December 12, 2007 No Is it possible to create a index.php?c=6 page so that when I FTP into the hosting server it shows it there? Quote Link to comment Share on other sites More sharing options...
trq Posted December 12, 2007 Share Posted December 12, 2007 Post your index file, within tags please. Quote Link to comment Share on other sites More sharing options...
commonorx Posted December 12, 2007 Author Share Posted December 12, 2007 <?php /** */ require_once 'init.php'; define('DIR_LPP', 20); $sort_cols = array ( 'P' => 'PAGERANK', 'H' => 'HITS', 'A' => 'TITLE'); $sort_ord = array ( 'P' => 'DESC' , 'H' => 'DESC', 'A' => 'ASC'); // Paging 1 $page = (!empty ($_REQUEST['p']) && preg_match ('`^[\d]+$`', $_REQUEST['p']) ? intval ($_REQUEST['p']) : 1);; if ($page != 1) { $min = PAGER_LPP * $page - (PAGER_LPP); $max = PAGER_LPP * $page; } else { $min = 0; $max = PAGER_LPP; } $limit = " LIMIT {$min}," . PAGER_LPP; // End Paging 1 $getSort = (!empty ($_REQUEST['s']) ? trim ($_REQUEST['s']) : (!empty ($URLvariables['s']) ? $URLvariables['s'] : '')); if (array_key_exists ($getSort, $sort_cols)) { $sort = $getSort; } else { $sort = DEFAULT_SORT; } if ((ENABLE_PAGERANK != 1 || SHOW_PAGERANK != 1) && $sort == 'P') $sort = 'H'; $tpl->assign('sort', $sort); $path = array(); $path[] = array ('ID' => '0', 'TITLE' => _L(SITE_NAME), 'TITLE_URL' => DOC_ROOT, 'DESCRIPTION' => SITE_DESC); if (FTR_ENABLE) { $feat_where = "AND (`FEATURED` = '0')"; } $expire_where = "AND (`EXPIRY_DATE` >= ".$db->DBDate(time())." OR `EXPIRY_DATE` IS NULL)"; $available_options = array ('d' => _L('Latest Links'), 'h' => _L('Top Hits')); if (!empty ($_REQUEST['p']) && array_key_exists ($_REQUEST['p'], $available_options)) { switch ($_REQUEST['p']) { case 'd': $links = $db->GetAll("SELECT * FROM `{$tables['link']['name']}` WHERE `STATUS` = '2' {$expire_where} ORDER BY `DATE_ADDED` DESC LIMIT 0, ".LINKS_TOP); $path[] = array ('ID' => '0', 'TITLE' => _L('Latest Links'), 'TITLE_URL' => '', 'DESCRIPTION' => ''); break; case 'h': default : $links = $db->GetAll("SELECT * FROM `{$tables['link']['name']}` WHERE `STATUS` = '2' {$expire_where} ORDER BY `HITS` DESC LIMIT 0, ".LINKS_TOP); $path[] = array ('ID' => '0', 'TITLE' => _L('Top Hits'), 'TITLE_URL' => '', 'DESCRIPTION' => ''); break; } $tpl->assign('p', $_REQUEST['p']); } elseif (isset ($_REQUEST['q']) && !empty ($_REQUEST['q']) && strlen (trim ($_REQUEST['q'])) > 2) { $q = $db->qstr('%'.preg_replace('`\s+`','%', trim ($_REQUEST['q'])).'%'); if (FTR_ENABLE) { $feat_links = $db->GetAll("SELECT * FROM `{$tables['link']['name']}` WHERE `STATUS` = '2' AND (`URL` LIKE {$q} OR `TITLE` LIKE {$q} OR `DESCRIPTION` LIKE {$q}) AND `FEATURED` = '1' {$expire_where} ORDER BY `EXPIRY_DATE` DESC"); $tpl->assign('feat_links', $feat_links); } $links = $db->GetAll("SELECT * FROM `{$tables['link']['name']}` WHERE `STATUS` = '2' AND (`URL` LIKE {$q} OR `TITLE` LIKE {$q} OR `DESCRIPTION` LIKE {$q}) {$feat_where} {$expire_where} ORDER BY {$sort_cols[$sort]} {$sort_ord[$sort]}"); $categs = array(); $path[] = array ('ID' => '0', 'TITLE' => _L('Search Results'), 'TITLE_URL' => '', 'DESCRIPTION' => _L('Search results for: ').$_REQUEST['q']); $tpl->assign('qu', rawurlencode (trim ($_REQUEST['q']))); } else { $id = get_category(); if (!$tpl->is_cached('main.tpl', $id)) { $path = get_path($id); if (FTR_ENABLE) { $feat_links = $db->GetAll("SELECT * FROM `{$tables['link']['name']}` WHERE `STATUS` = '2' AND `CATEGORY_ID` = ".$db->qstr($id)." AND `FEATURED` = 1 {$expire_where} ORDER BY `EXPIRY_DATE` DESC"); $tpl->assign('feat_links', $feat_links); } // Paging 3 $count = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `STATUS` = '2' AND `CATEGORY_ID` = ".$db->qstr($id)." {$feat_where} {$expire_where}"); // End Paging 3 $links = $db->GetAll("SELECT * FROM `{$tables['link']['name']}` WHERE `STATUS` = '2' AND `CATEGORY_ID` = ".$db->qstr($id)." {$feat_where} {$expire_where} ORDER BY `{$sort_cols[$sort]}` {$sort_ord[$sort]} {$limit}"); $rs = $db->Execute("SELECT * FROM `{$tables['category']['name']}` WHERE `STATUS` = 2 AND `PARENT_ID` = ".$db->qstr($id)." ORDER BY `TITLE`"); while (!$rs->EOF) { $row = $rs->FetchRow(); if ($id == 0 && CATS_PREVIEW > 0) { $rs2 = $db->SelectLimit("SELECT * FROM `{$tables['category']['name']}` WHERE `STATUS` = '2' AND `SYMBOLIC` <> 1 AND `PARENT_ID` = ".$db->qstr($row['ID'])." ORDER BY `TITLE` ASC", CATS_PREVIEW); $row['SUBCATS'] = $rs2->GetRows(); $rs2->Close(); } if (ENABLE_REWRITE && empty ($row['TITLE_URL'])) { $row['TITLE_URL'] = preg_replace ('`[^\w_-]`', '_', $row['TITLE']); $row['TITLE_URL'] = str_replace ('__', '_', $row['TITLE_URL']); } if ($row['SYMBOLIC'] == 1) { $row['ID'] = $row['SYMBOLIC_ID']; $tempcat = $db->GetRow("SELECT * FROM `{$tables['category']['name']}` WHERE `ID` = ".$db->qstr($row['SYMBOLIC_ID'])); if (empty ($row['TITLE'])) $row['TITLE'] = $tempcat['TITLE']; $row['TITLE'] = "@" . $row['TITLE']; if (ENABLE_REWRITE == 1) $row['TITLE_URL'] = construct_mod_rewrite_path($row['SYMBOLIC_ID']); $row['COUNT'] = $db->GetOne("SELECT COUNT(*) FROM `{$tables['category']['name']}` WHERE `STATUS` = '2' AND `PARENT_ID` = ".$db->qstr($row['SYMBOLIC_ID'])); $row['COUNT'] += $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `STATUS` = '2' AND `CATEGORY_ID` = ".$db->qstr($row['SYMBOLIC_ID'])); } else { $row['COUNT'] = $db->GetOne("SELECT COUNT(*) FROM `{$tables['category']['name']}` WHERE `STATUS` = '2' AND `PARENT_ID` = ".$db->qstr($row['ID'])); $row['COUNT'] += $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `STATUS` = '2' AND `CATEGORY_ID` = ".$db->qstr($row['ID'])); } $categs[] = $row; } $rs->Close(); } if ($id > 0) { $db->Execute("UPDATE `{$tables['category']['name']}` SET `HITS` = `HITS` + 1 WHERE `ID` = ".$db->qstr($id)); } } // Paging 4 $tpl->assign('list_total', $count); // End Paging 4 $tpl->assign('category', $path[count($path) - 1]); $tpl->assign('path', $path); $tpl->assign('links', $links); $tpl->assign('categs', $categs); //Clean whitespace $tpl->load_filter('output', 'trimwhitespace'); //Make output echo $tpl->fetch('main.tpl', $id); ?> Quote Link to comment Share on other sites More sharing options...
teng84 Posted December 12, 2007 Share Posted December 12, 2007 sorry for asking but what do you want to do again with that codes.. ? i believe your barking on the wrong grass lol Quote Link to comment Share on other sites More sharing options...
trq Posted December 12, 2007 Share Posted December 12, 2007 i believe your barking on the wrong grass lol Hehe... that would be the wrong tree. Anyway, it is possible (and quite easy) to make the url index.php?c=6 point to a static page, problem is, I'm not sure that is the actual url. I don't see any references in the code to either $_GET['c'] or (as seams favoured in this mess) $_REQUEST['c']. Is index.php?c=6 the actual url you want to respond to with a static page? Quote Link to comment Share on other sites More sharing options...
commonorx Posted December 13, 2007 Author Share Posted December 13, 2007 Yes, index.php?c=6 would be the actual page. along with some other pages... index.php?c=7 index.php?c=8 etc... I would want the browser to say http://www.domain.com/index.php?c=6 in the address bar, and for it to actually be that address (for Google PR sake) and yet have it a page where I can manipulate it like any other .html page. yet be different from the index.php?c=7 page for example. Be able to open it up with a html editor and change things around... Basically I just want the equivelent of having index.php?c=6 index.php?c=7 index.php?c=8 in the hosting servers files Not just the index.php. :-) Quote Link to comment Share on other sites More sharing options...
teng84 Posted December 13, 2007 Share Posted December 13, 2007 are you saying you want your dynamic page to become static or dedicated for that certain page??? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.