Forum

You must be logged in to post Login Register

Search 
Search Forums:


 




Problems with Slugish Permalinks w/o Page ID in URL

UserPost

11:44 am
June 25, 2010


Nulli

New Member

Berlin, Germany

posts 2

1

Hello,


i found a nifty bug in the Raider Software that is really annoying …


When PRETTY URLs with Full rewrite Support are Activated , the Script cant determine Properly the PAGE ID and does not work as intended, it shows Simply _nothing_


There is an Topic here in the Board solving , this Problem in a way, which ends in that ALL Pages are Displaying the Simpleraider Script!


it would be nice to make an Option / Function in the Script which pulls & checks the SLUGGED Part out of the PAGE ID ( name of field in the post Var is page_title )


I'll try to solve the Problem on my own, because i didn't see the Dev of the Script around here for a quiet long time. if its Successfull, i'll post an Update to this Topic with an Appropriate Way and How To, to bring this to work with Slugged Permalinks.


Sincerly

Nulli

Nuff Said

2:39 pm
June 25, 2010


Nulli

New Member

Berlin, Germany

posts 2

2

Ok, solved Problem with an , obvious very big Workaround …


open simple-raider.php

go to


/*
 hook functions
 */

After insert

// Slug to ID functions
function get_post_slug($post_parent = false){
        global $post; // WordPress global $post
 
        if($post_parent){
 
            $parent = get_post($post_parent, OBJECT); // get the post data.
 
            $slug = $parent->post_name; // get the post_name/slug
 
        }else{
            $slug = $post->post_name; // if not a post_parent the post_name/slug for the current page will already be accessible.
        };
 
        return $slug;
    };

function get_ID_by_slug($page_slug) {
    $page = get_page_by_path($page_slug);
    if ($page) {
        return $page->ID;
    } else {
        return null;
    }
}
// Slug to ID Functions

then look out for the line

     if($t['page_id'] != get_option('sr_option_display_page_id','-1'))

Add before

       $kte = get_post_slug();
       $ktf = get_ID_by_slug($kte);

and replace the line itself with

     if($t['page_id'] || $ktf != get_option('sr_option_display_page_id','-1'))

Evoila Working Script with Slugs & IDs  ( Tested in WP 3.0! )


Greetings NuLLi


Nuff Said

Search 

About the SimpleRaider – the WordPress DKP management tool forum

Most Users Ever Online:

18


Currently Online:

1 Guest

Forum Stats:

Groups: 1

Forums: 4

Topics: 13

Posts: 30

Membership:

There are 24 Members

There has been 1 Guest

There is 1 Admin

There are 0 Moderators

Top Posters:

Talios – 3

destrox – 2

Nulli – 2

h4rdc0m – 2

gerago – 2

Egladil – 2

Administrators: ghostrifle (6 Posts)




Comments are closed.