Recent Topics

1 Jun 23, 2009 20:31    

My b2evolution Version: 2.x

I'm dusting off my coding chair and i'm trying to design a skin or two for b2evo. The problem that I've run into is skin function not having a url for me to point scripts to. This is an example below:


<head>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
	<base href="http://blogger.mochadee.com/b23/skins/Berona/" />
	<script language="javascript" type="text/javascript" src="/b23/plugins/mochavid_plugin/js/playerembed.js"></script>
<script language="javascript" type="text/javascript" src="/b23/plugins/mochavid_plugin/js/swfobject.js"></script>
<script language="javascript" type="text/javascript" src="/b23/plugins/thickbox_plugin/js/jquery-latest.pack.js"></script>
<script language="javascript" type="text/javascript" src="/b23/plugins/thickbox_plugin/js/thickbox.js"></script>
<link rel="stylesheet" type="text/css" media="screen" href="/b23/plugins/thickbox_plugin/css/thickbox.css" />

<link href="http://blogger.mochadee.com/b23/plugins/gallery_plugin/includes/styles/_gallery.css" rel="stylesheet" type="text/css" /><link rel="stylesheet" href="http://blogger.mochadee.com/b23/plugins/gallery_plugin/includes/lightbox/css/lightbox.css" type="text/css" media="screen" /><script src="http://blogger.mochadee.com/b23/plugins/gallery_plugin/includes/lightbox/js/prototype.js" type="text/javascript"></script><script src="http://blogger.mochadee.com/b23/plugins/gallery_plugin/includes/lightbox/js/scriptaculous.js?load=effects" type="text/javascript"></script><script src="http://blogger.mochadee.com/b23/plugins/gallery_plugin/includes/lightbox/js/lightbox.js" type="text/javascript"></script><script type="text/javascript" >var gallery_url = 'http://blogger.mochadee.com/b23/plugins/gallery_plugin/';</script>	<title>Blog A Title</title>
	<meta name="description" content="" />
	<meta name="keywords" content="" />
		<meta name="generator" content="b2evolution 3.2.0-beta" /> <!-- Please leave this for stats -->
	<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="http://blogger.mochadee.com/b23/blog1.php?tempskin=_rss2" />
	<link rel="alternate" type="application/atom+xml" title="Atom" href="http://blogger.mochadee.com/b23/blog1.php?tempskin=_atom" />

 	<link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://blogger.mochadee.com/b23/xmlsrv/rsd.php?blog=1" />
	<meta name="viewport" content="width = 750" />
    <link href="style.css" rel="stylesheet" type="text/css" media="screen">
    <script type="text/javascript" src="http://blogger.mochadee.com/b23/blog1.phpjquery-1.2.3.min.js"></script>
    <script type="text/javascript" src="jquery.easing.min.js"></script>
    <script type="text/javascript" src="jquery.lavalamp.min.js"></script>

You guys should note that the plugins get a handler for the url shown here:

<script language="javascript" type="text/javascript" src="/b23/plugins/thickbox_plugin/js/jquery-latest.pack.js"></script>

So that in the php the code looks like this:

function SkinBeginHtmlHead(&$params) {
    if ($this->Settings->get('usethickbox2')) {
      print("<script language=\"javascript\" type=\"text/javascript\" src=\"".$this->get_plugin_url()."js/jquery-latest.pack.js\"></script>\n");
      print("<script language=\"javascript\" type=\"text/javascript\" src=\"".$this->get_plugin_url()."js/thickbox.js\"></script>\n");
      print("<link rel=\"stylesheet\" type=\"text/css\" media=\"screen\" href=\"".$this->get_plugin_url()."css/thickbox.css\" />\n");
    } 

Does b2evo have a function that could be written that simple so that I could say:

$this->get_skin_url();

?

I'm just asking since I set out to create a skin I don't want to have to create a new function to do what I need to do.

Recap: I need a function or a way to get the url to the skin's folder dynamically that way I can create the full path to a .js file that the skin needs to work and have it's visual effects maximized. As in:

<script language="javascript" type="text/javascript" src="<?php $this.get_skin_url(); ?>/jquery-latest.pack.js"></script>


Translating into:
<script language="javascript" type="text/javascript" src="/skins/MochaSkin/jquery-latest.pack.js"></script>

Any takers? Edb? Afwas? Please help.

Thanks,

-mochababy

2 Jun 23, 2009 21:07

Hi

I might have misunderstood your question but I am not sure you need the function you are thinking of. The base is always set to the folder of the skin so urls are relative to this:

<base href="http://blogger.mochadee.com/b23/skins/Berona/" /> 

L

3 Jun 23, 2009 21:25

You are correct! I looked at that before but couldn't parse how to get that url and none of the rest of the tag that the function creates. That was my sticking point and so I looked elsewhere.


Form is loading...