Welcome to Geeklog, Anonymous Friday, March 29 2024 @ 01:59 am EDT

Geeklog Forums

Use words for static file's urls


Status: offline

phpsocialclub

Forum User
Junior
Registered: 03/05/03
Posts: 30
Location:North Carolina
Static File Names Improved Hackfor geeklog 1.3.7Purpose: Geeklog by default uses a timestamp to identify static files. By changing a couple of lines of code you can use real words as the the identifier. This allows you to use more readable urls.Once you make the changes, add a new static page and change the file id that is automatically generated. Example: default install - http://yourdomain.com/staticpages/index.php?page=20030305031316526 After hack http://yourdomain.com/staticpages/staticpages/index.php?page=pagetitleif you turn on the url rewrite on line 359 of config.php $_CONF['url_rewrite'] = true; // false = off, true = on You get a url like this http://yourdomain.com/staticpages/index.php/faq Known Problems with this hack if you change the file_id after you have saved it, you get a new duplicate static page with the new id. There is no error checking in the file_id field, you can put spaces, and other bad charecters. You should only use alphanumeric charecters or the underscore (_) What files do I have to change /plugins/staticpages/language/english.php Add to Line 38 file_id => "File ID" , plugins/staticpages/templates/admin/editor.thtml Remove from line 76 <input type="hidden" name="sp_id" value="&#123;sp_id&#125;"> Add to Line 43 <tr><td align="right">{lang_file_id}:</td> <td><input type="text" name="sp_id" size="48" maxlength="64" value="&#123;sp_id&#125;"></td> </tr> /public_html/admin/plugins/staticpages/index.php Add to line 70 $sp_template->set_var('lang_file_id', $LANG_STATIC['file_id']);
I work for a Wilmington NC Attorney
 Quote

Status: offline

Ruatha

Forum User
Junior
Registered: 01/31/03
Posts: 26
This is a great idea, but shouldn't it go to the Geeklog developers to decide if they want to include this feature in future releases? I've migrated to Geeklog from phpNuke. I was stuck in an older version only because I'd "customized" my site so much doing this sort of thing that I was unable to upgrade without doing it all over again for each new release. From my experience, it's not worth making little changes to the main blocks of code like this, even if it seems like an attactive option initially.
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany

This has been on the list of feature requests for some time now. The next release of Geeklog will see the merge of the two static pages plugins (Tom Willet's version and the one that ships with Geeklog), so this may be a good time to implement this as well ...

bye, Dirk

 Quote

Status: offline

phpsocialclub

Forum User
Junior
Registered: 03/05/03
Posts: 30
Location:North Carolina
I have also done some work to allow the use of static files from the file system, including the writting back of changes made in the web interface. I also wrote a bulk importer to import a directory of files. If you would like the code, please send me a message.
I work for a Wilmington NC Attorney
 Quote

Status: offline

twohawks

Forum User
Junior
Registered: 12/17/01
Posts: 33
Looks like a great hack! Thanks for the work you put into this. I'd love to use this hack but the instructions don't seem consistent with my files. In particular, these instructions: plugins/staticpages/templates/admin/editor.thtml Remove from line 76 <input type="hidden" name="sp_id" value="&#123;sp_id&#125;"> Add to Line 43 <tr><td align="right">{lang_file_id}:</td> <td><input type="text" name="sp_id" size="48" maxlength="64" value="&#123;sp_id&#125;"></td> </tr> /public_html/admin/plugins/staticpages/index.php Add to line 70 $sp_template->set_var('lang_file_id', $LANG_STATIC['file_id']); In my plugins/staticpages/templates/admin/editor.thtml file instead of value="&#123;sp_id&#125;" I have simply value="{sp_id}". I suppose the instructions are for the default staticpages install instead of Tomw's enhanced staticpages version 1.2? Would you be willing to write instructions for those of us using staticpages version 1.2? Thanks! -Ken
 Quote

All times are EDT. The time is now 01:59 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content