Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7855081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T20:16:33+00:00 2026-06-02T20:16:33+00:00

Can you help me on this: class Custom_View_Helper_AddThis extends Zend_View_Helper_Abstract { static $instances =

  • 0

Can you help me on this:

class Custom_View_Helper_AddThis extends Zend_View_Helper_Abstract
{

    static $instances = 0;

    /**
     * @var Zend_View_Interface 
     */
    public $view;

    /**
     *  Return AddThis social sharin toolkit
     *  @param $url uri of page to share
     *  @param $title title of page
     *  @param $anews render social addthis at the end of the news
     *  @return void
     */
    public function addThis($url = null, $title = null, $anews = false) {
        $domain = 'http://' . $_SERVER['HTTP_HOST'] . '/';
        $link = $domain . $url;
        $html = <<<EOT
        <!-- AddThis Button BEGIN -->
        <div class="addthis_toolbox addthis_default_style" addthis:url="$link" addthis:title="$title">
        <a class="addthis_button_linkedin_counter"></a>
        </div>
        <!-- AddThis Button END -->
EOT;
        $html2 = sprintf('
        <div class="addthis_toolbox addthis_default_style" addthis:url="%s" addthis:title="%s">
        <a class="vl addthis_button_google_plusone" g:plusone:size="tall"></a>
        </div>', $link, $title);

        $tracking = "
        var addthis_config = {
            data_ga_property: 'UA-XXXXXXXX-X',
            data_ga_social: true
        };" . PHP_EOL;

        $src = "//s7.addthis.com/js/250/addthis_widget.js#pubid=xa-4f94ba586f83fcc8";
        self::$instances += 1;
        $mscript = $this->view->HeadScript();
        if (self::$instances == 1) {
            $mscript->appendScript($tracking);
            if ($anews) {
                $mscript->appendScript('
                $(document).ready(function(){
                  $("#social_link").append('. $html2 .');
                });
                ');
            }
            $mscript->appendFile($src);
        }
        return $html;
    }

    /**
     * Sets the view field 
     * @param $view Zend_View_Interface
     */
    public function setView(Zend_View_Interface $view) {
        $this->view = $view;
    }
}

I want to create a view helper for a zend project which will generate social sharing plugins.

I get the first icons and links set properly, but the ones send to the jQuery function don’t work and I got invalid XML tag syntax in firebug console. I tried over and over nothing I did seems to work.

Here the javascript generated

 $(document).ready(function(){
$("#social_link").html(
<div class="addthis_toolbox addthis_default_style" addthis:url="http://ayaou//news/bonjour-ayaou" addthis:title="Bonjour Ayaou">
<a class="vl addthis_button_tweet" tw:count="vertical"></a>
<a class="vl addthis_button_google_plusone" g:plusone:size="tall"></a>
<a class="addthis_button_facebook_like" fb:like:layout="button_count"
fb:like:action="recommend"></a>
<a class="addthis_button_facebook_send"></a>
</div>);
}); 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T20:16:35+00:00Added an answer on June 2, 2026 at 8:16 pm

    ok i changed my code for a simple and duplicate html code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

can you please help me with this issue the String class does not have
My head is about to explode with this logic, can anyone help? Class A
friends, i have a custom view class public class Zoom extends View { private
Currently I have a custom view: public class MyView extends View { public MyView(Context
I created custom adapter like this public class SettingsAdapter extends BaseAdapter{ ArrayList<String> Noptions =
Not sure if yall can help this time, as I'm just using this particular
http://jsfiddle.net/YaMhn/8/ ^^^^Take a look and see if you can help solve this Ok so
Can anyone help with this... vector<unsigned int> *vVec = new vector<unsigned int>; vVec .reserve(frankReservedSpace);
Can anyone help convert this this actionscript to Objective-c? if(mcMain.y >= stage.stageHeight - mcMain.height)
can someone help with this? I need the following function to do this... $x

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.