76 (edited by Herbivor 2008-03-08 13:43)

Re: Hook requests

Hook after URL rewriting scheme (include/common.php) to modify $pun_url var.

Re: Hook requests

Herbivor: That's the purpose of co_common

Re: Hook requests

Sorry, the hook I was searching is in rewrite.php ^^

Re: Hook requests

That's to modify pun_rewrite_rules, not pun_url.

Re: Hook requests

I know, I want to modify pun_rewrite_rules too smile
I have a problem with an extension, when the URL rewriting sheme is File_Based, I can't modify $pun_url['index'] var. Here is my code :

        <hook id="co_common"><![CDATA[
            if ($pun_config['o_sef'] == 'Default')
                $pun_url['index'] = 'index.php';
            elseif ($pun_config['o_sef'] == 'File_Based' || $pun_config['o_sef'] == 'File_based_(fancy)')
                $pun_url['index'] = 'index.html';
            elseif ($pun_config['o_sef'] == 'Folder_Based' || $pun_config['o_sef'] == 'Folder_Based_(fancy)')
                $pun_url['index'] = 'index/';
            else
                $pun_url['index'] = 'index.php';
        ]]></hook>

I hope you understand my question, I'm not very good at english hmm

Re: Hook requests

Well, I don't know what problem you're having: what happens when you install an extension with that hook?

Re: Hook requests

When I install an extension with URL rewriting sheme is File_Based, $pun_url['index'] = index.php instead of index.html hmm

Re: Hook requests

I believe that's because of the upper case B you're using in some of your examples.

Re: Hook requests

It works big_smile Thank you very much Smartys smile

85 (edited by Herbivor 2008-03-08 15:26)

Re: Hook requests

I need a hook at the top of generate_navlinks function to add links before default links.

Re: Hook requests

Take a look at PunBB's array_insert function.

87 (edited by Herbivor 2008-03-14 19:27)

Re: Hook requests

And a hook before "@natcasesort($url_schemes);" in admin/options.php to add new method of URL Rewriting Scheme ?
For example :

$url_schemes[] = 'Method.php';

Maybe aop_add_url_scheme ?

88 (edited by kierownik 2008-03-14 19:37)

Re: Hook requests

I think you should use co_common and re_rewrite_rules for that.

Re: Hook requests

Thanks kierownik smile

Re: Hook requests

Herbivor wrote:

And a hook before "@natcasesort($url_schemes);" in admin/options.php to add new method of URL Rewriting Scheme ?
For example :

$url_schemes[] = 'Method.php';

Maybe aop_add_url_scheme ?

You just need to put your URL rewrite scheme PHP file in include/url. It'll be added automatically.

91

Re: Hook requests

how about a hook after a profile has been updated, but before the redirect? this same scheme could be added else where, maybe.

Re: Hook requests

Why?

93

Re: Hook requests

Well i have a function that pulls info from the user database. if its run before the database is updated, it generates old data. i need it run when ever a profile is updated. i cant think of any other place to do this.

94 (edited by damaxxed 2008-03-21 18:04)

Re: Hook requests

A hook like in_forum_loop_start(index.php) in search.php. If you want to add virtual categories or alter the output of forums/categories, you want them to be displayed/altered on index.php and search.php (Forums to search <select>).

Take a look at l. 1176 of search.php and l. 105 of index.php as reference..

//edit:

A hook in search.php on l. 693 (just before the query is executed) to enable a general modification of $query

Re: Hook requests

forums.php (after line 490) - Be able to specify other options to sort by (ex. subject).

96

Re: Hook requests

qubertman wrote:

forums.php (after line 490) - Be able to specify other options to sort by (ex. subject).

forums.php?

Re: Hook requests

admin/forums.php wink

98

Re: Hook requests

Smartys wrote:

admin/forums.php wink

wink

99

Re: Hook requests

po_pre_preview would be nice.
(Line 358 on Rev 1565)

100

Re: Hook requests

extern.php line 400, can you change with something like this:

$item = array(...);
($hook = get_hook('ex_...')) ? eval($hook) : null;
$feed['items'][] = $item;

?