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

Recent

Welcome to TinyPortal. Please login or sign up.

May 01, 2024, 09:31:23 AM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,174
  • Total Topics: 21,220
  • Online today: 167
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 143
  • Total: 143

TP Question

Started by sturmkatze, March 24, 2008, 03:21:41 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

JPDeni

QuoteHow do I call the actual article in a link to be able to go right to it?

http://www.reenactor.net/duplisite/index.php?page=13

sturmkatze

Okay, here we go... I would like to make a separate menu for every time period, plus one for articles in general. I will draw some kind of flow-charty lookin' thing in Corel today and make it a graphic (yes, I like Corel vs. Adobe Illustrator... weird, I know...). I'll make it show at least one of the time period's structure (they all have most of the same structure -- sorta). I will post it on my server w/ a link here so you can see what I mean by my ramblings.

W/ the separate menus, I want them to point to TP articles (that will look like these) that are basically going to have an area at the top about that page, a lot of links w/ logos and, of course, ads on the page. How's that? The links are in table snow and I'd kind of like to have some kind of easy way to do that. !@#$&%(?!#$  :up: a useful link manager would be a GREAT thing.

Oh, and I really need to know where in the template the header is as my friend had put a diff banner there and when I changed it, the size is a bit off and parts are cut off. And I wan tto fix the metatags and the stuff I want below the copyright. If I could get this kinda thing done today, I'd feel like I accomplished something.


sturmkatze

#12
Quote from: JPDeni on March 24, 2008, 04:34:49 PM
QuoteHow do I call the actual article in a link to be able to go right to it?

http://www.reenactor.net/duplisite/index.php?page=13
OH, you're a GODDESS!!!!!!!!!!   ;D  One question, where do I find a list of the articles so I know the article # or must I write that down when editing them? (see, I am a dork!)

JPDeni

#13
Quotea useful link manager would be a GREAT thing.
There will be one. It's just not ready as yet. There is some link thing in the snippets board, but I don't remember the name of it. And I built one myself for my own site. I don't have graphics, because I didn't want them, but it's not that hard for someone with php knowledge to do. When you get to the point where you have to have it, post a description of exactly what you want and we'll probably be able to give it to you.

Quotewhere do I find a list of the articles so I know the article #
Admin > TinyPortal > Article Manager

If you hover your mouse over the link to edit the article, you should see the number for it at the bottom of your browser. The number is whatever is after editarticle. You can also set a "query title" for the article when you create the article and use

http://www.reenactor.net/duplisite/index.php?page=querytitle

assuming that your query title is "querytitle." If you give your articles query titles that are appropriate to the article, they'll be easy to remember.

QuoteOh, and I really need to know where in the template the header is

That would be between <head> and </head>, but that isn't where a banner would be. Look down further for <img src which is where an image prints out.

It's hard to tell you where exactly without looking at the file because you are using a different theme which likely has different stuff on it.

The meta tags go with the other meta tags. When you first install SMF and TP, using the default theme, there is a line that looks like


<meta name="keywords" content="PHP, MySQL, bulletin, board, free, open, source, smf, simple, machines, forum" />


You can change the keywords in that line. Just be sure that you put your keywords within the double quotes and don't use anything with an apostrophe in it.

Quotethe stuff I want below the copyright.

This is a little trickier and you have to be careful about what you're doing. From your text editor, search for theme_copyright(). It'll be towards the bottom of the file. Look down further from there until you see a closing </table> tag, followed by a single quote and a semi-colon. So the line I'm talking about looks like


</table>';


(although it's indented a bit)

What you're adding should be just plain html, so there shouldn't be any problem. Go to the end of the </table> tag, between the > and the ' and hit your enter key twice. Now you should have something that looks like


</table>

';


In that blank line that you just made, paste the html for whatever you want below the copyright. Be sure there's no single quotes or apostrophes within it. (You can have them, but you have to do something special with them and it's easier just to avoid them if at all possible.)

Now save your file and upload it to your server.

If you have problems, let us know.

sturmkatze

Cool! Will try when I get back. Thanks for your help! You rock!

sturmkatze

#15
Alas, I cannot find this bit (used search and all): </table>';

Here is what I have (end piece after copyright):

// Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
echo '
<div id="altk">
<div id="altky">
<span class="smalltext">', theme_copyright(), '
<br />', tportal_version() , ' | Theme by <a href="http://www.fussilet.com"><b>fussilet.com</b></a></span>';

// Show the load time?
if ($context['show_load_time'])
echo '
<br /><span class="smalltext">', $txt['smf301'], $context['load_time'], $txt['smf302'], $context['load_queries'], $txt['smf302b'], '</span>';

