bibuweb.de

The weblog of bibuweb.de

Browsing Posts published by admin

Zendsplitter

No comments

The Zendframework is a huge collection of useful PHP-Scripts, which helps you to code less and create more.
The complete framework comes in an about 18 MB big compressed file.

Decompressed the Zendlibrary folder contains more than 2700 files in more than 480 subdirectories.
The folders are ordered in modules, where each module provides a specific code for a certain solution.

So far so good, the problem is, that almost every module or standalone file within the framework depends on another module or file. This means that if you want to use only a specific module (e.g. Rest) you have to find out the dependencies to the other modules by try-and-error or to install the whole framework.

Sometimes it isn’t possible or recommended to install the whole framework, if you are writing applications for particular shared hosting enviroments or plugins for other applications.

So I was looking for an easy solution with which I can use only one of these modules without installing the whole Zendframework. So I wrote a small comandline php script that copies a module and all its dependencies in to a user defined folder.

This allows me to use the power of the Zendframework without the need to install it all. Another advantage is, that the distibution file set of the application or plugin will become much smaller.

How does the script work?

  • The script is a comandline script and needs three parameter:
    1. where to find the library files (modules) normaly they are installed under Zendframework/library
    2. The module (directory name) or file you want to useful
    3. The path where to copy the files

What does the script do?

  • it scans each file in the module directory if a line contains the function “require_once ‘”. If the script found such a line, it extracts the module name and path from the require_once function.
  • With this information the script looks up the modules needed.
  • Then the script looks up all dependecies from each module found
  • this goes until all dependecies where solved and copied to the directory you specified

Try it out

I must admit, that the widget functionality of the wp-banner plugin works slightly different from other WP-widgets. And after some guys mentioned that the wp-banner plugin using as a widget isn’t self-explanatory I will give you here a short howto.

Before you can put your advert into a widget, you have to make all the configuration in the Posts > Banner Admin menu. After you have put all the parameters needed, you can choose where to put the ad, into a own <div> or into a widget.

After you have chosen widget and saved the configuration you can go to the Appearance > Widgets menu where you can place the banner widget the usual way. No further options are needed. :-)

Hi all,

after a bug report from a wp-banner plugin user I made a small bugfix release of my wordpress banner plugin.

This release fixes a bug affecting the admin area, where the start_date and end_date values after a banner update were not correctly displayed.

You can download the new version at wordpress.org

This new version is widgetized. So now its possible to put banner ads into a widget and/or into a DIV. This means now you are able to include more than one advertise banner in your wp-blog.

To place the banner into a widget you have to choose the widget option at Position in banner admin menu. If divTag is elected, the banner position is to define as described in this post.

Please keep in mind, that if you put an advertisement into a widget, that you have to check that the banner have a corresponding dimension. If not, you may destroy your theme layout. You can adjust the banner to your theme by changing the styles in /styles/default.css.

The install process also is improved. Only unpack the plugin into the plugin directory and activate it, done. :-) To make an update, deactivate the old version first.

After an update you may change the Position option in the admin menu. The default option is divTag, so after an update everything may work as designed ;-)

Download it here.

Hi,

This is a short tutorial that is dedicated to help PHP programmers who get in trouble connecting a SOAP-service using the native php5 soap functions.

This part describes how to check a SOAP-call on a command line. If you have trouble connecting a SOAP-Service you should do this first, to ensure you have created a valid SOAP-Request.

To check if your soap-request is well-formed, put it into a file e.g. soaptest.xml and check it with xmllint
xmllint soaptest.xml

If everything is ok, the program will output the file content, otherwise it will throw an error message.

When there appears no error, the second step is to check if the soap-request will produce a response without errors. To check this out we can use the curl program.
Sometimes you have to send several requests to the soap-server. To simplify the requests we create a curl config file (e.g. soapheader.txt) with the appropriate parameters:

header = "Content-Type: text/xml; charset=utf-8"
header = "SOAPAction: urn:<uri to soap-function>"
data = "@soaptest.xml"
url = "<url to soap-service>"

Do the test request:

curl -K soapheader.txt

to format the output we can use xmllint again

curl -K soapheader.txt | xmllint --format -

If you are lucky you will receive a soap-response and if you are very lucky the xml-response is what you expected.
Otherwise there appears no response or rather no output, this occurs when your request produces a server error. To have a look to the server response you can dump the header information to a file (e.g. header.txt):

curl -K soapheader.txt -D header.txt

With this information you should be able to solve your problems ;-)

New wp-banner version

2 comments

This version supports a better banner positioning method.

To put the banner to the postion wanted you need a correct css-theme and an
actual wp-version !

Keep in mind that the banner-div is placed as first child of a parent element.

A parent element can be a tagname e.g. “body”, a classname or an element id.
If you call InsertElement in banner.php you have to edit the first two parameters.
With the first parameter you define the tag-id. This could be “tag” for a tag element
“class” for a class element “id” for an element id.

The second parameter defines the element name.

E.g. if you want to place the banner div after the body tag element you have
to call InsertElement(‘tag’,'body’,'banner’)

if you want to place the banner div between the latest and the penultimate
post you can use InserElement like this:

InsertElement(‘id’,'post-1′,’banner’)

Supposed there is a post-2 element as latest post.

You have to consinder that if you want to place the banner like this, you do a layout manipulation !
That means you have to take care of the banner and/or the wp-theme layout css !!
The wp-banner style-sheet is found in “styles” folder.

You can download the new version here

bibuweb is back

Comments off

Hi all,

after a heavy server crash I needed some time to reconfigure this site.

Unfortunately some information I posted before were lost and I had no chance to get it back (only one that I found in Goggles cache).

Alfredo

New WP-Banner Plugin

No comments

Hi again,running your own webserver costs a lot of money. So it would be nice if one could unwind the monthly costs with a little income from banner advertisement.

Since I was using WordPress for my site I was looking for a banner administration tool, which fits my needs. Searching the web at the appropriate sites (i.e. wp-plugins.org | net) I didn’t found what I’m looking for.
But I remembered that the e107 cms had a good banner administration tool, which I’m still using on my site bilderbuchreisen.de. So I decided to adapt this tool to WordPress.

Very important for me is that I can manage banners from different affiliate programs. This programs normaly are counting the hits and views directly so that they offers you two URLs one for the banner it self and one URL for the clicks. The original e107 tool doesn’t support this feature and in addition it has some features more that I didn’t need, so I had to rewrite the complete code.

Ok, if your are curious now. You can download it here