Forums / Templates, Stylesheets, Page Layout / Facebook/Twitter Module

Facebook/Twitter Module

Views: 7,282

Results 21 to 38 of 38
17 Apr 2011, 1:44 PM
#21
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Facebook/Twitter Module

Get rid of the <tr> <td> <center> stuff - you don't need it, and it is currently invalid HTML due to missing elements.

You pulled the <div but then put in an extra </div>, so it is now unbalanced in the other direction.

<?php
/**
 * blank sidebox - allows a blank sidebox to be added to your site
 *
 * @package templateSystem
 * @copyright 2007 Kuroi Web Design
 * @copyright Portions Copyright 2003-2007 Zen Cart Development Team
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: blank_sidebox.php 2007-05-26 kuroi $
 */

  // test if box should display
  $show_social = true;

  if ($show_social == true) {
     $title =  BOX_HEADING_SOCIAL;
     $title_link = false;
     require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
  }
 ?>
  <div id="Facebook">
    <a href="http://www.facebook.com/pages/The-Esoteric-Emporium/145421388812693?sk=wall"><img src="images/fb.png" width="50" height="50" alt="Facebook" /></a>  <a href="http://twitter.com/YOUR-TWITTER-HERE"><img src="images/tw.png" width="50" height="50" /></a>
  </div>
18 Apr 2011, 2:31 AM
#22
delights avatar

delights

Zen Follower

Join Date:
May 2006
Location:
Queensland, Australia
Posts:
254
Plugin Contributions:
0

Re: Facebook/Twitter Module

gjh42:

Get rid of the <tr> <td> <center> stuff - you don't need it, and it is currently invalid HTML due to missing elements.

You pulled the <div but then put in an extra </div>, so it is now unbalanced in the other direction.

<?php /** * blank sidebox - allows a blank sidebox to be added to your site * * @package templateSystem * @copyright 2007 Kuroi Web Design * @copyright Portions Copyright 2003-2007 Zen Cart Development Team * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 * @version $Id: blank_sidebox.php 2007-05-26 kuroi $ */ // test if box should display $show_social = true; if ($show_social == true) { $title = BOX_HEADING_SOCIAL; $title_link = false; require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default); } ?> <div id="Facebook"> <a href="http://www.facebook.com/pages/The-Esoteric-Emporium/145421388812693?sk=wall"><img src="images/fb.png" width="50" height="50" alt="Facebook" /></a>  <a href="http://twitter.com/YOUR-TWITTER-HERE"><img src="images/tw.png" width="50" height="50" /></a> </div> ```

The Problem is now i still dont have a heading and now the icons are up the top instead of taking notice of the sort order and are off center.

18 Apr 2011, 4:05 AM
#23
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Facebook/Twitter Module

So add rules to your stylesheet, like

#Facebook {text-align: center; margin-top: 1.5em;}
#Facebook a img {margin: 0.5em;}

The heading I'm not sure about. Can you let us see your site?

18 Apr 2011, 4:21 AM
#25
delights avatar

delights

Zen Follower

Join Date:
May 2006
Location:
Queensland, Australia
Posts:
254
Plugin Contributions:
0

Re: Facebook/Twitter Module

gjh42:

So add rules to your stylesheet, like

#Facebook {text-align: center; margin-top: 1.5em;}
#Facebook a img {margin: 0.5em;}

The heading I'm not sure about. Can you let us see your site?

That fixes the alignment but still dosnt solve the problem of it ignoring the sort Order and the heading.

18 Apr 2011, 5:10 AM
#26
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Facebook/Twitter Module

By "ignoring the sort Order", do you mean that it isn't set to be at the top of the column? The social container is not inside the regular structure of the sidebar as it should be, but loose in the sidebar container, at the same depth as the regular structure itself. The template is such a strange and antiquated mess of nested tables that I don't know if a properly constructed modern sidebox can work in it. I'm also not sure you have a properly constructed sidebox; what do you have for /includes/templates/your_template/sideboxes/tpl_social.php? Do you have any other sidebox mods installed? What version of Zen Cart are you running?

18 Apr 2011, 5:37 AM
#27
delights avatar

