Pivot hack: how to display images in search results |
To include images in the titles of blog posts using Pivot requires hacking the source code because the pivot source code is including a wordwrap function around the title that cuts off the words at 40 characters (I turned the color red so you could see where the number would need to be increased). You could extend the wordwrap number to be a larger number so that most strings don’t wrap or just remove the wordwrap function (which is what I’m showing you how to do below).
Here is what you need to do:
STEP 1. download the file /pivot/modules/module_search.php in ASCII mode and backup this file before continuing. If you make a mistake then all you have to do is upload the old one back.
STEP 2. open with a text editor and scroll down to LINE 288:
Replace this line of code:
$output .= “<li><!– “. $entry[’code’].” –><a href=’” . $link . “‘>” . wordwrap($entry[’title’], 40, ” “, 1) . “</a><br /></li>\n”;
WITH THIS:
/* $output .= “<li><!– “. $entry[’code’].” –><a href=’” . $link . “‘>” . wordwrap($entry[’title’], 40, ” “, 1) . “</a><br /></li>\n”;
HACK for images in search results 4/17/04
*/
$output .= “<li><!– “. $entry[’code’].” –><a href=’” . $link . “‘>” . $entry[’title’] . “</a><br /></li>\n”;
STEP 3. If you want to have a different URL for the image then the blog entry and no border for the image then you need to edit your blog entry title to include a closing < /a> tag and to have a border=0 inside the IMG code.
NOTE: see how the code in step #2 automatically embeds the closing A tag. Make sure to leave the last A in your images open or you’ll have broken HTML.
STEP 4. FTP changed module_search.php file over the top of the old file in ASCII mode an voila! You should be able to include images in the titles of blog entries with individual links.
Happy coding to you!
Related Posts- Adding standalone trackback to your (Pivot) weblog
- How to build a Google subscribed link for your about/bio page step by step
- Pivot 1.10 Trackback(X) hack — how to display the number of trackbacks
- How to quickly generate a podcast only RSS feed
- ASCII Generator
- Disabling Nofollow in Wordpress 1.5



