Resource icon

Long Description + BBcode 1.2

No permission to download

Basti

Administrator
Staff member
Basti submitted a new resource:

Long Description + BBcode - Adds a long description field to join form and edit pages to allow your members to spice up profile

This is a beta release, if you encounter any bugs reply below.

What this mod does:

Adds a "long description" field to join form and edit pages to allow your members to spice up their profile page.

Why a seperate field? why not just add this to the existing description?

Good question ;) by adding a second field it allows us to display the short description on the ranking pages without all the BBcode being parsed. That would look ugly and slow things down. This way only the...
Read more about this resource...
 

xgcell

Member
I love this idea. I see a lot of topsites that allow users to add pictures, videos, text, and more to their stats page. Is this plugin still being worked on? The youtube button does not work for me

Also if it had an iframe option, that would be nice!
 

Basti

Administrator
Staff member
You should never, ever allow an iframe on a public form, that just asks for attacks!

Youtube should be handled via their own plugins. It has such button, but it not get parsed on the frontend. I just posted the plugin, Mark made it, so i am not sure what he intended to do here, maybe that button was just a leftover.

But youtube, should be handled via a own plugin.
custom join form to enter youtube url, then let a plugin parse that url and construct the iframe on the details page.

But how to do it not belongs here, if you need to get instructions please ask for help in the plugin request section
 

xgcell

Member
Alright cool, thanks for the info. I have seen some sites that let people have youtube videos. Ill post for a how to in the requests section then.
 

panzerdude

Member
hi, I dont see these edits in the join_form or edit_form html files for installation, is that still required?

Thanks
 

Basti

Administrator
Staff member
Yes you need those. The instruction is from parabola, so your might look different

You need to have this on your submit button
Code:
onclick="wswgEditor.doCheck();"
 

panzerdude

Member
Yes you need those. The instruction is from parabola, so your might look different

You need to have this on your submit button
Code:
onclick="wswgEditor.doCheck();"

Im running parabola too, this is the closest I found in the join_form.html, but Im not sure what to edit.

Code:
      <div id="submitButtonDiv">
            <br class="cb" />
            <button class="button1" name="submit" type="submit">{$lng->join_header}</button>
        </div>
 

Mark

Administrator
Staff member
try this:

Code:
<div id="submitButtonDiv">
            <br class="cb" />
            <button class="button1" name="submit" type="submit" onclick="wswgEditor.doCheck();">{$lng->join_header}</button>
        </div>
 

panzerdude

Member
try this:

Code:
<div id="submitButtonDiv">
            <br class="cb" />
            <button class="button1" name="submit" type="submit" onclick="wswgEditor.doCheck();">{$lng->join_header}</button>
        </div>

thanks allot mark,

any idea how I can fix the buttons, the pic below.
Untitled-1.png
 

Mark

Administrator
Staff member
ahh need to add a few CSS rules to make them wider, i don't have the source code available at the moment, but if you highlight the buttons (using firefox) and then right click, "view selection source" this will show you the HTML classes in use, then you can add width:30px; to your CSS file for those classes.
 

panzerdude

Member
ahh need to add a few CSS rules to make them wider, i don't have the source code available at the moment, but if you highlight the buttons (using firefox) and then right click, "view selection source" this will show you the HTML classes in use, then you can add width:30px; to your CSS file for those classes.

I cant seem to get the right class edit. Can you try when you can Mark, no rush, thank you.
@Mark
 
Last edited:

panzerdude

Member
What ever class I try and edit seems to change other things too. I cant seem to narrow it down to the right class to add the width.
 

Mark

Administrator
Staff member
I added this to the end of my css file, seems to have done the trick

Code:
.editbar button {width: 23px;}
fix.jpg
 

panzerdude

Member
Im getting this error when a link is added to the long description and I click on the sites details page then this comes up below. Any ideas, thanks


Fatal error
: Call to undefined function handle_url_tag() in/home/battlefieldclans/public_html/sources/details.php(162) : eval()'d code(32) : regexp codeon line1
 

Mark

Administrator
Staff member
hmm we should disable that URL function, you probably don't want people adding links to your long descriptions as this will undoubtedly lead to spam.


This is the ugly function that was used (adapted from punBB) back when this plugin was originally created, but I would rather remove the URL linking button from the editor rather than integrate it.

Code:
function handle_url_tag($url, $link = '')
{

$full_url = str_replace(array(' ', '\'', '`', '"'), array('%20', '', '', ''), $url);
if (strpos($url, 'www.') === 0) // If it starts with www, we add http://
$full_url = 'http://'.$full_url;

// Ok, not very pretty :)
$link = ($link == '' || $link == $url) ? ((strlen($url) > 55) ? substr($url, 0 , 39).' &hellip; '.substr($url, -10) : $url) : stripslashes($link);

return '<a href="'.$full_url.'">'.$link.'</a>';
}
 

panzerdude

Member
hmm we should disable that URL function, you probably don't want people adding links to your long descriptions as this will undoubtedly lead to spam.


This is the ugly function that was used (adapted from punBB) back when this plugin was originally created, but I would rather remove the URL linking button from the editor rather than integrate it.

Code:
function handle_url_tag($url, $link = '')
{

$full_url = str_replace(array(' ', '\'', '`', '"'), array('%20', '', '', ''), $url);
if (strpos($url, 'www.') === 0) // If it starts with www, we add http://
$full_url = 'http://'.$full_url;

// Ok, not very pretty :)
$link = ($link == '' || $link == $url) ? ((strlen($url) > 55) ? substr($url, 0 , 39).' &hellip; '.substr($url, -10) : $url) : stripslashes($link);

return '<a href="'.$full_url.'">'.$link.'</a>';
}

hi Mark, Im having a hard time finding where this code is so I can remove it.


Even without the button, if people put a link in the long description Im getting a blank white profile page.
 

Basti

Administrator
Staff member
You get that error because the function mark posted is missing

If you want it, try adding it anywhere in details_build_page.php

If you rather want to get rid of urls, like Mark suggested, you need to remove

Code:
    '#\[url\]([^\[]*?)\[/url\]#e',
    '#\[url=([^\[]*?)\](.*?)\[/url\]#e',
and
Code:
    'handle_url_tag(\'$1\')',
    'handle_url_tag(\'$1\', \'$2\')',
So the script not looks for a missing function
 
Top