Jump to content

[Plugin] Announcement -Released-


Blesta Addons
Message added by Michael,

Important Notice:

We have received reports that this developer is not responding to support requests. Some extensions may not be compatible with newer versions of Blesta.

Recommended Posts

 

Just a quick tip:

<?php echo $this->TextParser->encode("markdown", $announcement->body);?>

Should only be called if $announcement->body is markdown text. If it's already HTML (and you trust this HTML because you entered it into the system from a WYSIWYG editor) then just use:

<?php echo $this->Html->ifSet($announcement->body);?>

 

Thanks, that solved it ;)

 

For anyone that has not yet solved It, just replace all the content in announcement/views/client_main_view.pdt with the bellow codes;

 

<?php
// Don't show this container when only rendering the widget section
if (!$this->Html->ifSet($render_section)) {
?>
<div class="col-md-12">
<?php
}
echo $this->Html->ifSet($message);
 
$this->WidgetClient->clear();
$this->WidgetClient->setStyleSheet($this->view_dir . "css/styles.css", array('id' => "announcements_styles"));
$this->WidgetClient->create($this->_("ClientMain.view.boxtitle_announcement", true, $this->Html->ifSet($announcement->title)), array('id'=>"announcements_client_main_article"), $this->Html->ifSet($render_section, null));
$this->WidgetClient->startBody();
?>
<div class="announcement">
<!---
<aside>
<div class="col-md-3 ">
<div class="panel panel-default" id="accordion">
<ul class="list-group">
<li>
<a href="<?php echo $this->Html->safe($this->base_uri . "plugin/announcements/client_main/");?>"  >
<?php $this->_("ClientMain.view.root_directory");?>
<span class="pull-right">
<span class="glyphicon glyphicon-home"></span>
</span>
</a>
</li>
<li>
<a href="#" >
<?php $this->_("ClientMain.view.date");?><?php $this->Html->_($announcement->date_added);?>
<span class="pull-right">
<span class="glyphicon glyphicon-time"></span>
</span>
</a>
</li>
 
</ul>
</div>
</div>
</aside>
-->
<div class="col-md-12 ">
<ol class="breadcrumb">
<li>
<a href="<?php echo $this->Html->safe($this->base_uri . "plugin/announcements/client_main/index/");?>">
<?php $this->_("ClientMain.view.root_directory");?>
</a>
</li>
<li  class="active" >
<?php $this->Html->_($announcement->title);?>
</li>
</ol>
<div class="well well-sm">
<h2><?php $this->Html->_($announcement->title);?></h2>
</div>
 
<?php
if (!empty($announcement)) {
?>
<div class="well well-sm">
<div class="article_view">
<?php echo $this->Html->ifSet($announcement->body);?>
</div>
</div>
<?php
}
else {
?>
<div class="col-md-12">
<h3><?php $this->_("ClientMain.view.announcements");?></h3>
<div class="alert alert-info">
<p><?php $this->_("ClientMain.view.no_announcement");?></p>
</div>
</div>
<?php
}
?>
</div>
</div>
 
<?php
$this->WidgetClient->endBody();
$this->WidgetClient->end();
 
// Don't show this container when only rendering the widget section
if (!$this->Html->ifSet($render_section)) {
?>
</div>
<?php
}
?>
 
 
 
 
Link to comment
Share on other sites

Looks great, awesome work! Very useful plugin.  :)

 

Thanks

 

 

Thanks, that solved it ;)

 

For anyone that has not yet solved It, just replace all the content in announcement/views/client_main_view.pdt with the bellow codes;

 

 

i have updated the files to new version 1.1.0 with some changes .

 

 

What a great plugin! I plan on installing it later today!

 

Thanks for making this :)

 

i happy that will help you , always in your services .

 

 

Just a quick tip:

<?php echo $this->TextParser->encode("markdown", $announcement->body);?>

Should only be called if $announcement->body is markdown text. If it's already HTML (and you trust this HTML because you entered it into the system from a WYSIWYG editor) then just use:

<?php echo $this->Html->ifSet($announcement->body);?>

 

Updated the files to work perfectly .

Link to comment
Share on other sites

Hi Naja7host, thanks for the update  ;)

 

1. I think I found a bug there, If you publish an announcement and decide to un-publish It by removing the tick from the publish still the announcement remains as published.

 

2. I posted the first announcement and everything was good, the notification showed on the client dashboard as expected, but when I added the second announcement the first announcement notification still was stuck in the client dashboard no matter what.

Link to comment
Share on other sites

Hi Naja7host, thanks for the update  ;)

 

1. I think I found a bug there, If you publish an announcement and decide to un-publish It by removing the tick from the publish still the announcement remains as published.

 

2. I posted the first announcement and everything was good, the notification showed on the client dashboard as expected, but when I added the second announcement the first announcement notification still was stuck in the client dashboard no matter what.

1 - bug confirmed .

2 - bug confirmed .

stay tuned ; this night i will trace the errors and fix them .

Link to comment
Share on other sites

If anyone likes a cleaner design like this:
 
post-38-0-28216100-1409444105_thumb.png
 
Please go to: /html/billing/plugins/announcements/views/default/client_main_view.pdt
 