// This is an interesting bug in Internet Explorer AND Safari. Rather annoying, it makes overflows just not tall enough.
if (($context['browser']['is_ie'] && !$context['browser']['is_ie4']) || $context['browser']['is_mac_ie'] || $context['browser']['is_safari'] || $context['browser']['is_firefox'])
{
// The purpose of this code is to fix the height of overflow: auto div blocks, because IE can't figure it out for itself.
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[';

// Unfortunately, Safari does not have a "getComputedStyle" implementation yet, so we have to just do it to code...
if ($context['browser']['is_safari'])
echo '
window.addEventListener("load", smf_codeFix, false);

function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = 0; i < codeFix.length; i++)
{
if ((codeFix[i].className == "code" || codeFix[i].className == "post" || codeFix[i].className == "signature") && codeFix[i].offsetHeight < 20)
codeFix[i].style.height = (codeFix[i].offsetHeight + 20) + "px";
}
}';
elseif ($context['browser']['is_firefox'])
echo '
window.addEventListener("load", smf_codeFix, false);
function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = 0; i < codeFix.length; i++)
{
if (codeFix[i].className == "code" && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0))
codeFix[i].style.overflow = "scroll";
}
}';
else
echo '
var window_oldOnload = window.onload;
window.onload = smf_codeFix;

function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = codeFix.length - 1; i > 0; i--)
{
if (codeFix[i].currentStyle.overflow == "auto" && (codeFix[i].currentStyle.height == "" || codeFix[i].currentStyle.height == "auto") && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0) && (codeFix[i].offsetHeight != 0 || codeFix[i].className == "code"))
codeFix[i].style.height = (codeFix[i].offsetHeight + 36) + "px";
}

if (window_oldOnload)
{
window_oldOnload();
window_oldOnload = null;
}
}';

echo '
// ]]></script>';
}

echo '
</div>
  </div>
</div>
</div>';

// The following will be used to let the user know that some AJAX process is running
echo '
<div id="ajax_in_progress" style="display: none;', $context['browser']['is_ie'] && !$context['browser']['is_ie7'] ? 'position: absolute;' : '', '">', $txt['ajax_in_progress'], '</div>';

echo '
</div></div></div>
</body></html>';
}

// Show a linktree. This is that thing that shows "My Community | General Category | General Discussion"..
function theme_linktree()
{
global $context, $settings, $options;

echo '<div class="nav" style="font-size: smaller; margin-bottom: 2ex; margin-top: 2ex;">';

// Each tree item has a URL and name. Some may have extra_before and extra_after.
foreach ($context['linktree'] as $link_num => $tree)
{
// Show something before the link?
if (isset($tree['extra_before']))
echo $tree['extra_before'];

// Show the link, including a URL if it should have one.
echo '<b>', $settings['linktree_link'] && isset($tree['url']) ? '<a href="' . $tree['url'] . '" class="nav">' . $tree['name'] . '</a>' : $tree['name'], '</b>';

// Show something after the link...?
if (isset($tree['extra_after']))
echo $tree['extra_after'];

// Don't show a separator for the last one.
if ($link_num != count($context['linktree']) - 1)
echo '&nbsp;>&nbsp;';
}

echo '</div>';
}

// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context, $settings, $options, $scripturl, $txt;

// Work out where we currently are.
$current_action = 'home';
if (in_array($context['current_action'], array('admin', 'ban', 'boardrecount', 'cleanperms', 'detailedversion', 'dumpdb', 'featuresettings', 'featuresettings2', 'findmember', 'maintain', 'manageattachments', 'manageboards', 'managecalendar', 'managesearch', 'membergroups', 'modlog', 'news', 'optimizetables', 'packageget', 'packages', 'permissions', 'pgdownload', 'postsettings', 'regcenter', 'repairboards', 'reports', 'serversettings', 'serversettings2', 'smileys', 'viewErrorLog', 'viewmembers')))
$current_action = 'admin';
if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm', 'forum', 'tpadmin')))
$current_action = $context['current_action'];
if ($context['current_action'] == 'search2')
$current_action = 'search';

if (isset($_GET['dl']))
$current_action = 'dlmanager';

if (isset($_GET['board']) || isset($_GET['topic']))
$current_action = 'forum';

if ($context['current_action'] == 'theme')
$current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' ? 'profile' : 'admin';

// Are we using right-to-left orientation?
if ($context['right_to_left'])
{
$first = 'last';
$last = 'first';
}
else
{
$first = 'first';
$last = 'last';
}


// Show the start of the tab section.
echo '
  <ul class="menu">';
 
// Show the [home] button.
echo '<li', $current_action == 'home' ? ' class="chosen"' : '', '><a href="', $scripturl, '"><b>' , $txt[103] , '</b></a></li>';

// Show the [Forum] button.
echo '<li', $current_action == 'forum' ? ' class="chosen"' : '', '><a href="', $scripturl, '?action=forum"><b>' , Forum , '</b></a></li>';

// Show the [help] button.
echo '<li', $current_action == 'help' ? ' class="chosen"' : '', '><a href="', $scripturl, '?action=help"><b>' , $txt[119] , '</b></a></li>';

