RB Internal Links v2.0.14

A mini maintenance release addressing a shortfall in the wordpress shortcode parser.

Unfortunately the wordpress shortcode API can’t successfully process the following:

[intlink id="1" /]
Normal content
[intlink id="2"]Link content[/intlink]

OR

[intlink id="1"][/intlink]
Normal content
[intlink id="2"]Link content[/intlink]

To circumvent this, where users require no link text (to display the post title), the plugin will now accept the string “{{empty}}” as the link content like so:

[intlink id="1"]{{empty}}[/intlink]
Normal content
[intlink id="2"]Link content[/intlink]

I submitted a bug 2 years ago [http://core.trac.wordpress.org/ticket/9264], unfortunately it remains unfixed at the date of this post.

Posted in Uncategorized | 2 Comments

jQuery find next element in DOM by selector

If you need to find the next occurrence of an element within the DOM, but aren’t sure where it is (i.e. you can’t just use $.next) I wrote a jQuery plugin that will traverse through the DOM from the current element til it hits either the ‘body’ tag or a parent you specify.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
(function( $ ){
    $.fn.nextElementInDom = function(selector, options) {
        var defaults = { stopAt : 'body' };
        options = $.extend(defaults, options);
 
        var parent = $(this).parent();
        var found = parent.find(selector);
 
        switch(true){
            case (found.length > 0):
                return found;
            case (parent.length === 0 || parent.is(options.stopAt)):
                return $([]);
            default:
                return parent.nextElementInDom(selector);
        }
    };
})( jQuery );

Download it here: jquery.nextElementInDom.js

And here is how you would use it:

1
var elementNeeded = $('.firstElement').nextElementInDom('.secondElement');

Where your HTML might look like this:

<html>
  <body>
    <div>
      <span class="firstElement">Our first element</span>
    </div>
 
    <ul>
      <li>
        <span class="secondElement">Second element is in a different place</span>
      </li>
    </ul>
  </body>
</html>
Posted in Web dev | 2 Comments

php-ssrs v0.1

A beta release of php-ssrs, a PHP SOAP client for Sql Reporting Services, that I helped write with Ideal Websites is now available for download.

Grab a copy of it from the Google Code project page here: php-ssrs

The QuickStart guide should be all you need to get going, there are also more detailed samples available in the download. Getting a rendered report is made real easy, just take a look at the sample below:

1
2
3
4
5
6
7
8
9
10
11
12
13
$options = array(
    'username' => 'testing',
    'password' => 'password'
);
 
$ssrs = new SSRS_Report('http://localhost/reportserver/', $options);
$result = $ssrs->loadReport('/Reports/Reference_Report');
 
$ssrs->setSessionId($result->executionInfo->ExecutionID);
$ssrs->setExecutionParameters(new SSRS_Object_ExecutionParameters($result->executionInfo->Parameters));
 
$output = $ssrs->render('HTML4.0'); // PDF | XML | CSV
echo $output;
Posted in SSRS | Leave a comment

RB Internal Links v2.0.13

v2.0.13 (08/03/2011)

  • Added support for custom post types
  • WIKI style support for posts that don’t exist when logged in as an admin
  • Class of “missingLink” applied to anchor of links with no post/page
  • Show posts with a status of ‘post’, ‘draft’, ‘pending’ or ‘future’ in UI list
  • Italian translation file
Posted in RB Internal Links | 2 Comments

ReportService2010.asmx is not the only SSRS 2008 R2 end point

In our on-going quest to create a PHP SDK for Sql Reporing Services 2008 RS, we’ve shot ourselves in the foot by not reading the documentation properly.

The end point documentation states that:

The ReportService2005 and ReportService2006 endpoints are deprecated in SQL Server 2008 R2. The ReportService2010 endpoint includes the functionalities of both endpoints and contains additional management features.

We took this to mean that all end point functions were handled by ReportService2010.asmx but couldn’t find a way to render a report through this service. If we’d read down a little further we could have discovered that execution requests (i.e. rendering reports) is still handled by ReportExecution2005.asmx

As the MSDN documentation concludes, there are three endpoints for Sql Server 2008 RS:

ReportService2010 Provides the APIs for managing a report server that is configured for either native or SharePoint integrated mode.
ReportExecution2005 Provides the APIs for running and navigating reports.
ReportServiceAuthentication Provides the APIs for authenticating users against a report server when the SharePoint Web application is configured for Forms Authentication.
Posted in SSRS, Web dev | Leave a comment
  • Categories

  • Archives