Sidebar links & images

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

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:

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

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: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

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;
}
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
User avatar
abdulhalim
Master Bludit
Posts: 128
Joined: Thu Mar 10, 2016 6:25 pm
Location: Bandar Abbas
Been thanked: 4 times
Contact:

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

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: 128
Joined: Thu Mar 10, 2016 6:25 pm
Location: Bandar Abbas
Been thanked: 4 times
Contact:

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: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

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

P. S. No comment about the test image. ;-)
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
User avatar
abdulhalim
Master Bludit
Posts: 128
Joined: Thu Mar 10, 2016 6:25 pm
Location: Bandar Abbas
Been thanked: 4 times
Contact:

:lol: :lol: :lol: Grav is that you ?
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

:roll:
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
Post Reply