Can this be done?

Scenario, I have a site pages, populated with database info we have already.

I want a block added to the page with the "Facebook Like Box" for said website page on Facebook like example.

When entering the "sites" data into Dolphin, can there be an extra box to put the code?

i.e.

<div class="fb-like-box" data-href="http://www.facebook.com/boonex" data-width="292" data-show-faces="true" data-stream="true" data-header="true"></div>

the above would be entered into the sites info when adding, and stored in the database to be pulled up and shown on the sites page.

ManOfTeal.COM a Proud UNA site, six years running strong!
Quote · 3 Sep 2012

Perhaps with Deano's Tools somehow?

ManOfTeal.COM a Proud UNA site, six years running strong!
Quote · 3 Sep 2012

Don't know. I have not looked at or even played with the sites module. Lack of time.

https://www.deanbassett.com
Quote · 3 Sep 2012

I was asked something like this a bit ago, I will review my notes again

PixelSofa, Inc. - a fresh view of the web - www.pixelsofa.com
Quote · 3 Sep 2012

Thanks,

seems as it would be an input field for the line to go into the database, pulling the code to display the site facebook fan page [edit] {like box} as well, an option if they have one.

I tried to come up with a half ass method but can't figure out what to inject into the database. Not that good with it.

ManOfTeal.COM a Proud UNA site, six years running strong!
Quote · 3 Sep 2012

Well if it was me, i would do that other way around. Put a textbox for users to add their facebook username and then code a block that will fetch the username into that block and add the username to the like box code and output it to the browser. AH!!!! Pretty simple stuff but very nice idea.

so much to do....
Quote · 4 Sep 2012

 

Well if it was me, i would do that other way around. Put a textbox for users to add their facebook username and then code a block that will fetch the username into that block and add the username to the like box code and output it to the browser. AH!!!! Pretty simple stuff but very nice idea.

 I would only want the user to put the URL "http://www.facebook.com/boonex" in the field if they have a fan page, otherwise it would be a normal "sites" page.

ManOfTeal.COM a Proud UNA site, six years running strong!
Quote · 4 Sep 2012

i am saying to do this

add a block with code like this

<div class="fb-like-box" data-href="http://www.facebook.com/'.$getTheFacebookName.'" data-width="292" data-show-faces="true" data-stream="true" data-header="true"></div> 

here you will fetch the facebook username from DB and output the code to the browser. Get that?

so much to do....
Quote · 4 Sep 2012

 

i am saying to do this

add a block with code like this

<div class="fb-like-box" data-href="http://www.facebook.com/'.$getTheFacebookName.'" data-width="292" data-show-faces="true" data-stream="true" data-header="true"></div> 

here you will fetch the facebook username from DB and output the code to the browser. Get that?

 That sounds good. Not quite sure your understanding.

 

I have the website on the sites page, let's say i.e. boonex.com but, like most business also have a facebook page. i.e. http://www.facebook.com/boonex so we would have two pages on the sites page. Well not really two.

There would be the usual info that is on the sites view page, with an additional box that only shows the like box.

Like box

ManOfTeal.COM a Proud UNA site, six years running strong!
Quote · 4 Sep 2012

You want a like box inside a block on the sites view page. correct?

so much to do....
Quote · 4 Sep 2012

 

You want a like box inside a block on the sites view page. correct?

 yes sir Cool

ManOfTeal.COM a Proud UNA site, six years running strong!
Quote · 4 Sep 2012

You want me to give you the codes? lol

so much to do....
Quote · 4 Sep 2012

well if you have done it, yes of course, that's up to you.

ManOfTeal.COM a Proud UNA site, six years running strong!
Quote · 4 Sep 2012

no, i have not done it doing it now.

so much to do....
Quote · 4 Sep 2012

 

no, i have not done it doing it now.

 if you do you should make this a module..

http://mynewbeetle.net/7.1/m/sites/view/BoonEx-Community-Software-Experts

This is exactly what I want, but, if you look at my other "sites" pages, the like box remains the same, I want that box to have data pulled from the database that is entered by the site submitter.. this is not an automatic feature, they would be required to post that facebook link. It in turn is stored in the database.