// How about the [search] button?
if ($context['allow_search'])
echo '<li', $current_action == 'search' ? ' class="chosen"' : '', '><a href="', $scripturl, '?action=search"><b>' , $txt[182] , '</b></a></li>';

// Is the user allowed to administrate at all? ([admin])
if ($context['allow_admin'])
echo '<li', $current_action == 'admin' ? ' class="chosen"' : '', '><a href="', $scripturl, '?action=admin"><b>' , $txt[2] , '</b></a></li>';

// Edit Profile... [profile]
if ($context['allow_edit_profile'])
echo '<li', $current_action == 'profile' ? ' class="chosen"' : '', '><a href="', $scripturl, '?action=profile"><b>' , $txt[79] , '</b></a></li>';

// Go to PM center... [pm]
if ($context['user']['is_logged'] && $context['allow_pm'])
echo '<li', $current_action == 'pm' ? ' class="chosen"' : '', '><a href="', $scripturl, '?action=pm"><b>' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>]' : '' , '</b></a></li>';

// The [calendar]!
if ($context['allow_calendar'])
echo '<li', $current_action == 'calendar' ? ' class="chosen"' : '', '><a href="', $scripturl, '?action=calendar"><b>' , $txt['calendar24'] , '</b></a></li>';

// the [member] list button
if ($context['allow_memberlist'])
echo '<li', $current_action == 'mlist' ? ' class="chosen"' : '', '><a href="', $scripturl, '?action=mlist"><b>' , $txt[331] , '</b></a></li>';

// If the user is a guest, show [login] button.
if ($context['user']['is_guest'])
echo '<li', $current_action == 'login' ? ' class="chosen"' : '', '><a href="', $scripturl, '?action=login"><b>' , $txt[34] , '</b></a></li>';

// If the user is a guest, also show [register] button.
if ($context['user']['is_guest'])
echo '<li', $current_action == 'register' ? ' class="chosen"' : '', '><a href="', $scripturl, '?action=register"><b>' , $txt[97] , '</b></a></li>';

// Otherwise, they might want to [logout]...
if ($context['user']['is_logged'])
echo '<li', $current_action == 'logout' ? ' class="chosen"' : '', '><a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '"><b>' , $txt[108] , '</b></a></li>';
echo '
  </ul>';
}

// Generate a strip of buttons.
function template_button_strip($button_strip, $direction = 'top', $force_reset = false, $custom_td = '')
{
global $settings, $buttons, $context, $txt, $scripturl;

// Create the buttons...
foreach ($button_strip as $key => $value)
{
if (isset($value['test']) && empty($context[$value['test']]))
{
unset($button_strip[$key]);
continue;
}
elseif (!isset($buttons[$key]) || $force_reset)
$buttons[$key] = '<a href="' . $value['url'] . '" ' .( isset($value['custom']) ? $value['custom'] : '') . '>' . $txt[$value['text']] . '</a>';

$button_strip[$key] = $buttons[$key];
}

if (empty($button_strip))
return '<td>&nbsp;</td>';

echo '
<td class="', $direction == 'top' ? 'main' : 'mirror', 'tab_' , $context['right_to_left'] ? 'last' : 'first' , '">&nbsp;</td>
<td class="', $direction == 'top' ? 'main' : 'mirror', 'tab_back">', implode(' &nbsp;|&nbsp; ', $button_strip) , '</td>
<td class="', $direction == 'top' ? 'main' : 'mirror', 'tab_' , $context['right_to_left'] ? 'first' : 'last' , '">&nbsp;</td>';
}

?>

sturmkatze

#16
And I do know about sending big chunks of code to forum (SORRY!!!) but I cannot find the piece you said to change... has IT been modified or something? I don't know if I'll get the flow chart done. Have to work early... we'll see.

I DO wish to thank you. I got the metatags fixed just like you said. Once I started looking, there were a couple of apostrophes...  :o
[/b]


Now on to the bottom stuff I wish to add.
Best, Marsh

JPDeni

It looks like it's your theme that has changed things. That's the trouble with trying to tell someone how to alter theme files. They're all different.

First, could you not put everything in blue? It makes it hard for me to read. (That picture in my avatar was taken in 1968!) Also, if you're going to post code, please use the code tags. On the posting form, that's the button with the # on it.

I'm not sure exactly where you want it, but I'll give it a shot.

After


', tportal_version() , ' | Theme by fussilet.com</span>';


Add


echo '

';


Paste your html in the blank space.

sturmkatze

#18
Okay, I usually use some colour to differentiate text. I fixed it. I also did not know about the code button. I fixed that too. How's that? I just tried this and got this message:

Template Parse Error!
It seems something has gone sour on the forum with the template system. This problem should only be temporary, so please come back later and try again. If you continue to see this message, please contact the administrator.

You can also try refreshing this page.

IchBin

That means you have a piece of code that you either broke an echo statement or just didn't do it perfect. Go over all the edits and make sure you got them PERFECT. If you can't figure it out, attach your file here. Please do not post the code, attach the actual file to your next post and we'll take a look.