Bookmarks

Started by Matthew K., July 16, 2007, 01:07:24 PM

Previous topic - Next topic

floydpink

#380
Installed in 1.1.7 and works fine.
Great Mod, thanks!

Members requested the ability to sort by subject. Achieved this with the following edits:
Sources/Bookmarks.php
Findglobal $txt, $context, $scripturl, $settings, $modSettings, $user_info, $ID_MEMBER, $return, $smcFunc, $db_prefix;
Add After: // Floydpink INSERT - Add code to sort by subject
global $sort;
if (isset($_REQUEST['sort']))
$sortkey = "mf.subject ASC";
else
$sortkey = "t.id_last_msg DESC";


FindORDER BY t.id_last_msg DESC

Replace with ORDER BY $sortkey

Themes/Default/bookmarks.template.php
Find global $context, $settings, $scripturl, $txt, $return;

Add After: // Floydpink INSERT - get sort parameter from URL and set default to subject
global $sort;
if (!isset($_REQUEST['sort']))
$_REQUEST['sort'] = 'subject';

Find
<td class="titlebg">', $txt[70], '</td>

Replace with:
<!-- Floydpink INSERT - Add sort by Subject -->
<td class="titlebg"><a href="', $scripturl, '?action=bookmarks;sort=subject">', $txt[70], $_REQUEST['sort'] != 'last_post' ? ' <img src="' . $settings['images_url'] . '/sort_down.gif" alt="" />' : '','</a></td>


Find<td class="titlebg" width="22%">', $txt[111], '</td>

Replace with
<!-- Floydpink INSERT - Add sort by Last Post -->
<td class="titlebg" width="22%"><a href="', $scripturl, '?action=bookmarks;sort=last_post">', $txt[111], $_REQUEST['sort'] == 'last_post' ? ' <img src="' . $settings['images_url'] . '/sort_down.gif" alt="" />' : '','</a></td>


;D

p1tereq

Fresh polish translation...

1. Polish translation 4yaa

Quote$txt['bookmarks'] = 'Lista śledzonych tematów';
$txt['bookmark_list'] = 'Śledzone tematy';
$txt['bookmark_list_empty'] = 'Nie obserwujesz obecnie żadnych wątków. Dodaj temat, klikając w przycisk \'Śledź temat\' w przeglądzie wątku.';
$txt['bookmark_open_window'] = 'Otwórz w nowym oknie';
$txt['bookmark_delete'] = 'Usuń obserwację wybranych wątków';
$txt['bookmark_delete_success'] = '%1$s śledzeń zostało usuniętych!';
$txt['bookmark_delete_failure'] = 'Niektóre tematy nie zostały usunięte z listy śledzonych wątków.';
$txt['bookmark_add'] = 'Śledź temat';
$txt['bookmark_add_success'] = 'Wybrany wątek został pomyślnie dodany do listy śledzonych przez Ciebie tematów';
$txt['bookmark_add_exists'] = 'Ten wątek już znajduje się na liście Twoich śledzonych tematów!';
$txt['bookmark_add_failed'] = 'Błąd! Wątek nie został dodany do listy śledzonych tematów.';
$txt['permissionname_make_bookmarks'] = 'Użytkownik może używać funkcji "Śledź temat';
$txt['cannot_make_bookmarks'] = 'Przepraszamy! Nie możesz korzystać z funkcji śledzenia tematów.';

2. Polish UTF-8

Quote$txt['bookmarks'] = 'Lista &#347;ledzonych temat&#243;w';
$txt['bookmark_list'] = '&#346;ledzone tematy';
$txt['bookmark_list_empty'] = 'Nie obserwujesz obecnie &#324;adnych w&#261;tk&#243;w. Dodaj temat, klikaj&#261;c w przycisk \'&#346;led&#378; temat\' w przegl&#261;dzie w&#261;tku.';
$txt['bookmark_open_window'] = 'Otw&#243;rz w nowym oknie';
$txt['bookmark_delete'] = 'Usu&#324; obserwacj&#281; wybranych w&#261;tk&#243;w';
$txt['bookmark_delete_success'] = '%1$s &#347;ledze&#324; zosta&#322;o usuni&#281;tych!';
$txt['bookmark_delete_failure'] = 'Niekt&#243;re tematy nie zosta&#322;y usuni&#281;te z listy &#347;ledzonych w&#261;tk&#243;w.';
$txt['bookmark_add'] = '&#346;led&#378; temat';
$txt['bookmark_add_success'] = 'Wybrany w&#261;tek zosta&#322; pomy&#347;lnie dodany do listy &#347;ledzonych przez Ciebie temat&#243;w';
$txt['bookmark_add_exists'] = 'Ten w&#261;tek ju&#324; znajduje si&#281; na li&#347;cie Twoich &#347;ledzonych temat&#243;w!';
$txt['bookmark_add_failed'] = 'B&#322;&#261;d! W&#261;tek nie zosta&#322; dodany do listy &#347;ledzonych temat&#243;w.';
$txt['permissionname_make_bookmarks'] = 'U&#324;ytkownik mo&#324;e u&#324;ywa&#263; funkcji "&#346;led&#378; temat';
$txt['cannot_make_bookmarks'] = 'Przepraszamy! Nie mo&#324;esz korzysta&#263; z funkcji &#347;ledzenia temat&#243;w.';

Best luck, Pete.
Seeing the beauty of diversity in...

Jolene

Please forgive me if this is a repeat question.  I have scanned the posts here and I gather that the package install for SMF (using v 1.1.7) isn't working for this mod.  That's the experience I had and I came over here to see what was up.  Many posts have said for now we just need to install the mod manually.

Doing this requires editing many php files, it seems.  I'm not quite up to this yet, and am taking baby steps at learning this whole admin business.  I am concerned that if I mess with my code too much I'll genuinely mess something up (yes, I run weekly backups just in case).

So my question is this:  Do we anticipate that there will be a package friendly version of this mod out in the somewhat near future?  Or should I get help with it/wait until I am more confident with mod stuff?

Thank you!

Jo

floydpink

I used the install package and it worked fine for 1.1.7.
Give it a go. When you Apply the Mod in SMF it runs a test first and tells you if any of the updates fail.
Only if they do will you need at the manual instructions for that particular php file to complete the install.
The instructions are quite easy to follow. BUT make sure you backup each file before you edit it so that if you make a mistake you can easily revert to the orginal one.
Instructions are on the mod's home page http://custom.simplemachines.org/mods/index.php?mod=864 top right hand corner under the download - select 1.1.7 from the dropdown and Submit.

Jolene

Quote from: floydpink on February 04, 2009, 12:07:10 AM
I used the install package and it worked fine for 1.1.7.
Give it a go. When you Apply the Mod in SMF it runs a test first and tells you if any of the updates fail.
Only if they do will you need at the manual instructions for that particular php file to complete the install.
The instructions are quite easy to follow. BUT make sure you backup each file before you edit it so that if you make a mistake you can easily revert to the orginal one.
Instructions are on the mod's home page http://custom.simplemachines.org/mods/index.php?mod=864 top right hand corner under the download - select 1.1.7 from the dropdown and Submit.

Right.  I did install it as a package before.  It said it was successful.  But then the "bookmark" button didn't show up at all.  It was when I was looking for information on this problem that I found a few threads talking about difficulties with some package installs.

Jolene

Here...I installed again so I could show you what I mean.  See how you can see where the bookmark tab would be...but it's not there?


Jolene

argh! 

So I just uninstalled the package and forced myself to install it manually.  It was scary...but I'm pretty sure I did everything correctly.  And it looks just the same as before.  I can see where it goes...but it's not there. 

Any suggestions?

Jolene

Wait...I forgot to run that query at the bottom.....


Ok....new question.

Does anyone know what this means? If you try to run a query on your smf database?

Thank you for witnessing my confusion...and offering helpful advice.   :)