the JavaScriptSDK would be in the sites _footer.html file.

<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=YOURFACEBOOKAPPID";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

ManOfTeal.COM a Proud UNA site, six years running strong!
Quote · 4 Sep 2012

Here are the steps to get this to work.

First run these queries.

ALTER TABLE `bx_sites_main` ADD `facebookID` VARCHAR( 255 ) NOT NULL

Now add a block in page builder in the sites view page and name it "Facebook Likebox" or whatever

and edit it in phpmyadmin and put the in the FUNC field "FacebookLike"

Now you can replace the file or do as follows

Edit modules/boonex/sites/classes/BxSitesFormAdd.php at line 163 add the code like this

'description' => array(

                    'type' => 'textarea',

                    'name' => 'description',

                    'value' => isset($this->_aParam['description']) ? $this->_aParam['description'] : '',

                    'caption' => _t('_bx_sites_form_description'),

                    'required' => true,

                    'html' => 1,

                    'checker' => array (

                        'func' => 'length',

                        'params' => array(1,64000),

                        'error' => _t('_bx_sites_form_field_err'),

                    ),

                    'db' => array(

                        'pass' => 'XssHtml'

                    )

                ),

                'facebookID' => array(

'type' => 'text',

'name' => 'facebookID',

'caption' => 'Your Facebook Username',

'required' => fasle,

'db' => array(

'pass' => 'Xss',

),

),

                'thumbnail' => array(

                    'type' => 'custom',

                    'name' => 'thumbnail',

                    'content' => '',

                    'caption' => 'Thumbnail'

                ),

And edit the file BxSitesPageView.php at line 41 add this

function getBlockCode_FacebookLike() {

$sFacebookID = $this->_aSite['facebookID'];

$sContent = '

<div id="fb-root"></div>

<script>(function(d, s, id) {

  var js, fjs = d.getElementsByTagName(s)[0];

  if (d.getElementById(id)) return;

  js = d.createElement(s); js.id = id;

  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";

  fjs.parentNode.insertBefore(js, fjs);

}(document, \'script\', \'facebook-jssdk\'));</script>

<div class="fb-like-box" data-href="http://www.facebook.com/'.$sFacebookID.'" data-width="292" data-show-faces="true" data-stream="true" data-header="true"></div>';

return $sContent;

}

clear your DB cache and done :D

BxSitesPageView.php · 7.1K · 235 downloads
BxSitesFormAdd.php · 9.8K · 234 downloads
so much to do....
Quote · 4 Sep 2012

Did you try this on your demo yet?

wow, if this is all it takes it's amazing Prashank

ManOfTeal.COM a Proud UNA site, six years running strong!
Quote · 4 Sep 2012

yes, its tested.

facebook_like.jpg · 83.9K · 219 views
so much to do....
Quote · 4 Sep 2012

 

yes, its tested.

 can you look here?

http://mynewbeetle.net/7.1/m/sites/view/BoonEx-Community-Software-Experts

not facebook ID but the URL like the one for boonex.

I went into the database and changed the ID to the URL but it's not showing.

I cleaned cache.

Thanks Prashank!

ManOfTeal.COM a Proud UNA site, six years running strong!
Quote · 4 Sep 2012

 does that matter, its just a name to be used in code and its working there so, i guess you get it to work.

but if not, you have to change this also

$sFacebookID = $this->_aSite['facebookID'];

to

$sFacebookID = $this->_aSite['facebookUrl'];

 

yes, its tested.

 can you look here?

http://mynewbeetle.net/7.1/m/sites/view/BoonEx-Community-Software-Experts

not facebook ID but the URL like the one for boonex.

I went into the database and changed the ID to the URL but it's not showing.

I cleaned cache.

Thanks Prashank!

 

so much to do....
Quote · 4 Sep 2012

Wait.. it's working. Instead of the long URL it's as simple as you made it!!!!!

in the field like my duval locals site, the input would be "duvallocals" my Facebook ID "duh"

I cannot express my gratitude!

ManOfTeal.COM a Proud UNA site, six years running strong!
Quote · 4 Sep 2012

well you're welcome.

Good luck

so much to do....
Quote · 4 Sep 2012
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.