php - Changing PmWiki user profiles links? -


i have existing website own user-management incorporating pmwiki into.

i therefore using externauth recipe in pmwiki handle authentication. works fine, allowing me authenticate users based on session variables set existing user authentication system.

however, there single shortcoming: pmwiki on several pages make links user profile pages. e.g. when showing edited pages. these links instead of pointing non-existing wiki-pages of form profiles/username point existing user profile pages.

is there way change way pmwiki [[~username]] links rendered on page "external" link http://example.com/profiles/username instead of normal pmwiki behavior?

i think figured out myself... trick use markup command define markup change user-profile links @ same time other "inline" markup external link. link later in markup-chain converted real html link point externally.

// set author information: $authid = $_session['userid']; $author = $_session['name'] . ' (userid=' . $_session['userid'] . ')';  // change way links user profiles shown: $enableauthorsignature = 1; // allow ~~~ , ~~~~ markup $authorlink = "[[http://{$_server['server_name']}/profiles/{$_session['userid']} | {$_session['name']}]]"; markup("profilelinks", "inline", "/\[\[~(.*?)\s\(userid=(\d+)\)\]\]/", "[[http://{$_server['server_name']}/profiles/$2 | $1]]"); 

i'm not sure elegant solution, seems work...


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -