Trying to incorporate feature into plugin

Post Reply
budm
Jr. Bludit
Posts: 3
Joined: Mon Jun 15, 2020 1:09 am

Firstly, I'm going to be honest I'm rusty as all heck with PHP, HTML, and CSS, but been working on trying to build a new website for my shop, and stumbled upon Bludit and absolutely love the easy of deployment, and the very lightweight design.

So, now I get to the meat and potatoes of my problem. I'm trying to incorporate the features of the old plugin Ribbon into my modified version of G3nshop, and I've figured most the other problems, but I'm down to one function that I can't figure out how to update. Any help would be appreciated.

Code: Select all


		$html = ''.PHP_EOL;
		$html .= '<style type="text/css" media="screen">
	        .stickybar{position:fixed;left:0;right:0;top:0;font-size:14px; font-weight:400; height:35px; line-height:35px; overflow:visible; text-align:center; width:100%; z-index:1000; border-bottom-width:3px; border-bottom-style:solid; font-family:Georgia,Times New Roman,Times,serif; color:#fff; border-bottom-color:#fff; margin:0; padding:0; background-color: #' .$this->getDbField('color'). ';-webkit-border-bottom-right-radius:5px;-webkit-border-bottom-left-radius:5px;-moz-border-radius-bottomright:5px;-moz-border-radius-bottomleft:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;}
	         body {margin-top:35px !important}
	        .stickybar a, .stickybar a:link, .stickybar a:visited, .stickybar a:hover{color:#' .$this->getDbField('linkcolor'). ';font-size:14px; text-decoration:none; border:none;  padding:0}
	        .stickybar a:hover{text-decoration:underline}
	        .stickybar a{color:#fff; display:block;padding-bottom: 8px; text-align:center; text-decoration:none;text-shadow:0 0 0.1em #000}
	        .stickybar a:hover{ opacity: 0.8}
	        </style>'.PHP_EOL;
	     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:

budm wrote: Mon Jun 15, 2020 1:17 am I'm trying to incorporate the features of the old plugin Ribbon into my modified version of G3nshop, and I've figured most the other problems, but I'm down to one function that I can't figure out how to update.
And what is the function? The code given is mostly CSS.
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
budm
Jr. Bludit
Posts: 3
Joined: Mon Jun 15, 2020 1:09 am

Sorry, I just posted the snippet that I knew was causing trouble, because thats what I was able to narrow it down to, and I'm aware its mostly CSS.

The full function:

Code: Select all

public function siteHead()
	{
		$html = ''.PHP_EOL;
		
	    if ($this->getDbField('type') == 'ribbon') 
	     { 
	      $html .= '<style type="text/css" media="screen">
	      .ribbon{ background-color: #' .$this->getDbField('color'). '; z-index:1000;padding:3px;position:fixed;top:2em;' .$this->getDbField('display'). ':-3em; -moz-transform:rotate(' .($this->getDbField('display') =='left'? '-45':'45'). 'deg); -webkit-transform:rotate(' .($this->getDbField('display')=='left' ? '-45':'45'). 'deg); -moz-box-shadow:0 0 1em #888; -webkit-box-shadow:0 0 1em #888} 
	      .ribbon a{ border:1px dotted rgba(255,255,255,1); color:#' .$this->getDbField('linkcolor'). '; display:block; font:normal 81.25% "Helvetiva Neue",Helvetica,Arial,sans-serif; margin:0.05em 0 0.075em 0; padding:0.5em 3.5em; text-align:center; text-decoration:none;text-shadow:0 0 0.5em #333}
	      .ribbon a:hover{ opacity: 0.5}
	      </style>'.PHP_EOL;
	    } else { 
	      $html .= '<style type="text/css" media="screen">
	        .stickybar{position:fixed;left:0;right:0;top:0;font-size:14px; font-weight:400; height:35px; line-height:35px; overflow:visible; text-align:center; width:100%; z-index:1000; border-bottom-width:3px; border-bottom-style:solid; font-family:Georgia,Times New Roman,Times,serif; color:#fff; border-bottom-color:#fff; margin:0; padding:0; background-color: #' .$this->getDbField('color'). ';-webkit-border-bottom-right-radius:5px;-webkit-border-bottom-left-radius:5px;-moz-border-radius-bottomright:5px;-moz-border-radius-bottomleft:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;}
	         body {margin-top:35px !important}
	        .stickybar a, .stickybar a:link, .stickybar a:visited, .stickybar a:hover{color:#' .$this->getDbField('linkcolor'). ';font-size:14px; text-decoration:none; border:none;  padding:0}
	        .stickybar a:hover{text-decoration:underline}
	        .stickybar a{color:#fff; display:block;padding-bottom: 8px; text-align:center; text-decoration:none;text-shadow:0 0 0.1em #000}
	        .stickybar a:hover{ opacity: 0.8}
	        </style>'.PHP_EOL;
	     } 
	     
	     return $html;   
	}

The big thing is I'm not using all of this, only about half of it. And to help anymore, I'm attaching a link to the original source:
https://github.com/dignajar/bludit-plug ... plugin.php
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:

The plugin is deprecated and has to be rewritten. But I don't know if there is really a need of it (perhaps I can have a look at it this week).

Instead of the plugin you can use a ribbon css generator. You will find some generators with a search engine.
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
budm
Jr. Bludit
Posts: 3
Joined: Mon Jun 15, 2020 1:09 am

Edi wrote: Mon Jun 15, 2020 6:34 pm The plugin is deprecated and has to be rewritten. But I don't know if there is really a need of it (perhaps I can have a look at it this week).

Instead of the plugin you can use a ribbon css generator. You will find some generators with a search engine.
I understand that its deprecated, and I figured it wouldn't work as is.

I have put in place a one of those ribbon, but the problem I'm running into is I want to be able to change the text from within the admin panel without having to get into my cpanel and then file manager and manually modifying the text. I got all the other parts of that plugin updated, and not causing any problems, but that function I'm not sure how to rewrite it to work with the newest version of Bludit.
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:

The plugin is updated and again available:

https://plugins.bludit.com/plugin/ribbon
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
Post Reply