Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Add Specific Information In A Panel

Asked Modified Viewed 967 times
V
Vyper69
V
Unprecedented Times call for Unprecedented Measures
  • Senior Member, joined since
  • Contributed 551 posts on the community forums.
  • Started 146 threads in the forums
  • Started this discussions
asked
Senior Member

I was wanting to add this in a panel below the header how can this be done.

Sitename - Day - Date

I want it to be in this format
0 replies

7 posts

F
Falk
F
Falk 146
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 12 questions
answered
Super Admin

Enable PHP Execution or make a separate new panel.

$nameOfDay = date('D', strtotime($date));
echo " Site Name ".$nameOfDay," - ":time()." ";

See variations of date and time, https://www.php.net/manual/en/functio...n.time.php - https://www.php.net/manual/en/functio...n.date.php
Edited by Falk on 02-08-2020 20:45,
1 reply
V
Vyper69
V
Unprecedented Times call for Unprecedented Measures
  • Senior Member, joined since
  • Contributed 551 posts on the community forums.
  • Started 146 threads in the forums
  • Started this discussions
answered
Senior Member

Ok so I am using this in my Main.Inc. Don't like the Marguee but it is what I have.

I tried using the echo in panel, but it doesn't work.


echo "
<table width='100%' border='0' cellpadding='0' cellspacing='0'>
<tr>
<td><img src='".THEME."images/headerannounce_01.gif' width='156' height='32' alt='' /></td>
<td style='width: 100%; height: 32px; background-image: url(".THEME."images/headerannounce_stretch.gif')'

id='announcements'>
<marquee direction='left' scrollamount='2' scrolldelay='30' width='100%' onmouseover='this.stop()' onmouseout='this.start

()'>".showsubdate()."</marquee>
</td>
<td><img src='".THEME."images/headerannounce_02.gif' width='73' height='32' alt='' /></td>
</tr>
</table>
";


If I could get it fixed center no scroll would be great. If I could put it in a panel, even better. But I need to know how to call the Location and the day of week if possible.
0 replies
C
Chan
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,842 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
answered
Super Admin

Set up your files as such

root/infusions/custom_panel/custom_panel.php
root/infusions/custom_panel/index.php


Go to Panel management, add panel, you should see a "custom-panel" options. Select that and enable it. Now, edit custom-panel.php and paste in your code accordingly.

<?php
echo "Test";


Turn off "Allow PHP Execution".
Edited by Falk on 12-08-2020 17:08,
1 reply
R
Anonymous User
R
Anonymous User 367
  • Veteran Member, joined since
  • Contributed 939 posts on the community forums.
  • Started 2 threads in the forums
  • Answered 20 questions
answered
Veteran Member

https://www.php.net/manual/en/functio...n.date.php

Falk already posted code that you need, see post #4
0 replies
V
Vyper69
V
Unprecedented Times call for Unprecedented Measures
  • Senior Member, joined since
  • Contributed 551 posts on the community forums.
  • Started 146 threads in the forums
  • Started this discussions
answered
Senior Member

Ok so here is what I have in a working panel.

<?php

date_default_timezone_set("America/New_York");
echo date('l - F jS Y - h:i:s A');


Wednesday - August 12th 2020 - 09:09:21 PM

This is fine, except I am still needing the user_location.

user_location - Wednesday - August 12th 2020 - 09:09:21 PM

and I can not figure out how to center it. It has to be centered.
1 reply
R
Anonymous User
R
Anonymous User 367
  • Veteran Member, joined since
  • Contributed 939 posts on the community forums.
  • Started 2 threads in the forums
  • Answered 20 questions
answered
Veteran Member

https://www.w3schools.com/js/tryit.asp?filename=tryjs_timing_clock
0 replies
G
Grimloch
G
Energy can neither be created nor destroyed; only transformed !
  • Senior Member, joined since
  • Contributed 722 posts on the community forums.
  • Started 141 threads in the forums
  • Answered 2 questions
answered
Senior Member

Quote

I added it into my main.inc, but the clock stayed fixed unless page was refreshed

Check out this site; it works perfectly fine with this code in Main.inc of the Magazine theme. This is in 9.03.70 version.
https://trans-galactic.com

 if ($this->GetParam('container') == TRUE) {
 echo '<div class="container-fluid"><div align="center"><span style="font-size:20px; color:#000;">'.date("F d, Y @ ").'<span id="clock"></span>
<script type="text/Javascript">
<!--
function clock(){
//Save the times in variables
var today = new Date();
var hours = today.getHours();
var minutes = today.getMinutes();
var seconds = today.getSeconds();
//Set the AM or PM time
if (hours >= 12){
 meridiem = " <sup>pm</sup>";
}
else {
 meridiem = " <sup>am</sup>";
}
//convert hours to 12 hour format and put 0 in front
if (hours>12){
 hours = hours - 12;
}
else if (hours===0){
 hours = 12;
}
//Put 0 in front of single digit minutes and seconds
if (minutes<10){
 minutes = "0" + minutes;
}
else {
 minutes = minutes;
}
if (seconds<10){
 seconds = "0" + seconds;
}
else {
 seconds = seconds;
}
document.getElementById("clock").innerHTML = (hours + ":" + minutes + ":" + seconds + meridiem);
}
setInterval("clock()", 1000);
//-->
</script></span><hr></div>';
 }
Edited by Grimloch on 15-08-2020 20:42,
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 7 posts
  • Votes 0 votes
  • Topic users 5 members

5 participants

F
F
Falk 146
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 12 questions
C
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,842 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
G
G
Energy can neither be created nor destroyed; only transformed !
  • Senior Member, joined since
  • Contributed 722 posts on the community forums.
  • Started 141 threads in the forums
  • Answered 2 questions
V
V
Unprecedented Times call for Unprecedented Measures
  • Senior Member, joined since
  • Contributed 551 posts on the community forums.
  • Started 146 threads in the forums
  • Started this discussions
R
R
Anonymous User 367
  • Veteran Member, joined since
  • Contributed 939 posts on the community forums.
  • Started 2 threads in the forums
  • Answered 20 questions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet