WordPress.org

Ready to get started?Download WordPress

Forums

New Archive Structure (67 posts)

  1. mrlarter
    Member
    Posted 10 years ago #

    permalink structure? wooo you just blew my mind..whats that?

  2. mrlarter
    Member
    Posted 10 years ago #

    alright have done all that. as soon as I turn the hackfile on i get the following errors at the top of all the wp screens
    function archive_month($before='', $after='') { global $post, $previous_month, $month, $previous_day; $thismonth = mysql2date('m', $post->post_date); $thisyear = mysql2date('Y', $post->post_date); $thisdate = $thisyear.$thismonth; $output = ''; if ($thisdate != $previous_month) { if ($previous_month) { $output .= "\t\t
    \n\t\n
    \n"; } $thismonth = mysql2date('m', $post->post_date); $output .= '
    '.$before.''.$month[$thismonth].' '.$thisyear.''.$after."\n".'
    '; $previous_day = ""; $output .= "\n"; } $previous_month = $thisdate; echo $output; } function archive_day($before='', $after='') { global $post, $previous_day, $month; $thisday = mysql2date('j', $post->post_date); $thismonth = mysql2date('m', $post->post_date); $thisyear = mysql2date('Y', $post->post_date); $thisdate = $thisyear.$thismonth.$thisday; $output = ''; if ($thisdate != $previous_day) { if ($previous_day) { $output .= "\t\t
    \n\t\n"; } $thisday = mysql2date('j', $post->post_date); $thismonth = mysql2date('m', $post->post_date); $output .= "\t".'
    '.$before.''.$thisday.''.$after."\n\t\t".'
    '; $output .= "\n"; } $previous_day = $thisdate; echo $output; } function get_year_link($year) { global $siteurl, $blogfilename, $querystring_start, $querystring_equal; if (!$year) $year = date('Y', time()+($time_difference * 3600)); if ('' != get_settings('permalink_structure')) { $off = strpos(get_settings('permalink_structure'), '%year%'); $offset = $off + 7; $yearlink = substr(get_settings('permalink_structure'), 0, $offset); if ('/' != substr($yearlink, -1)) $yearlink = substr($yearlink, 0, -1); $yearlink = str_replace('%year%', $year, $yearlink); $yearlink = str_replace('%post_id%', '', $yearlink); return $siteurl . $yearlink; } else { return $siteurl.'/'.$blogfilename.$querystring_start.'m'.$querystring_equal.$year; } }

  3. Cena
    Member
    Posted 10 years ago #

    That's unprocessed php code. Where did you put this, exactly? It should be in a file called my-hacks.php , and enclosed with <?php at the top and ?> at the bottom.

  4. mrlarter
    Member
    Posted 10 years ago #

    wow don't i feel stupid [lol]
    alright so have fixed that issue, but my arch is coming up very odd
    http://theogham.com/wp/arch.php
    I just think I need to do some tweaking with the arch page

  5. mrlarter
    Member
    Posted 10 years ago #

    I am also getting the issue where when i lick the title it brings me to theperma link but none of the images or css file can be found now due to the extra directories and such.
    any suggestions?

  6. Nick Momrik
    Member
    Posted 10 years ago #

    I just emailed you back...
    Your file references are incorrect. The new permalink structure that you turned on causes the web server to "think" it needs to look in these folders for those files. You have some of your CSS and IMG references set to "../resource/ogham.css" or something similar. If you set these references to "/css file" or "/foldername/css file" (if in a folder), the web server will start looking from your "root" folder. Since the permalinks are turned on, this is what is happening:
    As an example...you are on page http://theogham.com/archives/2004/12/25/. Your css references is "../resource/ogham.css", which means, back up one folder and then look for a folder called resource and then the css file will be in there, so it's looking the css file at http://theogham.com/archives/2004/12/resource/ogham.css, which of course does not exist. Try using "/.....", you'll be suprised! ;-)

  7. mrlarter
    Member
    Posted 10 years ago #

    ok so I have made the proper changes.
    but I am still having the issue with my arch page coming up very oddly
    http://theogham.com/wp/arch.php
    any ideas?

  8. mrlarter
    Member
    Posted 10 years ago #

    never mind solved it. I had wp starting twice for some reason

  9. Nick Momrik
    Member
    Posted 10 years ago #

    I've modified the code to make it cleaner. It now uses only one function instead of two, since the two functions were always called one after the other and they used a lot of the same variables and code. This should speed it up (noticeably?...probably not much).
    If you were running the previous code:
    Remove the two functions archive_month and archive_day from your hacks file, replace with the new archive_date function.
    Remove the calls to these functions from arch.php and replace with a call to the new function.
    Updated Code

  10. Nick Momrik
    Member
    Posted 10 years ago #

    See...I AM going blind! ;-) Thanks mamabean!

  11. Anonymous
    Unregistered
    Posted 10 years ago #

    Most welcome. :)

  12. Nick Momrik
    Member
    Posted 10 years ago #

  13. Nick Momrik
    Member
    Posted 10 years ago #

    Anything is possible in programming/software....but it would take some custom coding and I wouldn't know where to begin. Anyone else have an idea?

  14. Bonnie
    Member
    Posted 10 years ago #

    I decided in the end to have my poetry and stories in a separate installation of WP and keep the original one for my blog entries. That way I can make everything look just the way I want it to look. :) I'm pleased that WP is so light and non-server-hogging that it doesn't matter if you have to install it twice!
    Great hack though, I'm definitely going to use it for my blog's master archive. Thanks!

  15. vickiediablo
    Member
    Posted 10 years ago #

    Hmm... I have a little problem here. I believe I did everything as I'm told, but my archives page (http://blog.lean-forward.com/archives/) and the permalinked entries aren't showing any CSS properties. Arch.php (http://blog.lean-forward.com/arch.php), however, is working great.
    Does anyone know why this is happening?

  16. vickiediablo
    Member
    Posted 10 years ago #

    Wait, so my arch.php isn't working so great after all. Like /archives/, when I click a link (category or month), a page with all the grouped entries that has no CSS properties or images show up...

  17. mamabean
    Member
    Posted 10 years ago #

    The files are looking for your css file in the archives directory. Change the link to your css file to reflect the full url and you should be fine I would think.

  18. Nick Momrik
    Member
    Posted 10 years ago #

    Exactly what mamabean said...
    Change href="blogcss.css" to href="/blogcss.css"

  19. benrad
    Member
    Posted 10 years ago #

    I can't get the archives to show up as linked titles, just full posts. I've changed my permalinks in my .htaccess file, still no luck.
    Any ideas? http://www.3mote.com
    Ben

  20. Nick Momrik
    Member
    Posted 10 years ago #

    Ben,
    It doesn't look like you've modified your Rewrite rules because http://www.3mote.com/arch.php?m=2004 works just fine.

  21. benrad
    Member
    Posted 10 years ago #

    Interesting...
    Where should the .htaccess file be? I have it up there, and it's in the server root.
    I'll keep looking.

  22. Nick Momrik
    Member
    Posted 10 years ago #

    Care to share what you are using for the rules in .htaccess? I might be able to spot something quickly.

  23. Mark (podz)
    Support Maven
    Posted 10 years ago #

    This mine, and it work - may help ?
    RewriteEngine On
    RewriteBase /T2/
    RewriteRule ^archives/category/?([0-9a-z-]+)?/? /T2/arch.php?category_name=$1 [QSA]
    RewriteRule ^archives/?([0-9]{4})?/?([0-9]{1,2})?/?$ /T2/arch.php?year=$1&monthnum=$2 [QSA]
    RewriteRule ^archives/([0-9]{4})?/?([0-9]{1,2})?/?([0-9]{1,2})?/?([0-9a-z-]+)?/?([0-9]+)?/?$ /T2/index.php?year=$1&monthnum=$2&day=$3&name=$4&page=$5 [QSA]

  24. Nick Momrik
    Member
    Posted 10 years ago #

    benrad,
    You aren't using arch.php in any of the rules, so you must have skipped that step in the instructions. If you replace your last two rules with podz's last 3 and then simply remove the "/T2" from them, you should be golden.

  25. Nick Momrik
    Member
    Posted 10 years ago #

    A lot of people seem to have problems with the step of the instructions for the rewrite rules. Anyone have a suggestion for improving that?

  26. myke115
    Member
    Posted 10 years ago #

    I don't suppose if I e-mailed someone who can do this my wp and control panel passwords you'd just set this up for me as I am code illiterate????? I very much want to get the months and months typical archive structure replaced with this hack that goes with a separate page. However, I'm afraid of bringing down my whole blog!
    No takers????!!! Damn.

  27. Nick Momrik
    Member
    Posted 10 years ago #

    Myke,
    You won't do anything to your blog, since you are creating a new file. Follow the instructions for creating arch.php and then if you need help with the rewrite rules, let me know. That is the part where everyone seems to get stuck.

  28. myke115
    Member
    Posted 10 years ago #

    I shall commence to trying. The only thing I don't like about WP currently is the archive structure. If I could get this to work, it would be perfect. Hey, I am running WP .72. Will the hack still work? Also, if everyone does get stuck with the rewrite rules, then I am sure to do so also as I have no idea how to modify them!!!! HA ... I'll give it a go!

  29. Nick Momrik
    Member
    Posted 10 years ago #

    No, it will not work with .72
    You need the new permalink structure that was introduced in 1.0 and beyond.
    If you want these archives, you will need to upgrade to latest version.

  30. myke115
    Member
    Posted 10 years ago #

    Ahh ... i noticed that when I went in to the options menu and didn't find the hacks option that needs to be set to true. Ok. one more quick question. What do I need to do to upgrade to 1.0 without losing current posts/archives?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.