Originally Posted by
basketmen
pardon me to join the thread. actually maybe there is another way for this, i will share the hack if i can make it, but i need help too, to get information the right code that VW use
so it is by using if languageid conditional in a plugin, to replace word become link, inspired by this hack
Word Replacement. But you need to enter each words manually, that you want to become link, like example below, its no big deal for me
for example you have an article page in english (languageid = 1)
so we create new plugin like this hack
Word Replacement, and just add if conditional for the language id, and change this code
post['message'] (for forum post) into what VW code use (for wiki article post)
Code:
if(LANGUAGEID == 1)
{
$word = array(
'google',
'yahoo'
);
$link = array(
'<a href="http://mydomain.com/wiki/google">google</a>',
'<a href="http://mydomain.com/wiki/yahoo">yahoo</a>'
);
$this->post['message'] = str_replace($word, $link, $this->post['message']);
}
So only wiki article with languageid = 1 that will replaced the words into link, other wiki article with other languageid are not linked. For wiki article in other language we can create new plugin again just repeat above step
i think this can be working, i want to try it. So pegasus, can you let me know what is excatly the code for wiki article post to put above? this is the code for forum post :
post['message'], what is the code for wiki article post?
please let me know if i am not clearly to tell what i mean
i am sorry for replying old thread, i am still cant make this, this mod will be useful, only replacing text in language page that we want, or manual replacing text that we want, beside autolinks, i am prefer using this mod better than autolinks btw
if you can help i will send $14.98 that usually for Upgrade Service
this is the only plugin
Code:
if(LANGUAGEID == 1)
{
$word = array(
'google',
'yahoo'
);
$link = array(
'<a href="http://mydomain.com/wiki/google">google</a>',
'<a href="http://mydomain.com/wiki/yahoo">yahoo</a>'
);
$this->post['message'] = str_replace($word, $link, $this->post['message']);
}
its works in forum post, the text are not replaced, using hook postbit_display_complete
but still not working in wiki article page, and using vault_article_complete hook, gets this error
Code:
Fatal error: Using $this when not in object context in /home/username/public_html/vault/tab/article.php(712) : eval()'d code on line 11
i already tried to change this line
Code:
$this->post['message'] = str_replace($word, $link, $this->post['message']);
with these line below, changing the $this with other variable, but still not working, the text are not replaced, please help how is that line should be to work in wiki article page
Code:
$post['message'] = str_replace($word, $link, $post['message']);
$post[message] = str_replace($word, $link, $post[message]);
$post->post['message'] = str_replace($word, $link, $post->post['message']);
$post->post[message] = str_replace($word, $link, $post->post[message]);
$postid->post[message] = str_replace($word, $link, $postid->post[message]);
$postid->post['message'] = str_replace($word, $link, $postid->post['message']);
$post_message->post[message] = str_replace($word, $link, $post_message->post[message]);
$post_message->post['message'] = str_replace($word, $link, $post_message->post['message']);
$post_message_$post[postid]$post[id_suff]->post['message'] = str_replace($word, $link, $post_message_$post[postid]$post[id_suff]->post['message']);