And replace the code with:

			<?php
			// Don't show this container when only rendering the widget section
			if (!$this->Html->ifSet($render_section)) {
				?>
				<div class="col-md-12">
				<?php
			}
					echo $this->Html->ifSet($message);
					
					$this->WidgetClient->clear();
					$this->WidgetClient->setStyleSheet($this->view_dir . "css/styles.css", array('id' => "announcements_styles"));				
					$this->WidgetClient->create($this->_("ClientMain.view.boxtitle_announcement", true, $this->Html->ifSet($announcement->title)), array('id'=>"announcements_client_main_article"), $this->Html->ifSet($render_section, null));
					$this->WidgetClient->startBody();
					?>
					<div class="announcement">
						<!---
						<aside>		
							<div class="col-md-3 ">				
								<div class="panel panel-default" id="accordion">
									<ul class="list-group">		
										<li>
											<a href="<?php echo $this->Html->safe($this->base_uri . "plugin/announcements/client_main/");?>"  >
												<?php $this->_("ClientMain.view.root_directory");?>
												<span class="pull-right">
													<span class="glyphicon glyphicon-home"></span>
												</span>	
											</a>								
										</li>
										<li>
											<a href="#" >										
												<?php $this->_("ClientMain.view.date");?><?php $this->Html->_($announcement->date_added);?>
												<span class="pull-right">
													<span class="glyphicon glyphicon-time"></span>
												</span>						
											</a>		
										</li>									

									</ul>
								</div>
							</div>
						</aside>
					-->
						<div class="col-md-12 ">
							<ol class="breadcrumb">
								<li>
									<a href="<?php echo $this->Html->safe($this->base_uri . "plugin/announcements/client_main/index/");?>">
										<?php $this->_("ClientMain.view.root_directory");?>
									</a>
								</li>
								<li  class="active" >
									<?php $this->Html->_($announcement->title);?> 			
								</li>						
							</ol>
							<div class="page-header">
								<h2><?php $this->Html->_($announcement->title);?></h2>								
							</div>	

							<?php
							if (!empty($announcement)) {
								?>					
							<div>	
								<div class="article_view">
									<?php echo $this->Html->ifSet($announcement->body);?>
									<!--- <?php echo $this->TextParser->encode("markdown", $announcement->body);?> -->
								</div>								
							</div>		
								<?php
							}
							else {
								?>
								<div class="col-md-12">
									<h3><?php $this->_("ClientMain.view.announcements");?></h3>
									<div class="alert alert-info">
										<p><?php $this->_("ClientMain.view.no_announcement");?></p>
									</div>
								</div>
								<?php
							}
							?>							
						</div>
					</div>
	
					<?php
					$this->WidgetClient->endBody();
					$this->WidgetClient->end();
				
			// Don't show this container when only rendering the widget section
			if (!$this->Html->ifSet($render_section)) {
					?>
				</div>
				<?php
			}
			?>

Idea mate: Maybe a counter to say how many people have viewed the annoucement?

Link to comment
Share on other sites

Idea mate: Maybe a counter to say how many people have viewed the annoucement?

 

a couner for announcement has no sense "in my opinion" . but maybe a will add in in some next release .

 

about the design , i will add setting to enable/disable the full view .  (thanks for the idea) .

 

the plugin has been updated to fix some bugs .

Link to comment
Share on other sites

Plugin Updated NOW 31-8-2014 to 1.2.0 ;

 

i have added the fallowinf options in settings tab :

 

- option to enable/disable widget in client side

- set how much announcement should be displayed in widget client

- add setting to show announcement in full width or with aside .

 

 

Any Suggestion/Bug Please report it here .

Link to comment
Share on other sites

Plugin Updated NOW 31-8-2014 to 1.2.0 ;

 

i have added the fallowinf options in settings tab :

 

- option to enable/disable widget in client side

- set how much announcement should be displayed in widget client

- add setting to show announcement in full width or with aside .

 

 

Any Suggestion/Bug Please report it here .

Merci  mate time to update :)

 

Edit: Updated but don't see a option to turn on / how to display a announcement in the client dashboard. I did overwrite all the files and the announcements are going DESC :P

Link to comment
Share on other sites

Click again to settings. Then its appear :)

 

Tried I enabled Blesta errors and got this:

Oh noes!

Trying to get property of non-object on line 115 in /chroot/home/username/licensecart.com/html/billing/plugins/announcements/controllers/admin_main.php

So I removed the files and re-uploaded the new files. Still get that error.

Link to comment
Share on other sites

i think you have some missing files .... re-downloads all the files . the settings tab should have this contents

https://github.com/Blesta-Addons/Announcement/blob/master/announcements/views/default/admin_main_settings.pdt

don't forget to update the plugin from the plugin manager .

 

Hey mate, I removed the folder fully, instead of removing the inside (Keeping the config.json) and it showed the upgrade button, however nothing is shown (Probably due to the missing config.json in the folder) on the plugin page.

 

And the settings page still doesn't work. I wonder if it's because I'm using a custom routes for my admin area?

 

-----

Tables look fine to me:

 

post-38-0-61359300-1409537223_thumb.png

post-38-0-17083700-1409537225_thumb.png

post-38-0-77143200-1409537226_thumb.png

 

Files in view/

post-38-0-33014800-1409537228_thumb.png

 

PS: using Blesta 3.3

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...