Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Plugins & Atahualpa »

Post Info Items and new plugins


  #1  
Old Jan 27, 2009, 07:21 PM
technstuff
 
6 posts · Jan 2009
I wanted to add some new options to the Post Info Items. An example would be this Share This

I have figured this much out
1. bfa_postinfo.php is where the code for the plugin and the %example% are coded. I noticed that is not the normal <php> that must plugins in use. I tried to code a plugin and failed
2. bfa_theme_options.php is where the description is held.

Any help would be greatly appreciated and when I finish the hacks I will post the code so you can expand your list of integrated plugins.
  #2  
Old Jan 28, 2009, 02:32 AM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
You're right, but you'd need a plugin template tag that does not print output, something like

PHP Code:
sharethis('echo=0'); 
A quick look revealed that share this may not have this. In that case you could try, in bfa_postinfo.php


PHP Code:
if (strpos($postinfo_string,'%share-this')!==false) {
######## SHARE THIS ########
if (function_exists('akst_share_link')) {
ob_start();
SHARE_THIS_TEMPLATE_TAGE_HERE
$share_this 
ob_get_contents();
ob_end_clean();
} else { 
$share_this ""; }

Then you should have the share this output inside $share_this and could, still in bfa_postinfo.php, (at the bottom where all the other replacements happen):

PHP Code:
$postinfo str_replace("%share-this%"$share_this$postinfo); 
And then add it as option to bfa_theme_options.php

I have not tried this. If you want to try this, please let me know if it worked.

Last edited by Flynn; Feb 22, 2009 at 11:58 AM. Reason: Changed two occurrences "find in postinfo.php" (wrong) to "find in bfa_postinfo.php"
  #3  
Old Feb 22, 2009, 11:37 AM
holyyakker
 
10 posts · Feb 2009
I've been looking at this and not quite clear exactly where you are suggesting I insert the additional code - could you clarify perhaps? I'd love to use this as Share This is a more powerful tool (in my opinion) than sociable.

To clarify, I can't find postinfo.php anywhere.

Last edited by holyyakker; Feb 22, 2009 at 11:39 AM.
  #4  
Old Feb 22, 2009, 11:59 AM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
Quote:
Originally Posted by holyyakker
I've been looking at this and not quite clear exactly where you are suggesting I insert the additional code - could you clarify perhaps? I'd love to use this as Share This is a more powerful tool (in my opinion) than sociable.

To clarify, I can't find postinfo.php anywhere.
Sorry and thanks for finding this. It should have been bfa_postinfo.php located at functions/bfa_postinfo.php

It's fixed now in the post above

The reason I chose Sociable is that Share This requires using an offsite service if memory serves right
  #5  
Old Feb 22, 2009, 12:02 PM
holyyakker
 
10 posts · Feb 2009
Further clarification - found what I should edit, tried the above code - didn't work.
Here is what I tried exactly:
Code:
if (strpos($postinfo_string,'%share-this')!==false) {
######## SHARE THIS ########
if (function_exists('akst_share_link')) {
ob_start();
if (function_exists('sharethis_button')) { sharethis_button(); } 
$share_this = ob_get_contents();
ob_end_clean();
} else { $share_this = ""; }
}
I have also tried this:
Code:
if (strpos($postinfo_string,'%share-this')!==false) {
######## SHARE THIS ########
if (function_exists('sharethis_button')) {
$share_this = sharethis_button();}
}
With this at the bottom:
Code:
$postinfo = str_replace("%share-this%", $share_this, $postinfo);
For clarification - this is the Share-This template tag:
Code:
<?php if (function_exists('sharethis_button')) { sharethis_button(); } ?>
I'm sure there is something simple I'm missing?
  #6  
Old Feb 22, 2009, 03:11 PM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
After you did the code additions in bfa_postinfo.php as described in post #2, you'd have to add %share-this% to one of the textareas at Atahualpa Theme Options -> Post/Page Info Items
  #7  
Old Feb 22, 2009, 04:29 PM
holyyakker
 
10 posts · Feb 2009
I'm sorry Flynn - I should have mentioned I did include the %share-this% to no avail. I'm going to go back and try again to see if perhaps I missed something.

Tried again in multiple combinations - still no dice.

Last edited by holyyakker; Feb 22, 2009 at 04:40 PM.
  #8  
Old Feb 22, 2009, 06:11 PM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
Plus the share this plugin needs to be installed (=uploaded) and activated
  #9  
Old Feb 26, 2009, 07:04 PM
holyyakker
 
10 posts · Feb 2009
Oh I definitely have Share this uploaded and activated - I still am not having any success. I'm sorry for being such a pain. I think I don't understand the code enough to see what I should be doing - this is a bit beyond my novice php abilities.
  #10  
Old Feb 26, 2009, 07:30 PM
holyyakker
 
10 posts · Feb 2009
I AM A GOD AMONG MEN!

.... okay, not really.

But I did fix the problem and it's so stupid I'm going to beat myself for a few hours now.

PHP Code:
if (strpos($postinfo_string,'%share-this')!==false) {
######## SHARE THIS ########
if (function_exists('sharethis_button')) {
ob_start();
sharethis_button();
$share_this ob_get_contents();
ob_end_clean();
} else { 
$share_this ""; }

This code at the bottom was 100% right.

PHP Code:
$postinfo str_replace("%share-this%"$share_this$postinfo); 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sociable, NextPage, and Post/Page Info Items ... A Thank You. fromtheranks Plugins & Atahualpa 0 Jun 26, 2009 09:40 PM
[SOLVED] Posts page info items ldsmedia Comments, trackbacks & pings 2 Jun 23, 2009 10:23 AM
How to use <?php... ?> code in "Post Info Items" sections? TotalBalance Post-Kicker, -Byline & -Footer 0 Mar 14, 2009 03:01 PM
Post/Page Info Items - Trackbacks Andrea Post-Kicker, -Byline & -Footer 2 Feb 27, 2009 05:13 AM
Post / Page Info Items - Button crashes comp, how do I add to post-footer? Image help everygirlssecret Post-Kicker, -Byline & -Footer 1 Jan 5, 2009 01:12 PM


All times are GMT -6. The time now is 02:51 PM.


Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.