delights

Zen Follower

Join Date:
May 2006
Location:
Queensland, Australia
Posts:
254
Plugin Contributions:
0

Re: Facebook/Twitter Module

gjh42:

By "ignoring the sort Order", do you mean that it isn't set to be at the top of the column? The social container is not inside the regular structure of the sidebar as it should be, but loose in the sidebar container, at the same depth as the regular structure itself. The template is such a strange and antiquated mess of nested tables that I don't know if a properly constructed modern sidebox can work in it. I'm also not sure you have a properly constructed sidebox; what do you have for /includes/templates/your_template/sideboxes/tpl_social.php? Do you have any other sidebox mods installed? What version of Zen Cart are you running?

Yea, it is suppose to be down near the information side box instead of being up the top..

However when i use my coding;

<?php
/**
 * blank sidebox - allows a blank sidebox to be added to your site
 *
 * @package templateSystem
 * @copyright 2007 Kuroi Web Design
  * @copyright Portions Copyright 2003-2007 Zen Cart Development Team
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: blank_sidebox.php 2007-05-26 kuroi $
 */

  // test if box should display
  $show_social = true;

  if ($show_social == true) {
      $title =  BOX_HEADING_SOCIAL;
      $title_link = false;
      require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
 }
 ?>
 	<tr>
  	<td>
		<div id="Facebook">
		<a href="http://www.facebook.com/pages/The-Esoteric-Emporium/145421388812693?sk=wall"><img src="images/fb.png" width="50" height="50" alt="Facebook" /></a>  <a href="http://twitter.com/YOUR-TWITTER-HERE"><img src="images/tw.png" width="50" height="50" /></a></div>
		</div>
    </td>
  </tr>

It is in the right place...

As for /includes/templates/your_template/sideboxes/tpl_social.php?, nope dont have the file, dont need it.

18 Apr 2011, 5:47 AM
#28
delights avatar

delights

Zen Follower

Join Date:
May 2006
Location:
Queensland, Australia
Posts:
254
Plugin Contributions:
0

Re: Facebook/Twitter Module

I was just looking at the site again and notice that it is importing the information from "Information" into the box for Social Networking..

WTF ?

18 Apr 2011, 5:58 AM
#29
delights avatar

delights

Zen Follower

Join Date:
May 2006
Location:
Queensland, Australia
Posts:
254
Plugin Contributions:
0

Re: Facebook/Twitter Module

Okay, i just noticed that my coding seems to cause a bug where it copies the information from "Information" and puts it into the box listed Social....

