TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

May 17, 2024, 04:22:22 PM

Login with username, password and session length
Members
  • Total Members: 3,886
  • Latest: Grendor
Stats
  • Total Posts: 195,189
  • Total Topics: 21,220
  • Online today: 98
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 1
  • Guests: 63
  • Total: 64
  • tino

How do I . . . - in TP header

Started by ipoco, March 24, 2006, 09:58:25 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ipoco

Okay - using TP Oxygen and SMF 1.0.6 - here's what I need to do and just need some one to point me in the right direction.

In the SMF admin section with the Oxygen theme running there is an option to place html code in a header that will then appear atop all the sections of the site.

question 1)

what information is there available for the header?  In other words I assume that 'behind the scenes' there is a vast array (literally) of info available like ip address, cookie information, user ID number etc etc.  How would I go about accessing this and displaying pieces of it in the header?  For example if a user selects a board named 'Chit Chat'  I should know it and be able to pop the text 'chit chat' in the header - not unlike the tree info that is built .

question 2)

It would be VERY helpful when hacking thru this to be able to display all the info gathered by SMF and it's arrays somewhere like the admin block so that I could see just what variables were called and available for use.  How would I do this?

Thanks much

C


IchBin

There's only a couple people that hang out here that are capable of answering your question. I would think you'll have better luck with this over at SMF.

ipoco

thanks -

I put the question here because the Oxygen theme provides an option for top html box in the admin section where other themes like the default SMF theme does not so I assume this option is specific to this theme - Oxygen

IchBin

In reference to your Oxygen header HTML question it's as simple as Bloc writing the code to call the HTML from the database and display it in the header where the PHP calls it. But your #1 and #2 questions are far beyone 99% of the people here. In fact Bloc or Feline are the only people here "that I know" that can answer your question. But even those questions are a bit of a stretch IMO. Sorry I can't help. If I could I would. I'm just trying to point you to a place where you can get help quicker.

ipoco

Well -

I think I've got it figured out.  Just had to think about it a while.  Right now it's very rough and I'm not sure I'm making the most of it but here's how it goes:

I've included (as a test) a block of code at the end of index.php

//the big test
$colors2 = array("orange", "green", "blue", "red", $user_info);


echo "<script language=\"JavaScript\">\n";
echo "<!--  hide from older browsers\n";

echo "   var colors2 = new Array();\n";

foreach ($colors2 as $key => $color)
{
    echo "   colors2[\"$key\"] = \"$color\";\n";
}
echo "// -->\n";
echo "</script>\n";


This basically passes the value of an array to a javascript variable which is then accessible in the header of the forum (as inserted using the option available with the Oxygen theme for TP)

Here's the header code:

<!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">
<head>
<script language="JavaScript" type="text/javascript" src="http://vhost.oddcast.com/vhost_embed_functions.php?acc=23234&js=1&followCursor=1"></script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>

<SCRIPT LANGUAGE="JavaScript">
<!-- begin
function display() {
window.onerror=null;

colors = window.screen.colorDepth;
document.form.color.value = Math.pow (2, colors);
if (window.screen.fontSmoothingEnabled == true)
document.form.fonts.value = "Yes";
else document.form.fonts.value = "No";

document.form.navigator.value = navigator.appName;
document.form.version.value = navigator.appVersion;
document.form.colordepth.value = window.screen.colorDepth;
document.form.width.value = window.screen.width;
document.form.height.value = window.screen.height;
document.form.maxwidth.value = window.screen.availWidth;
document.form.maxheight.value = window.screen.availHeight;
document.form.codename.value = navigator.appCodeName;
document.form.platform.value = navigator.platform;
if (navigator.javaEnabled() < 1) document.form.java.value="No";
if (navigator.javaEnabled() == 1) document.form.java.value="Yes";

if(navigator.javaEnabled() && (navigator.appName != "Microsoft Internet Explorer")) {
vartool=java.awt.Toolkit.getDefaultToolkit();
addr=java.net.InetAddress.getLocalHost();
host=addr.getHostName();
ip=addr.getHostAddress();
alert("Your host name is '" + host + "'\nYour IP address is " + ip);
   }
}
// end -->
</script>
<!-- Begin function to determine greeting -->
<script language="JavaScript" type="text/javascript">
function vh_sceneLoaded(){

d = new Date();
mins = d.getMinutes();
hours = d.getHours();
browser = navigator.appName
ip = alert

if(hours < 12){
timeStr = 'Good Morning,.. ';
}else if (hours < 17){
hours = hours - 12;
timeStr = 'Good Afternoon... ';
}else{
hours = hours - 12;
timeStr = 'Good Evening... ';
    }

    if (hours == 0){
    hours = 12;
    }

<!-- compile information into string to be used in sayText() function -->
if(mins == 0)
str = timeStr + "<S>It is " + hours + "o'clock... Hi, Nicole, I really hope you'll lend me your voice</S>  <S>I'm sick to the back teeth of sounding like Steven Hawking on helium</S>" + "<BREAK Size='medium'/>well, Aye see you are using" + browser + "<BREAK Size='medium'/>thats just fine";
else
str = timeStr + '<S>It is ' + mins +' past ' + hours + '</S>' + "<S>... Hi, Nicole, I really hope you'll lend me your voice</S> <S>I'm sick to the back teeth of sounding like Steven Hawking on helium</S>" + "<BREAK Size='medium'/> well, Aye see you are using" + browser + "<S><BREAK Size='medium'/>thats just fine</S>" + '<S>' + colors2 +'</S>';

sayText(str,5,1,1);
}
</script>
<!-- End greeting function -->
</head>

<BODY OnLoad="display()">
<script language="JavaScript" type="text/javascript">
AC_VHost_Embed_23234(150,200,'FFFFFF',1,1,349529,0,0,0,'e5bd1aa695a66f5b74178e17aefa3d9e',6);
</script>
</body>
</html>


Now this is all very rough mind you - but I should be able to pull (impode) info out of the arrays and pass them into javascript variables for the TTS engine located in the header to use.

Pretty sweet I think.

See it here in all it's roughness:

www.ipoco.com/xforums/

Now if I can JUST figure out why the dam ipto country flags are displaying 4 time for each post I'll be happy.

Best

C