Jump to content

howard-moore

Members
  • Posts

    41
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

howard-moore's Achievements

Member

Member (2/5)

0

Reputation

  1. Thanks for the heads-up for this. Unfortunately my server host is telling me that they are no longer going to allow the downgrade to older versions (only 5.4), so I guess I have a busy few weeks ahead!!
  2. Thanks, but I have absolutely no idea what to do with extract? I appreciate that I will need to rewrite the code, and I have instructed someone to do that for me for the next build of the core code that I use, but in the meantime unfortunately it will take far, far too long to change all the other sites running it (there are hundreds of them!). Is there not something I can change in the php.ini file to allow this to work?
  3. OK, so I've done some testing with another site and tried turning off register_globals, and this brings up exactly the same results. Therefore, this is what is causing the problem. Does anyone know how to replicate what register_globals does when running 5.4.12? I can't begin to tell you how many months of work it will be to recode everything if it can't be done!!! Thanks (in hope!), Neil
  4. Actually, I've just noticed another one using the new PHP 5.4.12 version, which I am sure is related. I have the following code: <? include ("content/content_news$template.php"); ?> and the idea is when you are www.domain.com/news.php?template=2 it would show ../content/content_news2.php. However, it is ignoring this and just showing template #1. This is clearly the same issue that I am having above, and I have hundreds of sites that I would need to recode if I can't find a fix to get this working under 5.4.12. Any ideas? Thanks, Neil
  5. OK - I've looked through the code at ../docs/index.php and it is using $_GET['dir'].
  6. This is really interesting, but I'm not sure I completely understand. I'm afraid I don't really know much about register_globals, and what needs to be changed. Could you explain what this does? Thanks so much for your help!
  7. Thanks for the reply. However, the include part is now working - the only bit that doesn't work now is the urlencode($dir) part. The way this works in 4.4.9 is that when a user clicks on a particular directory (e.g. ../docs/index.php?dir=Sub Folder) the include shows the contents of that sub-folder through the page that the user is on (e.g. ../documents.php). I could go back and recode everything so that the code at ../docs/index.php is all in documents.php, but I have hundreds of sites all using the same process, and it will take days and days of recoding to get it all done this way.
  8. OK thanks. However, does anyone know why the urlencode element works in PHP 4.4.9 and not 5.4.12? I have the include part working, but not the dynamic bit on the end: <?php include ("$domain/docs/index.php?dir=".urlencode($dir)); ?>
  9. I have managed to change the php.ini file so that allow_url_include is now on, but the ?dir=".urlencode($dir) part is still not working. It is only showing the first directory. The idea of the code is that when you click through to a sub-directory, the url will be something like: domain/documents.php?dir=Sub Folder&order_by=date&order=asc It would then show the contents of the Sub Folder. It works fine in php 4.4.9, so I don't know what the include should look like now. Do you know if anything else in the php.ini needs to be changed to allow that, or do I need to change include ("$domain/docs/index.php?dir=".urlencode($dir));?
  10. $domain is just my website domain (to save typing it out again and again), and $dir is the directory that the script at docs/index.php is looking at. When you click into a the directory it lists other directories or files that are in there.
  11. OK, so I have managed to get some of it to work by using the following: <?php echo (file_get_contents("$domain/docs/index.php?dir=".urlencode($dir))); ?> However, the purpose of dir=".urlencode($dir) is that it is meant to display the directory that you have clicked on, but file_get_contents does not do this in the same way as include. Any thoughts?
  12. Hi All, I have recently upgraded my PHP server version to 5.4.12, and I am having some real difficulties with getting something to work. The issue is with includes. I have a folder/file display script which I need to include into a pretty standard PHP page, and in 4.x it worked fine <?php include ("$domain/docs/index.php?dir=".urlencode($dir)); ?> However, I cannot get anything in that directory (/docs) to show at all. When I roll back the server version to 4.x it works, but in 5.4.12 it doesn't. I have read through the changes in PHP4-5, but cannot find anything about this. Can someone recommend a change that would enable it to work? Thanks, Neil
  13. Sorry - missed some typing in the above post. Basically I am trying to repeat the above code twice on the same web-page, and it is only allowing me to show it the once. Any ideas?
  14. Apologies to all if I am being completely thick which works fine when running on a page on its own, but when I try to repeat the script further down the page, it doesn't show at all. Basically, it appears only to show once on a page, and I cannot make it appear more than once. Can anyone help me with this? <? $result=mysql_query("SELECT id, title, link, parent_code, page_order, menu_title, parent_title, page_type, live, editable, installed FROM PCNET_$filename WHERE type='PAGE' AND installed='checked' AND page_order!='x' ORDER BY parent_code, ABS(page_order), title"); $menu = array( 'items' => array(), 'parents' => array() ); while ($items = mysql_fetch_assoc($result)) { $menu['items'][$items['id']] = $items; $menu['parents'][$items['parent_code']][] = $items['id']; } function buildMenu($parent_code, $menu) { $html = ""; if (isset($menu['parents'][$parent_code])) { $html .= "\n"; foreach ($menu['parents'][$parent_code] as $itemId) { if(!isset($menu['parents'][$itemId])) { $html .= "<tr><td class=\"".$menu['items'][$itemId]['page_type']."_EDIT\"><ul class=\"edit clear\"><li><a href=\"admin_pages_".$menu['items'][$itemId]['page_type'].".php?eid=".$menu['items'][$itemId]['id']."\">Edit / Delete<span></span></a></li></ul></td> <td class=\"".$menu['items'][$itemId]['page_type']."_b_c\">".$menu['items'][$itemId]['page_order']."</td> <td class=\"".$menu['items'][$itemId]['page_type']."_b_l\">".$menu['items'][$itemId]['menu_title']."</td> <td class=\"".$menu['items'][$itemId]['page_type']."_b_l\">".$menu['items'][$itemId]['parent_title']."</td> <td class=\"".$menu['items'][$itemId]['page_type']."_b_c\"><img src=\"../data/admin_docs_".$menu['items'][$itemId]['live'].".gif\" title=\"Showing Page\"></td></tr>"; } $html .= "</tr> \n"; if(isset($menu['parents'][$itemId])) { $html .= "<tr><td class=\"".$menu['items'][$itemId]['page_type']."_EDIT\"><ul class=\"edit clear\"><li><a href=\"admin_pages_".$menu['items'][$itemId]['page_type'].".php?eid=".$menu['items'][$itemId]['id']."\">Edit / Delete<span></span></a></li></ul></td> <td class=\"".$menu['items'][$itemId]['page_type']."_b_c\">".$menu['items'][$itemId]['page_order']."</td> <td class=\"".$menu['items'][$itemId]['page_type']."_b_l\">".$menu['items'][$itemId]['menu_title']."</td> <td class=\"".$menu['items'][$itemId]['page_type']."_b_l\">".$menu['items'][$itemId]['parent_title']."</td> <td class=\"".$menu['items'][$itemId]['page_type']."_b_c\"><img src=\"../data/admin_docs_".$menu['items'][$itemId]['live'].".gif\" title=\"Showing Page\"></td></tr>"; $html .= buildMenu($itemId, $menu); } } $html .= "\n"; } return $html; } echo buildMenu(0, $menu); ?> Thanks - Neil
  15. Hi, I have put together the following script which creates a dynamic drop-menu (in unordered list which is subsequently styled in CSS). What I am looking to do is find a way to add a focus to show the menu tab in a different colour when that page has been selected. Currently the below PHP is called on each page of the website. It is done like this to have top-level pages (parent pages) and sub-pages, and is ordered by a page order (both top-level and sub-page). All the pages on the website has a unique field called 'code', and in the past I have used class="there" in the unordered list item when that code has been selected, but I really don't know how I can do it with the below code: <?php $result=mysql_query("SELECT id, title, link, parent_code, page_order, menu_title, parent_live, parent_title, page_type, live, FROM PCNET_$filename WHERE type='PAGE' AND live='checked' ORDER BY parent_code, page_order, title"); $menu = array( 'items' => array(), 'parents' => array() ); while ($items = mysql_fetch_assoc($result)) { $menu['items'][$items['id']] = $items; $menu['parents'][$items['parent_code']][] = $items['id']; } function buildMenu($parent_code, $menu) { $html = ""; if (isset($menu['parents'][$parent_code])) { $html .= "\n"; foreach ($menu['parents'][$parent_code] as $itemId) { if(!isset($menu['parents'][$itemId])) { $html .= "<li><a href=\"".$menu['items'][$itemId]['link']."?eid=".$menu['items'][$itemId]['id']."\">".$menu['items'][$itemId]['menu_title']."</a></li>"; } $html .= "\n"; if(isset($menu['parents'][$itemId])) { $html .= "<li><a href=\"".$menu['items'][$itemId]['link']."?eid=".$menu['items'][$itemId]['id']."\">".$menu['items'][$itemId]['menu_title']."</a><ul>"; $html .= buildMenu($itemId, $menu); } } $html .= "</ul></a></li> \n"; } return $html; } echo buildMenu(0, $menu); ?> This is what I have used in the past (when the above menu code was static, and not the new dynamic version) to show when a page has been selected: <li<?php if ($code == 'local-info') echo ' class="there"'; ?>> If anyone has any suggestions how I can get the class="there" into the above when you are on a particular page I would really appreciate the feedback - been tearing my hair out over this one for days! Thanks, Neil
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.