ken.kimbrell
04-22-2007, 11:36 PM
1) Script Title: Ajax Tabs Content script
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/index.htm
3) Describe problem:
I'm using the DD Ajax Tabs Content script on the front page of my Forum (http://www.mykimbrell.com/FamilyForum/index.php) and it works great.
My issue is that the content I want to add is just not working no matter how the code is written. (so far) :)
My current set up is with:
SMF 1.1.2
TinyPortal v0.9.8
Coppermine 1.4.10
cpmfetch 2.0.0
It’s all working OK and so there are no issues there, but the php file I want to call into the display in the Welcome tab of the DD menu is where I need help.
So here it is;
I’m trying to include the output of my cpmfetch ‘randonpic.php’ file at the bottom of the Welcome tab inserting it below the content that’s already in place there.
the 'cpmfetch' utility is setup to pull random selections from the Coppermine gallery and display them as seen at this next link, the pics change each time the page is refreshed
http://www.mykimbrell.com/cpg1410/cpmfetch/randompic.php
This is the code that is in the randompic.php file:
<?php
print "<center>";
include "./cpmfetch.php";
$objCpm = new cpm("./cpmfetch_config.php");
$objCpm->cpm_viewRandomMedia(1,3,array("imagesize" => "Thumb","imageheight" => "75","imagewidth" => "100","windowtarget" => "_new","alttag" =>"From Album: %a Added: %w"));
$objCpm->cpm_close();
print "</center>";
?>
I’ve searched the here in the DD pages, the cpmfetch pages and did Google searches but so far I'm just not finding the fix.
This is one of the versions of code that has been tried for pulling the cpmfetch output into the welcome tab…
<?php include("/cpg1410/cpmfetch/randompic.php"); ?>
This one and others have been tried in various spots in the existing code and with and without various tags,
You can see the current attempt at the bottom of the code below.
I would be most thankful for any help.
Here is the code from the DD tabbed content script:
<style type="text/css">
#tablist{
padding: 3px 0;
margin-left: 0;
margin-bottom: 0;
margin-top: 0.1em;
font: bold 12px Verdana;
}
#tablist li{
list-style: none;
display: inline;
margin: 0;
}
#tablist li a{
padding: 3px 0.5em;
margin-left: 3px;
border: 1px solid #778;
border-bottom: none;
background: white;
}
#tablist li a:link, #tablist li a:visited{
color:#87CEFA;
}
#tablist li a.current{
background: none;
}
#tabcontentcontainer{
width: 450px;
/* Insert Optional Height definition here to give all the content a unified height */
padding: 5px;
border: 1px solid black;
}
.tabcontent{
display:none;
}
</style>
<script type="text/javascript">
/***********************************************
* Tab Content script- ? Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/
//Set tab to intially be selected when page loads:
//[which tab (1=first tab), ID of tab content to display]:
var initialtab=[1, "sc1"]
////////Stop editting////////////////
function cascadedstyle(el, cssproperty, csspropertyNS){
if (el.currentStyle)
return el.currentStyle[cssproperty]
else if (window.getComputedStyle){
var elstyle=window.getComputedStyle(el, "")
return elstyle.getPropertyValue(csspropertyNS)
}
}
var previoustab=""
function expandcontent(cid, aobject){
if (document.getElementById){
highlighttab(aobject)
detectSourceindex(aobject)
if (previoustab!="")
document.getElementById(previoustab).style.display="none"
document.getElementById(cid).style.display="block"
previoustab=cid
if (aobject.blur)
aobject.blur()
return false
}
else
return true
}
function highlighttab(aobject){
if (typeof tabobjlinks=="undefined")
collecttablinks()
for (i=0; i<tabobjlinks.length; i++)
tabobjlinks[i].style.backgroundColor=initTabcolor
var themecolor=aobject.getAttribute("theme")? aobject.getAttribute("theme") : initTabpostcolor
aobject.style.backgroundColor=document.getElementById("tabcontentcontainer").style.backgroundColor=themecolor
}
function collecttablinks(){
var tabobj=document.getElementById("tablist")
tabobjlinks=tabobj.getElementsByTagName("A")
}
function detectSourceindex(aobject){
for (i=0; i<tabobjlinks.length; i++){
if (aobject==tabobjlinks[i]){
tabsourceindex=i //source index of tab bar relative to other tabs
break
}
}
}
function do_onload(){
var cookiename=(typeof persisttype!="undefined" && persisttype=="sitewide")? "tabcontent" : window.location.pathname
var cookiecheck=window.get_cookie && get_cookie(cookiename).indexOf("|")!=-1
collecttablinks()
initTabcolor=cascadedstyle(tabobjlinks[1], "backgroundColor", "background-color")
initTabpostcolor=cascadedstyle(tabobjlinks[0], "backgroundColor", "background-color")
if (typeof enablepersistence!="undefined" && enablepersistence && cookiecheck){
var cookieparse=get_cookie(cookiename).split("|")
var whichtab=cookieparse[0]
var tabcontentid=cookieparse[1]
expandcontent(tabcontentid, tabobjlinks[whichtab])
}
else
expandcontent(initialtab[1], tabobjlinks[initialtab[0]-1])
}
if (window.addEventListener)
window.addEventListener("load", do_onload, false)
else if (window.attachEvent)
window.attachEvent("onload", do_onload)
else if (document.getElementById)
window.onload=do_onload
</script>
<ul id="tablist">
<li><a href="" class="current" onClick="return expandcontent('sc1', this)">Welcome!</a></li>
<li><a href="" onClick="return expandcontent('sc2', this)" theme="">Faces, Places & Events</a></li>
<li><a href="hot.htm" onClick="return expandcontent('sc3', this)" theme="">Links</a></li>
<li><a href="search.htm" onClick="return expandcontent('sc4', this)" theme="">Search</a></li>
</ul>
<DIV id="tabcontentcontainer">
<div id="sc1" class="tabcontent">
<CENTER>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>template_faces_places_events</title>
<style>
<!--
.style4 {
text-align: center;
}
.style3 {
font-size: xx-small;
//color: #000000;
}
-->
</style>
</head>
<body>
<table border="1" width="72%" id="table2" style="border-collapse: collapse">
<tr>
<td align="center">
<h3 class="style4">Welcome to Your Fam<b><em><span class="style3"></span></em></b>ilyForum
& Web Site!<font size="1"><br>
We invite you to browse the pages of the FamilyForum and we would love to
have you join in with us and become a member so that you can keep all the
family up to date on what's happening where you are.<br>
Take a look at <a href="http://www.mykimbrell.com/FamilyForum/index.php?topic=31.msg52">
<font color="#87CEFA"><b><u>Who Can Become A Member</u></b></font></a> to
read up on how to become a member of Your FamilyForum.</font><font size="2"><br><br>
<font size="1">You can <a href="http://www.mykimbrell.com/FamilyForum/index.php?action=register"><b><u><font color="#87CEFA">Go Here</font></u></b></a> to Join (register) for Your FamilyForum.</font><br>
</font><b><i><font size="2">Enjoy... G-Pa Ken & G-Ma Kay<br>
</font></i></b></h3>
</td>
</tr>
</table>
<strong><font size=3><br>
</font></strong>
<p align="left"></p>
</body>
</html>
<html>
<body>
<?php include("/cpg1410/cpmfetch/randompic.php"); ?>
</body>
</html>
</CENTER>
<br />
</div>
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/index.htm
3) Describe problem:
I'm using the DD Ajax Tabs Content script on the front page of my Forum (http://www.mykimbrell.com/FamilyForum/index.php) and it works great.
My issue is that the content I want to add is just not working no matter how the code is written. (so far) :)
My current set up is with:
SMF 1.1.2
TinyPortal v0.9.8
Coppermine 1.4.10
cpmfetch 2.0.0
It’s all working OK and so there are no issues there, but the php file I want to call into the display in the Welcome tab of the DD menu is where I need help.
So here it is;
I’m trying to include the output of my cpmfetch ‘randonpic.php’ file at the bottom of the Welcome tab inserting it below the content that’s already in place there.
the 'cpmfetch' utility is setup to pull random selections from the Coppermine gallery and display them as seen at this next link, the pics change each time the page is refreshed
http://www.mykimbrell.com/cpg1410/cpmfetch/randompic.php
This is the code that is in the randompic.php file:
<?php
print "<center>";
include "./cpmfetch.php";
$objCpm = new cpm("./cpmfetch_config.php");
$objCpm->cpm_viewRandomMedia(1,3,array("imagesize" => "Thumb","imageheight" => "75","imagewidth" => "100","windowtarget" => "_new","alttag" =>"From Album: %a Added: %w"));
$objCpm->cpm_close();
print "</center>";
?>
I’ve searched the here in the DD pages, the cpmfetch pages and did Google searches but so far I'm just not finding the fix.
This is one of the versions of code that has been tried for pulling the cpmfetch output into the welcome tab…
<?php include("/cpg1410/cpmfetch/randompic.php"); ?>
This one and others have been tried in various spots in the existing code and with and without various tags,
You can see the current attempt at the bottom of the code below.
I would be most thankful for any help.
Here is the code from the DD tabbed content script:
<style type="text/css">
#tablist{
padding: 3px 0;
margin-left: 0;
margin-bottom: 0;
margin-top: 0.1em;
font: bold 12px Verdana;
}
#tablist li{
list-style: none;
display: inline;
margin: 0;
}
#tablist li a{
padding: 3px 0.5em;
margin-left: 3px;
border: 1px solid #778;
border-bottom: none;
background: white;
}
#tablist li a:link, #tablist li a:visited{
color:#87CEFA;
}
#tablist li a.current{
background: none;
}
#tabcontentcontainer{
width: 450px;
/* Insert Optional Height definition here to give all the content a unified height */
padding: 5px;
border: 1px solid black;
}
.tabcontent{
display:none;
}
</style>
<script type="text/javascript">
/***********************************************
* Tab Content script- ? Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/
//Set tab to intially be selected when page loads:
//[which tab (1=first tab), ID of tab content to display]:
var initialtab=[1, "sc1"]
////////Stop editting////////////////
function cascadedstyle(el, cssproperty, csspropertyNS){
if (el.currentStyle)
return el.currentStyle[cssproperty]
else if (window.getComputedStyle){
var elstyle=window.getComputedStyle(el, "")
return elstyle.getPropertyValue(csspropertyNS)
}
}
var previoustab=""
function expandcontent(cid, aobject){
if (document.getElementById){
highlighttab(aobject)
detectSourceindex(aobject)
if (previoustab!="")
document.getElementById(previoustab).style.display="none"
document.getElementById(cid).style.display="block"
previoustab=cid
if (aobject.blur)
aobject.blur()
return false
}
else
return true
}
function highlighttab(aobject){
if (typeof tabobjlinks=="undefined")
collecttablinks()
for (i=0; i<tabobjlinks.length; i++)
tabobjlinks[i].style.backgroundColor=initTabcolor
var themecolor=aobject.getAttribute("theme")? aobject.getAttribute("theme") : initTabpostcolor
aobject.style.backgroundColor=document.getElementById("tabcontentcontainer").style.backgroundColor=themecolor
}
function collecttablinks(){
var tabobj=document.getElementById("tablist")
tabobjlinks=tabobj.getElementsByTagName("A")
}
function detectSourceindex(aobject){
for (i=0; i<tabobjlinks.length; i++){
if (aobject==tabobjlinks[i]){
tabsourceindex=i //source index of tab bar relative to other tabs
break
}
}
}
function do_onload(){
var cookiename=(typeof persisttype!="undefined" && persisttype=="sitewide")? "tabcontent" : window.location.pathname
var cookiecheck=window.get_cookie && get_cookie(cookiename).indexOf("|")!=-1
collecttablinks()
initTabcolor=cascadedstyle(tabobjlinks[1], "backgroundColor", "background-color")
initTabpostcolor=cascadedstyle(tabobjlinks[0], "backgroundColor", "background-color")
if (typeof enablepersistence!="undefined" && enablepersistence && cookiecheck){
var cookieparse=get_cookie(cookiename).split("|")
var whichtab=cookieparse[0]
var tabcontentid=cookieparse[1]
expandcontent(tabcontentid, tabobjlinks[whichtab])
}
else
expandcontent(initialtab[1], tabobjlinks[initialtab[0]-1])
}
if (window.addEventListener)
window.addEventListener("load", do_onload, false)
else if (window.attachEvent)
window.attachEvent("onload", do_onload)
else if (document.getElementById)
window.onload=do_onload
</script>
<ul id="tablist">
<li><a href="" class="current" onClick="return expandcontent('sc1', this)">Welcome!</a></li>
<li><a href="" onClick="return expandcontent('sc2', this)" theme="">Faces, Places & Events</a></li>
<li><a href="hot.htm" onClick="return expandcontent('sc3', this)" theme="">Links</a></li>
<li><a href="search.htm" onClick="return expandcontent('sc4', this)" theme="">Search</a></li>
</ul>
<DIV id="tabcontentcontainer">
<div id="sc1" class="tabcontent">
<CENTER>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>template_faces_places_events</title>
<style>
<!--
.style4 {
text-align: center;
}
.style3 {
font-size: xx-small;
//color: #000000;
}
-->
</style>
</head>
<body>
<table border="1" width="72%" id="table2" style="border-collapse: collapse">
<tr>
<td align="center">
<h3 class="style4">Welcome to Your Fam<b><em><span class="style3"></span></em></b>ilyForum
& Web Site!<font size="1"><br>
We invite you to browse the pages of the FamilyForum and we would love to
have you join in with us and become a member so that you can keep all the
family up to date on what's happening where you are.<br>
Take a look at <a href="http://www.mykimbrell.com/FamilyForum/index.php?topic=31.msg52">
<font color="#87CEFA"><b><u>Who Can Become A Member</u></b></font></a> to
read up on how to become a member of Your FamilyForum.</font><font size="2"><br><br>
<font size="1">You can <a href="http://www.mykimbrell.com/FamilyForum/index.php?action=register"><b><u><font color="#87CEFA">Go Here</font></u></b></a> to Join (register) for Your FamilyForum.</font><br>
</font><b><i><font size="2">Enjoy... G-Pa Ken & G-Ma Kay<br>
</font></i></b></h3>
</td>
</tr>
</table>
<strong><font size=3><br>
</font></strong>
<p align="left"></p>
</body>
</html>
<html>
<body>
<?php include("/cpg1410/cpmfetch/randompic.php"); ?>
</body>
</html>
</CENTER>
<br />
</div>