Signature field?

6 years 5 days ago #7811 by Iscariah
Signature field? was created by Iscariah
Hi,
And thanks for a very nice plugin you have in Author Info Box!

I wonder if it is possible to add a new field in this plugin?
I'm thinking about the signature field from Kunena, so i can add some formated text to it.

Something like this:

This is just a example.

Thanks for all answers!

Regards
Iscariah

6 years 5 days ago #7812 by Uhtred
Replied by Uhtred on topic Signature field?
Hi Iscariah,

I have moved your request to the correct section where the developer is notified. He will answer you here!

Regards
Vitja
6 years 5 days ago #7813 by Iscariah
Replied by Iscariah on topic Signature field?
Hi,

Thanx!!

Sorry for that. :blush: :oops:

Regards
Iscariah
6 years 4 days ago - 6 years 4 days ago #7815 by Vitja
Replied by Vitja on topic Signature field?
Hello Iscariah,

first of all I wanted to thank you for your subscription and the interest in my extension.

Your request is possible, here is the solution:

Open: plugins/content/authorinfobox/authorinfobox.php

Search: function getDescription - line 402
$query = 'SELECT '.$db->nameQuote('personalText').' FROM '.$db->nameQuote('#__kunena_users').' WHERE '.$db->nameQuote('userid').' = '.$author_id;

Change it to:
$query = 'SELECT '.$db->nameQuote('signature').' FROM '.$db->nameQuote('#__kunena_users').' WHERE '.$db->nameQuote('userid').' = '.$author_id;

If you use the bbcode
[img]...[/img]
in the signature, then you have to replace it with the correct img attribute.

Search (in the same function):
return $author_description;

And add before this line:
if(preg_match('@\[img\](.*)\[/img\]@isU', $author_description, $matches))
{
    $author_description = str_replace(array($matches[0], "\n"), array('<img src="'.$matches[1].'" alt="'.$matches[1].'" />', '<br />'), $author_description);
}

Have success with AIB.

Please support me with a review in the JED: extensions.joomla.org/extensions/news-di...-infos/authors/20830

Thank you!

Regards

Kubik-Rubik Joomla! Extensions

Please support my work with a review in the Joomla! Extensions Directory: extensions.joomla.org/profile/profile/details/61997
6 years 3 days ago #7818 by Iscariah
Replied by Iscariah on topic Signature field?
Hi Vitja,

And thanks for the reply on my question.

I don't understand what you mean by:

If you use the bbcode
[img]...[/img]
in the signature, then you have to replace it with the correct img attribute??

Probably me thats stupid.. :blush:
But i cant get it to work with bbcode? It's showing the codes together with the tekst and image. :(

Sorry for the trouble!

And thanks for all answers!

Regards
Iscariah
6 years 2 days ago #7821 by Vitja
Replied by Vitja on topic Signature field?
Hi Iscariah,

no problem.

Could you please post the whole text of the signature?

Regards

Kubik-Rubik Joomla! Extensions

Please support my work with a review in the Joomla! Extensions Directory: extensions.joomla.org/profile/profile/details/61997
6 years 1 day ago #7828 by Iscariah
Replied by Iscariah on topic Signature field?
Hi again,

And thanks for answering me. :)

This is the text/code i use in my signature:
[b]Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vel erat volutpat metus pharetra tempor ac non libero. Nullam mollis, neque ac consequat rutrum, libero tortor facilisis elit, pharetra tincidunt leo augue at sapien.[/b][br][b]My top weekly artists:[/b]
[url=http://www.last.fm/user/H-Edvardsen/?chartstyle=basic10][img]http://imagegen.last.fm/basic10/artists/5/H-Edvardsen.gif[/img][/url]

Thanks again for all the help!

Regards
Iscariah
6 years 18 hours ago #7838 by Vitja
Replied by Vitja on topic Signature field?
Okay, for your signature you have to change the code to this:
if(preg_match_all('@\[br\]@isU', $author_description, $matches))
{
    $author_description = str_replace(array('[br]', "\n"), array('<br />', '<br />'), $author_description);
}

if(preg_match('@\[img\](.*)\[/img\]@isU', $author_description, $matches))
{

    $author_description = str_replace(array($matches[0], "\n"), array('<img src="'.$matches[1].'" alt="'.$matches[1].'" />', '<br />'), $author_description);
}

if(preg_match('@\[url=(.*)](.*)\[/url]@isU', $author_description, $matches))
{

    $author_description = str_replace($matches[0], '<a href="'.$matches[1].'">'.$matches[2].'</a>', $author_description);
}

Regards

Kubik-Rubik Joomla! Extensions

Please support my work with a review in the Joomla! Extensions Directory: extensions.joomla.org/profile/profile/details/61997
5 years 11 months ago #7853 by Iscariah
Replied by Iscariah on topic Signature field?
Hi,
And thanks for the amazing good help!!

All is working well.
The only thing thats not working is the fonts in bold?

They show opp as:
[b]My top weekly artists:[/b]

Thanks again for the amazing support!! :)

Regards
Iscariah
5 years 11 months ago #7854 by Vitja
Replied by Vitja on topic Signature field?
Ooops, forgot these lines:
if(preg_match_all('@\[b\](.*)\[/b\]@isU', $author_description, $matches))
{
    $count = 0;

    foreach($matches[0] as $match)
    {
        $author_description = str_replace($match, '<strong>'.$matches[1][$count].'</strong>', $author_description);
        $count++;
    }
}

Add these lines before or after the other lines!

Regards

Kubik-Rubik Joomla! Extensions

Please support my work with a review in the Joomla! Extensions Directory: extensions.joomla.org/profile/profile/details/61997
Time to create page: 0.186 seconds