:(

So reverting back to blank sidebox;

tpl_social.php

<?php
/**
 * Product Type - allows you to show a sidebox that will list Product Types.
 *
 * @package templateSystem
 * @copyright 2007 Kuroi Web Design
  * @copyright Portions Copyright 2003-2007 Zen Cart Development Team
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: product_type.php 2007-05-26 kuroi $
 */

  $content = '';
  $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">';

  // Replace the text and HTML tags between the apostophes on lines 19 and 20.
  // Use as many or as few lines using this model as you need for your custom content.
  // If you have a multilingual site define your text in the languages/YOUR_LANGUAGE/extra_definitions/blank_sidebox_defines.php and include it as shown in line 19.
  // If your site is monolingual, you can put the text right here as shown on line 20 (and nobody will know!)
  $content .= '<p>' . TEXT_BLANK_SIDEBOX . '</p>';
  $content .= '<p>You can include text, links, images, HTML markup and even PHP code</p>';

  $content .= '</div>';
?>

and

social.php

<?php
/**
 * blank sidebox - allows a blank sidebox to be added to your site
 *
 * @package templateSystem
 * @copyright 2007 Kuroi Web Design
  * @copyright Portions Copyright 2003-2007 Zen Cart Development Team
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: blank_sidebox.php 2007-05-26 kuroi $
 */

  // test if box should display
  $show_social = true;

  if ($show_social == true) {
      require($template->get_template_dir('tpl_social.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_social.php');
	  $title =  BOX_HEADING_SOCIAL;
      $title_link = false;
      require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
 }
 ?>
18 Apr 2011, 6:01 AM
#30
delights avatar

delights

Zen Follower

Join Date:
May 2006
Location:
Queensland, Australia
Posts:
254
Plugin Contributions:
0

Re: Facebook/Twitter Module

Now i just need to change tpl_social.php to show the images... right ?

18 Apr 2011, 6:05 AM
#31
delights avatar

delights

Zen Follower

Join Date:
May 2006
Location:
Queensland, Australia
Posts:
254
Plugin Contributions:
0

Re: Facebook/Twitter Module

Bingo, i think i got it....

<?php
/**
 * Product Type - allows you to show a sidebox that will list Product Types.
 *
 * @package templateSystem
 * @copyright 2007 Kuroi Web Design
  * @copyright Portions Copyright 2003-2007 Zen Cart Development Team
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: product_type.php 2007-05-26 kuroi $
 */

  $content = '';
  $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent centeredContent">';
  $content .= '<a href="http://www.facebook.com/pages/The-Esoteric-Emporium/145421388812693?sk=wall"><img src="images/fb.png" width="50" height="50" alt="Facebook" /></a>  <a href="http://twitter.com/YOUR-TWITTER-HERE"><img src="images/tw.png" width="50" height="50" /></a>';
  $content .= '</div>';
?>
18 Apr 2011, 1:10 PM
#32
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Facebook/Twitter Module

Glad it's working now! You'll notice that the functional difference between your original social.php module file and the final version is that the standard code layout calls the tpl_ file before the $column_box_default file, while you had $column_box_default before the content. I was remiss in not checking on that when I thought your coding was unusual.

19 Apr 2011, 1:05 AM
#33
delights avatar

delights

Zen Follower

Join Date:
May 2006
Location:
Queensland, Australia
Posts:
254
Plugin Contributions:
0

Re: Facebook/Twitter Module

gjh42:

Glad it's working now! You'll notice that the functional difference between your original social.php module file and the final version is that the standard code layout calls the tpl_ file before the $column_box_default file, while you had $column_box_default before the content. I was remiss in not checking on that when I thought your coding was unusual.

Wasnt just that change either, it was also the coding in the TPL that was changed, however i will upload the mod to Zencart so everyone else can put it on their site if they wish.

19 Apr 2011, 1:32 AM
#34
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Facebook/Twitter Module

The require for the tpl_ file has the same effect as putting the code right in the module file - it's the sequence that makes a real difference. You now have code executing in the right sequence.

It will be good to have a packaged set of the right files for that... be sure to look at the mod submission guidelines when putting it together.

7 Sep 2011, 12:42 AM
#35
jonjay avatar

jonjay

New Zenner

Join Date:
Nov 2007
Location:
Sheboygan
Posts:
4
Plugin Contributions:
0

Re: Facebook/Twitter Module

I have a quick question please........when I 1st installed everything working fine.......but now I have no log in on the twitter side......

Blank white screen with the info box on top on twitter page.

show as http://twitter.com/#!/WAW_JonJay when it use to do http://twitter.com/WAW_JonJay.

Did something get messed up??

15 Dec 2011, 10:15 PM
#36
sharc316 avatar

sharc316

Zen Follower

Join Date:
Mar 2011
Posts:
160
Plugin Contributions:
0

Re: Facebook/Twitter Module

Hi guys. I downloaded this mod for twitter and facebook. I was able to install it, the only thing that I would like the links to open in a new window so that my customers dont leave the site. Can someone please help with this.

This is the code:

<!-- Start Facebook&Twitter Links --> <br /> <br /> <center>   <a href="http://www.facebook.com/bequjuice"><img src="images/social/fb.png" width="50" height="50" alt="Facebook" /></a>  <a href="http://twitter.com/bequjuice"><img src="images/social/tw.png" width="50" height="50" /></a>   </center> <!-- End Facebook&Twitter Links -->

Thanks

16 Dec 2011, 4:23 PM
#38
sharc316 avatar

sharc316

Zen Follower

Join Date:
Mar 2011
Posts:
160
Plugin Contributions:
0

Re: Facebook/Twitter Module

Perfect. Thanks!