Support Forums

Tip button in template

This is a discussion on Tip button in template within the Customizations forums, part of the Developer Forums category; Hello, I use C68 v4.2.1 Developer with the Sigma Ocean template. I'm busy for days now to add a TIP ...


Go Back   68 Classifieds Forums > Developer Forums > Customizations

Reply
 
Thread Tools Display Modes
Old 12-05-2010, 11:10 AM   #1
Customer
 
Join Date: Oct 2010
Posts: 53
Rep Power: 5
zooi is on a distinguished road
Default Tip button in template

Hello,

I use C68 v4.2.1 Developer with the Sigma Ocean template.

I'm busy for days now to add a TIP button to the template in layout.tpl

Unfortunately I can't get it done.... but if I put the code in a seperate page it works mighty fine, see Click here to see example

Here is the code: (of course I have included the php code with {php} code {/php}


Code:
<?php
include 'include/SmarTip.php';
$SmarTip = new SmarTip('normalTip');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
    <head>
        <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js" type="text/javascript" ></script>
        <script src="js/smarTip.js" type="text/javascript" ></script>
        <?php
            echo $SmarTip->getDecorators();
        ?>
        <title>Your Web Title</title>
    </head>
    <body>
    <?php
        echo $SmarTip->runSmarTip();
    ?>
    <!-- Your site here -->
    </body>
</html>
I have also tried to rewrite it to smarty template - but I have to practice some more

Who can give me a hint to get this to work?

Thank you for help
zooi is offline   Reply With Quote
Old 12-05-2010, 11:42 AM   #2
curmudgeon
 
Join Date: Mar 2006
Posts: 5,411
Rep Power: 138
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

Its likely a path issue. Your trying to call $SmarTip in a template but where is the underlying php file?
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline   Reply With Quote
Old 12-05-2010, 12:09 PM   #3
Staff
 
Join Date: Mar 2006
Posts: 587
Rep Power: 34
Blair will become famous soon enough
Default

I agree with Larry.
It's likely a path issue.
__________________
Blair
68C Staff

68C Downloads | Report a Bug | Knowledge Base
If you have a current support subscription, you can Submit a Support Ticket
Blair is offline   Reply With Quote
Old 12-05-2010, 01:27 PM   #4
Customer
 
Join Date: Oct 2010
Posts: 53
Rep Power: 5
zooi is on a distinguished road
Default

Larry, Blair,

Thank you for your help. I try to solve the path issue, but I'm not sure if that is the problem (maybe I oversee something)

This is how it is in the layout.tpl



Code:
{php}
include 'modules/Smartip/include/SmarTip.php';
$SmarTip = new SmarTip('normalTip');
{/php}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
	<meta name="author" content="TemplateCodes.com, modified by KeesB" />
	<title>{$sitetitle}</title>
	<meta name="Keywords" content="{$sitekeywords}" />
	<meta name="Description" content="{$sitedescription}" />
	{if $smarty.server.SERVER_PORT == '443'}
	<base href="{$smarty.const.URLS}/" />
	{else}
	<base href="{$smarty.const.URL}/" />
	{/if}
    {php}echo $SmarTip->getDecorators();{/php}
	<link rel="stylesheet" href="templates/{$smarty.const.MAIN_TEMPLATE}/css/style.css" type="text/css" />
    <link rel="stylesheet" type="text/css" media="screen" href="templates/{$smarty.const.MAIN_TEMPLATE}/css/superfish2.css" />
    <link rel="shortcut icon" href="favicon.ico">
	<!--[if IE]>
	<link rel="stylesheet" href="templates/{$smarty.const.MAIN_TEMPLATE}/css/ie.css" type="text/css" />
	<![endif]-->
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js" type="text/javascript" ></script>
    <script type="text/javascript" src="modules/Smartip/js/smarTip.js"></script>
	<script type="text/javascript" src="modules/templatecodes/scripts/jquery-1.3.2.min.js"></script>
	<script type="text/javascript" src="javascript/main.js"></script>
	<script type="text/javascript" src="modules/templatecodes/scripts/jcook.js"></script>
	<script type="text/javascript" src="modules/templatecodes/scripts/layout.js"></script>
	<script type="text/javascript" src="modules/templatecodes/scripts/superfish.js"></script>
	{literal}
		<script type="text/javascript">
		<!--//
		$(document).ready(function(){
		$('.sf-menu').superfish();
		});
		//-->
		</script>
	{/literal}
	{$header}
	{modulehook function="tpl_layout_head" options=""}
</head>
<body>
<!--
This template was designed and sold by TemplateCodes.com (An Adept Marketing Business) � 2009 TemplateCodes.com All Rights Reserved.
-->
{php} echo $SmarTip->runSmarTip();{/php}
<div id="wrapper">
bla
bla
etc
Enclosed the underlaying php file SmarTip.php

All underlaying files are located in the folders: css, images, js, include under

/httpdocs/modules/Smartip/
Attached Files
File Type: zip SmarTip.zip (3.5 KB, 1 views)

Last edited by zooi; 12-05-2010 at 01:34 PM.
zooi is offline   Reply With Quote
Old 12-05-2010, 02:59 PM   #5
curmudgeon
 
Join Date: Mar 2006
Posts: 5,411
Rep Power: 138
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

You have

include 'include/SmarTip.php';

in your template which means that since its being called from a template its going to look for the smartip.php file in your template folder, is that where you have the files?
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline   Reply With Quote
Old 12-05-2010, 03:22 PM   #6
Customer
 
Join Date: Oct 2010
Posts: 53
Rep Power: 5
zooi is on a distinguished road
Default

Ok checked once more and Yes..in /httpdocs/modules/Smartip/include/SmarTip.php

but still don't work
zooi is offline   Reply With Quote
Old 12-05-2010, 04:22 PM   #7
curmudgeon
 
Join Date: Mar 2006
Posts: 5,411
Rep Power: 138
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

Quote:
Originally Posted by zooi
Ok checked once more and Yes..in /httpdocs/modules/Smartip/include/SmarTip.php

but still don't work
No, thats not what I asked, I asked if it was in your TEMPLATE folder because thats where your telling it to look.

Assuming 68C is installed in the root of your site and your using the default template, your templates are in

/httpdocs/templates/default

so when a template file loads thats where its going to start looking but your telling it smartip is in /includes so its actually going to be looking in

/httpdocs/templates/default/includes
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline   Reply With Quote
Old 12-06-2010, 01:42 PM   #8
Customer
 
Join Date: Oct 2010
Posts: 53
Rep Power: 5
zooi is on a distinguished road
Default

Hello Larry,

Yes C68 is in the root and in C68 there is a folder modules and in the folder modules there is a folder Smartip and in the folder Smartip there is a folder include and in this folder there is SmarTip.php

I try to understand but somewhere I don't understand your question or I miss interpret it...

I include the SmarTip.php include 'modules/Smartip/include/SmarTip.php'; from my point of view it is going to search in the right place.

My templates are in /httpdocs/templates/Sigma-Ocean/

I think what I have done is correct........but ok I'm not sure any more

If I look to the source of my page then {php} echo $SmarTip->runSmarTip();{/php}
give as output
HTML Code:
<div id="smarTip"><div class="bulb imagen" id="bulb"></div></div><div id="wrapper">
but {php}echo $SmarTip->getDecorators();{/php} should give a style sheet as out put but it don't show up
zooi is offline   Reply With Quote
Old 12-06-2010, 01:50 PM   #9
Staff
 
Join Date: Mar 2006
Posts: 587
Rep Power: 34
Blair will become famous soon enough
Default

Zooi-

You're layout.tpl file is in the templates/default/ folder. You're trying to include the modules/Smartip/include/SmarTip.php file.
So, if you say
Code:
include 'modules/Smartip/include/SmarTip.php';
The code is looking for the modules/ folder inside the templates/default/ folder

Try this:
Code:
{php}
include '../../modules/Smartip/include/SmarTip.php';
$SmarTip = new SmarTip('normalTip');
{/php}
__________________
Blair
68C Staff

68C Downloads | Report a Bug | Knowledge Base
If you have a current support subscription, you can Submit a Support Ticket
Blair is offline   Reply With Quote
Old 12-06-2010, 02:04 PM   #10
Customer
 
Join Date: Oct 2010
Posts: 53
Rep Power: 5
zooi is on a distinguished road
Default

Hello Blair,

I tried your suggestion, but the result is

HTTP-fout 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.
zooi is offline   Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
On/off button damiun Customizations 0 11-26-2009 08:13 AM
css - button formatting adexinc Templates, HTML, CSS, and Design Help 3 10-13-2009 09:45 AM
<button> as Submit button bowers01 Templates, HTML, CSS, and Design Help 1 09-27-2008 05:21 AM
Logout Button goin4savvy Technical Support 2 05-20-2008 11:54 AM
Modify Button ? VikingBEAR Technical Support 1 05-10-2008 11:57 PM


All times are GMT -4. The time now is 11:05 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2011, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0