Not signed in (Sign In)

Categories

Welcome, Guest

Want to take part in these discussions? Sign in if you have an account, or apply for one below

RecentTags

Vanilla 1.1.5a is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorrunen
    • CommentTimeSep 1st 2007
     permalinkReport Post
    Hi,

    I would like to know if it's possible to change the default order of the Smart Link Plugin operation.
    I'd like to make it search the terms to replace 1) in the categories and, after, 2) in posts or pages.
    Is it possible?
    • CommentAuthorDenis
    • CommentTimeSep 1st 2007
     permalinkBuy a DrinkReport Post

    add this piece of code in a custom.php file:

    <?php
    function custom_smart_link_default($links)
    {
        $links = sem_smart_link_wp_cats($links);
        $links = sem_smart_link_wp_entries($links);
        $links = sem_smart_link_wp_links($links);
    
        return $links;
    } # end custom_smart_link_default()
    
    sem_smart_link_set_engine('default', 'custom_smart_link_default');
    ?>
    

    D.

    • CommentAuthorrunen
    • CommentTimeSep 1st 2007 edited
     permalinkReport Post
    Thanks a lot.
    I placed this custom.php file in the plugins folder, in the sem-smart-link folder, in the main wp folder and in my theme folder, but it doesn't work... where do I have to upload it?
    •  
      CommentAuthorLarry
    • CommentTimeSep 1st 2007
     permalinkBuy a DrinkReport Post
    A custom.php file goes into the skins folder. Put it into the skin file you are using, example skins/sky-gold, etc

    Larry
    • CommentAuthorrunen
    • CommentTimeSep 1st 2007
     permalinkReport Post
    I tried, but it doesn't work.
    • CommentAuthorDenis
    • CommentTimeSep 3rd 2007 edited
     permalinkBuy a DrinkReport Post

    are you sure it doesn't work? as in, have you tried to create a static page and a category with the same name to check? there's really nothing in the code that should prevent the engine from getting overridden, and you can check if the code was executed by adding this immediately after it:

    echo '<h1>smart link override code was executed</h1>';
    

    D.

    • CommentAuthorrunen
    • CommentTimeSep 3rd 2007
     permalinkReport Post
    Thanks for this smart tip!

    I will try and post the result soon.
    • CommentAuthorrunen
    • CommentTimeSep 5th 2007
     permalinkReport Post
    The code doesn't seem to be executed. I added the suggested string, but it isn't shown.
    May it depend on the fact I've a functions.php file in the folder of the theme I'm actually using? Do I have to place the code of the custom.php file inside the functions.php?

    Or maybe could it work if I paste the code in the Smart Link plugin .php file?

    I have more files and categories with the same names: for example http://www.libriefilm.com/egitto/724 (post) and http://www.libriefilm.com/category/generi/viaggi/africa/egitto (category).
    • CommentAuthorDenis
    • CommentTimeSep 10th 2007
     permalinkBuy a DrinkReport Post

    err... if you're not using the semiologic theme, then yes, you need to add that code in your theme's functions.php file.

    D.

    • CommentAuthorrunen
    • CommentTimeSep 24th 2007
     permalinkReport Post
    Thank you Denis!
    • CommentAuthorrunen
    • CommentTimeSep 24th 2007 edited
     permalinkReport Post

    Now it works perfectly. Anyway I've already a new question.

    The function you suggested me sets the following order:

    <code>$links = sem_smart_link_wp_cats($links); $links = sem_smart_link_wp_entries($links); $links = sem_smart_link_wp_links($links);</code>

    So the order is: categories, entries, blogroll links.

    There is no way to set a specific order between pages and posts?

    • CommentAuthorDenis
    • CommentTimeOct 12th 2007
     permalinkBuy a DrinkReport Post

    the answer is in the contents of sem_smart_link_wp_entries -- use that instead of the function itself