Sidebar links & images

Post Reply
loud
Jr. Bludit
Posts: 5
Joined: Wed Mar 09, 2016 9:54 pm

Sat Mar 12, 2016 9:53 am

Hello,

Just wondering how its possible to add external links and images in the sidebar?

Thanks :)
User avatar
Fred
Legend Bludit
Posts: 236
Joined: Wed Jun 24, 2015 2:14 pm
Location: France
Contact:

Sat Mar 12, 2016 10:38 am

Hi,

Yes edit the about plugin in backend, you can change the title and content ;)
╰☆╮Bludit╰☆╮ is a open source and community contributions are essential to project success!
You are looking for a light forum based Json? Try my project Flatboard, it is free. ;)
Sorry for my little english, i'm french :oops:
loud
Jr. Bludit
Posts: 5
Joined: Wed Mar 09, 2016 9:54 pm

Sat Mar 12, 2016 10:49 am

Yeah, this is the first thing I tried, but href links didnt work, and neither did bludit blog formated links, Im sure Im missing something really obvious here! :oops:
User avatar
Edi
Site Admin
Posts: 1663
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Contact:

Sat Mar 12, 2016 6:35 pm

If you use the plugin "About" the characters for < and > have to be converted when they are used for an html tag.

You can modify the file plugin.php as follows:

Code: Select all

public function siteSidebar()
{

$about = $this->getDbField('text');
$about = htmlspecialchars_decode($about);

echo $about;

	$html  = '<div class="plugin plugin-about">';
	$html .= '<h2>'.$this->getDbField('label').'</h2>';
	$html .= '<div class="plugin-content">';
	$html .= nl2br($about);
	$html .= '</div>';
	$html .= '</div>';

	return $html;
}
Planet Bludit, Tipps, Snippets und nützliche Links. - Newsletter, Informationen zu Bludit (auf Deutsch).
User avatar
abdulhalim
Master Bludit
Posts: 88
Joined: Thu Mar 10, 2016 6:25 pm

Sat Mar 12, 2016 8:01 pm

Thank you Edi ,

This was my question too , today i was struggling with my question :lol: but this solution has a problem , at least for me , it duplicates the content , image or text will show twice

Image
loud
Jr. Bludit
Posts: 5
Joined: Wed Mar 09, 2016 9:54 pm

Sat Mar 12, 2016 8:14 pm

I actually tried that mod but corrupted something, so will reinstall the blog and try again later, thanks for helping
User avatar
abdulhalim
Master Bludit
Posts: 88
Joined: Thu Mar 10, 2016 6:25 pm

Sat Mar 12, 2016 8:16 pm

I remove echo $about ; , now it's working perfectly ... Thank you Edi

Code: Select all

<?php

class pluginAbout extends Plugin {

	public function init()
	{
		$this->dbFields = array(
			'label'=>'About',
			'text'=>''
		);
	}

	public function form()
	{
		global $Language;

		$html  = '<div>';
		$html .= '<label>'.$Language->get('Plugin label').'</label>';
		$html .= '<input name="label" id="jslabel" type="text" value="'.$this->getDbField('label').'">';
		$html .= '</div>';

		$html .= '<div>';
		$html .= '<label>'.$Language->get('About').'</label>';
		$html .= '<textarea name="text" id="jstext">'.$this->getDbField('text').'</textarea>';
		$html .= '</div>';

		return $html;
	}

	public function siteSidebar()
{

$about = $this->getDbField('text');
$about = htmlspecialchars_decode($about);



   $html  = '<div class="plugin plugin-about">';
   $html .= '<h2>'.$this->getDbField('label').'</h2>';
   $html .= '<div class="plugin-content">';
   $html .= nl2br($about);
   $html .= '</div>';
   $html .= '</div>';

   return $html;
}
}
User avatar
Edi
Site Admin
Posts: 1663
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Contact:

Sat Mar 12, 2016 8:50 pm

Oops, sorry, I added the echo for test purposes and forgot to delete it!

P. S. No comment about the test image. ;-)
Planet Bludit, Tipps, Snippets und nützliche Links. - Newsletter, Informationen zu Bludit (auf Deutsch).
User avatar
abdulhalim
Master Bludit
Posts: 88
Joined: Thu Mar 10, 2016 6:25 pm

Sat Mar 12, 2016 9:34 pm

:lol: :lol: :lol: Grav is that you ?
User avatar
Edi
Site Admin
Posts: 1663
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Contact:

Sat Mar 12, 2016 9:54 pm

:roll:
Planet Bludit, Tipps, Snippets und nützliche Links. - Newsletter, Informationen zu Bludit (auf Deutsch).
Post Reply