MySQL said: Documentation
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '{$db_prefix}bookmarks
(
`ID_MEMBER` mediumint(8) unsigned NOT NULL,
`ID_TOPIC' at line 1

FireFreezer

update of my german translation + adding utf8 version:

Quote from: Modifications.german.php
$txt['bookmarks'] = 'Meine Lesezeichen';
$txt['bookmark_list'] = 'Lesezeichen';
$txt['bookmark_list_empty'] = 'Du hast momentan keine Lesezeichen angelegt. Dies kannst du mit \'Lesezeichen hinzufügen\' in den Themen erledigen.';
$txt['bookmark_open_window'] = 'In neuem Fenster öffnen';
$txt['bookmark_delete'] = 'Lesezeichen löschen';
$txt['bookmark_delete_success'] = '%1$s Lesezeichen wurden erfolgreich gelöscht!';
$txt['bookmark_delete_failure'] = 'Nicht alle Lesezeichen konnten gelöscht werden.';
$txt['bookmark_add'] = 'Lesezeichen hinzufügen';
$txt['bookmark_add_success'] = 'Thread erfolgreich Deinen Lesezeichen hinzugefügt!';
$txt['bookmark_add_exists'] = 'Dieses Thema befindet sich bereits in Deinen Lesezeichen!';
$txt['bookmark_add_failed'] = 'Es ist ein Fehler beim hinzufügen des Themas zu Deinen Lesezeichen aufgetreten!';
$txt['permissionname_make_bookmarks'] = 'Lesezeichen für Themen anlegen';
$txt['cannot_make_bookmarks'] = 'Sorry, Du darfst keine Lesezeichen anlegen!';

Quote from: Modifications.german-utf8.php
$txt['bookmarks'] = 'Meine Lesezeichen';
$txt['bookmark_list'] = 'Lesezeichen';
$txt['bookmark_list_empty'] = 'Du hast momentan keine Lesezeichen angelegt. Dies kannst du mit \'Lesezeichen hinzuf&#252;gen\' in den Themen erledigen.';
$txt['bookmark_open_window'] = 'In neuem Fenster &#246;ffnen';
$txt['bookmark_delete'] = 'Lesezeichen l&#246;schen';
$txt['bookmark_delete_success'] = '%1$s Lesezeichen wurden erfolgreich gel&#246;scht!';
$txt['bookmark_delete_failure'] = 'Nicht alle Lesezeichen konnten gel&#246;scht werden.';
$txt['bookmark_add'] = 'Lesezeichen hinzuf&#252;gen';
$txt['bookmark_add_success'] = 'Thread erfolgreich Deinen Lesezeichen hinzugef&#252;gt!';
$txt['bookmark_add_exists'] = 'Dieses Thema befindet sich bereits in Deinen Lesezeichen!';
$txt['bookmark_add_failed'] = 'Es ist ein Fehler beim hinzuf&#252;gen des Themas zu Deinen Lesezeichen aufgetreten!';
$txt['permissionname_make_bookmarks'] = 'Lesezeichen f&#252;r Themen anlegen';
$txt['cannot_make_bookmarks'] = 'Sorry, Du darfst keine Lesezeichen anlegen!';

floydpink

If you don't want to always see the 'Bookmark added/deleted successfully' message (I find that it doesn't really fit in with the approach taken in other pages and its obvious from the list if it was successful or not) it's easy to delete:
Bookmarks.template.php
Find and delete if (!empty($return))
{
echo '
<table align="center" cellpadding="15" cellspacing="0" class="tborder">
<tr>
<td class="windowbg">', $return, '</td>
</tr>
</table>
<br />';
}



Jolene: You need to replace ''{$db_prefix}' with the actual 'Database Tables Prefix'  that your database is using  (look in Admin - Server Settings). You'd have found it much easier if you'd installed the mod first and then made edits to fix any issues rather than doing everything by hand.

SurrealKilla

#390
Been trying to install thi sfor a few months. I have to do it manually, first prob i had was sorting the db. now i have another prob! There is nowhere on my index template where i can add the manual changes? I have a heavily modified theme so whether this has anything to do with i dont but im trying to add,

this



to this, (index template)
Quoteindex.template.php
File Type: PHP script text

<?php

// Version: 1.1; index



/* This template is, perhaps, the most important template in the theme. It

contains the main template layer that displays the header and footer of

the forum, namely with main_above and main_below. It also contains the

menu sub template, which appropriately displays the menu; the init sub

template, which is there to set the theme up; (init can be missing.) and

the linktree sub template, which sorts out the link tree.



The init sub template should load any data and set any hardcoded options.



The main_above sub template is what is shown above the main content, and

should contain anything that should be shown up there.



The main_below sub template, conversely, is shown after the main content.

It should probably contain the copyright statement and some other things.



The linktree sub template should display the link tree, using the data

in the $context['linktree'] variable.



The menu sub template should display all the relevant buttons the user

wants and or needs.



For more information on the templating system, please see the site at:

http://www.simplemachines.org/

*/



// Initialize the template... mainly little settings.

function template_init()

{

global $context$settings$options$txt;



/* Use images from default theme when using templates from the default theme?

if this is 'always', images from the default theme will be used.

if this is 'defaults', images from the default theme will only be used with default templates.

if this is 'never' or isn't set at all, images from the default theme will not be used. */

$settings['use_default_images'] = 'never';



/* What document type definition is being used? (for font size and other issues.)

'xhtml' for an XHTML 1.0 document type definition.

'html' for an HTML 4.01 document type definition. */

$settings['doctype'] = 'xhtml';



/* The version this template/theme is for.

This should probably be the version of SMF it was created for. */

$settings['theme_version'] = '1.1.4';



/* Set a setting that tells the theme that it can render the tabs. */

$settings['use_tabs'] = true;



/* Use plain buttons - as oppossed to text buttons? */

$settings['use_buttons'] = true;



/* Show sticky and lock status seperate from topic icons? */

$settings['seperate_sticky_lock'] = true;

}



// The main sub template above the content.

function template_main_above()

{

global $context$settings$options$scripturl$txt$modSettings;



// Show right to left and the character set for ease of translating.

echo '<!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"'
$context['right_to_left'] ? ' dir="rtl"' '''><head>

<meta http-equiv="Content-Type" content="text/html; charset='
$context['character_set'], '" />

<meta name="description" content="'
$context['page_title'], '" />', empty($context['robot_no_index']) ? '' '

<meta name="robots" content="noindex" />'
'

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

<script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/script.js?fin11"></script>

<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[

var smf_theme_url = "'
$settings['theme_url'], '";

var smf_images_url = "'
$settings['images_url'], '";

var smf_scripturl = "'
$scripturl'";

var smf_iso_case_folding = '
$context['server']['iso_case_folding'] ? 'true' 'false'';

var smf_charset = "'
$context['character_set'], '";

// ]]></script>

<title>'
$context['page_title'], '</title>';



// The ?fin11 part of this link is just here to make sure browsers don't cache it wrongly.

echo '

<link rel="stylesheet" type="text/css" href="'
$settings['theme_url'], '/style.css?fin11" />

<link rel="stylesheet" type="text/css" href="'
$settings['default_theme_url'], '/print.css?fin11" media="print" />';



/* Internet Explorer 4/5 and Opera 6 just don't do font sizes properly. (they are big...)

Thus, in Internet Explorer 4, 5, and Opera 6 this will show fonts one size smaller than usual.

Note that this is affected by whether IE 6 is in standards compliance mode.. if not, it will also be big.

Standards compliance mode happens when you use xhtml... */

if ($context['browser']['needs_size_fix'])

echo '

<link rel="stylesheet" type="text/css" href="'
$settings['default_theme_url'], '/fonts-compat.css" />';



// Show all the relative links, such as help, search, contents, and the like.

echo '

<link rel="help" href="'
$scripturl'?action=help" target="_blank" />

<link rel="search" href="' 
$scripturl '?action=search" />

<link rel="contents" href="'
$scripturl'" />';



// If RSS feeds are enabled, advertise the presence of one.

if (!empty($modSettings['xmlnews_enable']))

echo '

<link rel="alternate" type="application/rss+xml" title="'
$context['forum_name'], ' - RSS" href="'$scripturl'?type=rss;action=.xml" />';



// If we're viewing a topic, these should be the previous and next topics, respectively.

if (!empty($context['current_topic']))

echo '

<link rel="prev" href="'
$scripturl'?topic='$context['current_topic'], '.0;prev_next=prev" />

<link rel="next" href="'
$scripturl'?topic='$context['current_topic'], '.0;prev_next=next" />';



// If we're in a board, or a topic for that matter, the index will be the board's index.

if (!empty($context['current_board']))

echo '

<link rel="index" href="' 
$scripturl '?board=' $context['current_board'] . '.0" />';

// YSHOUT HERE - <head> code
global $boardurl,$shoutFile;
$shoutFile='home';
$scripturlparsed parse_url($scripturl);
$scriptpath=isset($scripturlparsed['path'])?$scripturlparsed['path']:'/';
$args='';
foreach($_GET as $key => $value// passthrough $_GET
$args.='&'.urlencode($key).'='.urlencode($value);
echo '
<script src="'
,$boardurl,'/yshout/js/moo.ajax.js" type="text/javascript"></script>
<script src="'
,$boardurl,'/yshout/settings.js" type="text/javascript"></script>
<script type="text/javascript"><!-- // --><![CDATA[
window.onload=function(){loadChat();};
var shoutFile="'
,$shoutFile,'";
var yshout_php="'
,$scriptpath,'?yshout',$args,'";
// ]]></script>
<script src="'
,$boardurl,'/yshout/js/yshout.js?July062008" type="text/javascript"></script>
<style type="text/css">
#yshout {
font-size: 10px;
overflow: hidden;
color: white;
}
#yshout #yshout-toollinks { /* tool links (History, Commands, etc.) */
}
#yshout #shouts { /* main shouts area */
}
#yshout .shout { /* one shout */
margin: 0 0 0; /* Top Bottom Linespacing */
line-height: 1;
}
#yshout .shout-timestamp {
font-style: normal;
font-weight: normal;
}
#yshout .shout-adminlinks { /* del and ban buttons */
font-size: 6pt;
color: #141414;
}
#yshout #shout-form {
margin: 0;
padding: 0;
}
#yshout #shout-form fieldset {
border: none;
}
#yshout #forum-name {
width: 70px;
margin-right: 5px;
}
#yshout #shout-text {
width: 310px;
margin-right: 5px;
}
#yshout #shout-button {
width: 55px;
}
#yshout .shout-invalid { /* invalid shout (shout textbox) */
background: #FFFDD1;
}
</style>'
;
// YSHOUT END - <head> code

// We'll have to use the cookie to remember the header...

if ($context['user']['is_guest'])

$options['collapse_header'] = !empty($_COOKIE['upshrink']);



// Output any remaining HTML headers. (from mods, maybe?)

echo $context['html_headers'], '

<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[

var current_header = '
, empty($options['collapse_header']) ? 'false' 'true'';



function shrinkHeader(mode)

{'
;



// Guests don't have theme options!!

if ($context['user']['is_guest'])

echo '

document.cookie = "upshrink=" + (mode ? 1 : 0);'
;

else

echo '

smf_setThemeOption("collapse_header", mode ? 1 : 0, null, "'
$context['session_id'], '");';



echo '

document.getElementById("upshrink").src = smf_images_url + (mode ? "/upshrink2.gif" : "/upshrink.gif");



document.getElementById("upshrinkHeader").style.display = mode ? "none" : "";

document.getElementById("upshrinkHeader2").style.display = mode ? "none" : "";



current_header = mode;

}

// ]]></script>'
;



// the routine for the info center upshrink

echo '

<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[

var current_header_ic = '
, empty($options['collapse_header_ic']) ? 'false' 'true'';



function shrinkHeaderIC(mode)

{'
;



if ($context['user']['is_guest'])

echo '

document.cookie = "upshrinkIC=" + (mode ? 1 : 0);'
;

else

echo '

smf_setThemeOption("collapse_header_ic", mode ? 1 : 0, null, "'
$context['session_id'], '");';



echo '

document.getElementById("upshrink_ic").src = smf_images_url + (mode ? "/expand.gif" : "/collapse.gif");



document.getElementById("upshrinkHeaderIC").style.display = mode ? "none" : "";



current_header_ic = mode;

}

// ]]></script>'
;

echo 
'
<script type="text/javascript">

<!--
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
 d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;

}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
 var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
 if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}

}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;

}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<script src="'
$settings['theme_url'], '/AC_RunActiveContent.js" type="text/javascript"></script>
</head>

 <body>

  <div id="wrapper">

<div style="position:relative;left:-8px;"><img src="'
,$settings['images_url'],'/headBanner.png" alt="The Poker Pod - TPP" /></div>
'
,template_menu(),'  <br />
<div align="right">'
;
if($context['user']['is_logged'])
echo ' <span class="middletext" style="color:White">'
$context['allow_pm'] ? '<b>' $txt[152] . ' <a href="' $scripturl '?action=pm">' $context['user']['messages'] . ' ' . ($context['user']['messages'] != $txt[153] : $txt[471]) . '</a>' $txt['newmessages4'] . ' ' $context['user']['unread_messages'] . ' ' . ($context['user']['unread_messages'] == $txt['newmessages0'] : $txt['newmessages1']).'</b>' '<br/>''.
</span>'
;
echo '
</div>


  <div id="mainarea">

<div id="sag">

 <div id="sol">

  <div id="alt">

<div id="altsag">

 <div id="altsol">

  <div id="ust">

<div id="ustsag">

 <div id="ustsol">'
;

}

function 
template_main_below()

{

global $context$settings$options$scripturl$txt;



  echo '

</div>

  </div>

 </div>

</div>

  </div>

 </div>

</div>

  </div>

 </div>'
;



// Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!

echo '

  <div id="footer">

  <div id="footer-l">

<div id="footer-r">

<div id="footerarea">

<span class="smalltext">'
theme_copyright(), '<br /><font color="#454545">Theme </font><font color="#6E0101"><b>Dark4 By</b></font> <a href="http://www.fussilet.com" target="_blank">Fussilet</a></span>';



// Show the load time?

if ($context['show_load_time'])

echo '

<p align="center"><span class="smalltext">'
$txt['smf301'], $context['load_time'], $txt['smf302'], $context['load_queries'], $txt['smf302b'], '</span></p>';



// 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 
'

 </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: 0ex; padding-bottom: 0ex; padding-left: 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;



?>

<table align="center" id="newmenu" cellspacing="0" cellpadding="0" border="0">
<tr>
<td valign="top">
<img src="Themes/dark_4/images/english/firsttab.png" width="28" height="43" border="0" />
</td>
<td>
<a href="http://thepokerpod.com/podforum/index.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('pokerpod','','Themes/dark_4/images/english/pokerpodRO.png',1)">
<img src="Themes/dark_4/images/english/pokerpod.png" name="pokerpod" width="98" height="43" border="0" />
</a>
</td>
<td>
<a href="index.php?action=forum" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('index','','Themes/dark_4/images/english/indexRO.png',1)">
<img src="Themes/dark_4/images/english/index.png" name="index" width="101" height="43" border="0" />
</a>
</td>
<?
if(!$context['user']['is_guest'])
{
?>
<td>
<a href="index.php?action=profile" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('profile','','Themes/dark_4/images/english/profileRO.png',1)">
<img src="Themes/dark_4/images/english/profile.png" name="profile" width="100" height="43" border="0" />
</a>
</td>
<td>
<a href="index.php?action=calendar" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('calendar','','Themes/dark_4/images/english/calendarRO.png',1)">
<img src="Themes/dark_4/images/english/calendar.png" name="calendar" width="99" height="43" border="0" />
</a>
</td>
<td>
<a href="http://thepokerpod.com/podforum/index.php?action=gallery" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('gallery','','Themes/dark_4/images/english/galleryRO.png',1)">
<img src="Themes/dark_4/images/english/gallery.png" name="gallery" width="102" height="43" border="0" />
</a>
</td>
<td>
<a onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('chat','','Themes/dark_4/images/english/chatRO.png',1)" target="_self" href="http://www.thepokerpod.com/podforum/index.php?page=64">
<img src="Themes/dark_4/images/english/chat.png" name="chat" width="98" height="43" border="0" /></a><a href="http://www.thepokerpod.com/podforum/index.php?page=64"  onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('chat','','Themes/dark_4/images/english/chatRO.png',1)">
</a>
</td>
<td>
<a href="http://www.thepokerpod.com/podforum/index.php?action=gallery;cat=19" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('videos','','Themes/dark_4/images/english/videosRO.png',1)">
<img src="Themes/dark_4/images/english/videos.png" name="videos" width="100" height="43" border="0" />
</a>
</td>
<td>
<a href="index.php?action=mlist" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('members','','Themes/dark_4/images/english/membersRO.png',1)">
<img src="Themes/dark_4/images/english/members.png" name="members" width="103" height="43" border="0" />
</a>
</td>
<?
echo '
<td>
<a href="index.php?action=logout;sesc=', $context['session_id'], '"'; ?> onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('logout','','Themes/dark_4/images/english/logoutRO.png',1)">
<img src="Themes/dark_4/images/english/logout.png" name="logout" width="98" height="43" border="0" />
</a>
</td>
<?
}
if($context['user']['is_guest'])
{
?>
<td>
<a href="index.php?action=login" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('login','','Themes/dark_4/images/english/loginRO.png',1)">
<img src="Themes/dark_4/images/english/login.png" name="login" width="101" height="43" border="0" />
</a>
</td>
<td>
<a href="index.php?action=register" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('register','','Themes/dark_4/images/english/registerRO.png',1)">
<img src="Themes/dark_4/images/english/register.png" name="register" width="101" height="43" border="0" />
</a>
</td>
<td>
<a href="mailto:[email protected]" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('contact','','Themes/dark_4/images/english/contactRO.png',1)">
<img src="Themes/dark_4/images/english/contact.png" name="contact" width="100" height="43" border="0" />
</a>
</td>
<?
}
?>
<td>
<a href="index.php?action=help" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('help','','Themes/dark_4/images/english/helpRO.png',1)">
<img src="Themes/dark_4/images/english/help.png" name="help" width="99" height="43" border="0" />
</a>
</td>
<?
if($context['allow_admin'])
{
?>
<td>
<a href="index.php?action=admin" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('admin','','Themes/dark_4/images/english/adminRO.png',1)">
<img src="Themes/dark_4/images/english/admin.png" name="admin" width="101" height="43" border="0" />
</a>
</td>
<?
}
?>
<!--<td>
<a href="index.php?action=pm" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('messages','','Themes/dark_4/images/english/messagesRO.png',1)">
<img src="Themes/dark_4/images/english/messages.png" name="messages" width="116" height="43" border="0" />
</a>
</td>-->

<td valign="top">
<img src="Themes/dark_4/images/english/lasttab.png" width="44" height="43" border="0" />
</td>
</tr>
</table>


<?

}

// 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> </td>';



echo '

<td class="', $direction == 'top' ? 'main' : 'mirror', 'tab_' , $context['right_to_left'] ? 'last' : 'first' , '"> </td>

<td class="', $direction == 'top' ? 'main' : 'mirror', 'tab_back">', implode('  |  ', $button_strip) , '</td>

<td class="', $direction == 'top' ? 'main' : 'mirror', 'tab_' , $context['right_to_left'] ? 'first' : 'last' , '"> </td>';

}



?>

[/quote]


Its a custom template not the default, and im using 1.17 (not upgraded to 8 yet)


thx for any help or guidance ;)

Jolene

QuoteJolene: You need to replace ''{$db_prefix}' with the actual 'Database Tables Prefix'  that your database is using  (look in Admin - Server Settings). You'd have found it much easier if you'd installed the mod first and then made edits to fix any issues rather than doing everything by hand.

Thanks!  With your advice, I successfully ran that query...although I don't see any changes...there is still no bookmarking option on my site.  As for installing in first...I did!  I only manually installed it because I couldn't get the automatic one to work for me.  And judging from the physical appearance of the site, there is no difference between the two installs. 

As for what to do next....perhaps there is still a step I'm missing?


kat

#392
Imjust cleared Jo's site. It's a virgin install, now, file-wise.

We installed the mod, which went as it should (So it said), yet still, there're no buttons, at all.

I checked the files, manually. They seem to be as they ought to be. Except the line that should be showing in index.php is showing THREE times...

"Confused" ain't the word for it!

busterone

Odd install of PHP on the server perhaps?

kat

Could be. How would we find that out, busterone?

busterone

That totally depends on the host. They all are pretty standardized, but sometimes, especially with free and cheap hosts, they cut corners on resources by not installing everything needed in Apache to support a site, or PHP itself. Still, it depends on each host and how much access to the server they allow or will reveal to you.

kat

I'll ask Jo to ask her host.

Cheers, Buster!

Jolene

Thanks guys.  I will ask my host about this.  I'm hoping they'll be able to help me out.  I did pay a bit more for this site because review sites told me they have excellent customer service that you can contact 24/7.  Although last time I asked them about help with an SQL error I was getting they told me it was an SMF issue.  I still don't think it is...I still get the error occasionally but it doesn't seem to be interfering with anything.  So I'll try them on this issue and see how it goes.

AlenNS

Can I use this mod on RC1 without any errors?

willerby

Worked straight out of the box for me on RC1 on default and Shadow People theme
What type of washing machine is September?

An autumnatic. :)

Advertisement: