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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,966
  • Latest: safir45
Stats
  • Total Posts: 195,982
  • Total Topics: 21,320
  • Online today: 307
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 250
  • Total: 251
  • lurkalot

Where to put the help?

Started by JPDeni, August 16, 2006, 04:35:35 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

JPDeni

I'm working on a php article for something that's very site-specific (no use to anyone else  :) ) and I anticipate that some of the moderators who might be accessing it could conceivably not understand some of it without some explanation. But I don't want the page cluttered up with lots of explanation when it's not needed. I love the little question mark help thing in the admin section and thought I could use that.

I've got it worked out that the code below is what I need to display the image and create the link to the popup:
echo '<a href="' , $scripturl , '?action=helpadmin;help=XXXXX" onclick="return reqWin(this.href);" class="help">
<img src="' , $settings['images_url'] , '/helptopics.gif" alt="Help" border="0" align="top" />
</a>'


where XXXXX is the key value for the help text. I see that most of the help texts are in the Help.english.php language file. (I'm sure they're in the other language files, too, but I'm using the English one.) I'd rather create my own file which would just be loaded when that one article is being used. That way I wouldn't have to worry about it being overwritten when there's an update. 

I tried creating my own file -- TL_Help.english.php -- and put it in the languages folder with the other Help.english.php file. I added a loadLanguage command -- loadLanguage('TL_Help'); -- at the beginning of my article and put the key value tl_location in the code above. I got the graphic and when I clicked on it, I got the window, but all it said was "tl_location." It hadn't found the $helptxt['tl_location'] that I had defined in the file. I copied the line over to Help.english.php, commented out the loadLanguage command in my article and tried it again and it worked like a charm.

At least I know I can do most of what I want to do, but I wish I could have a separate file. Is there a way to do that?

jacortina

Haven't done anything with this myself, but it may help to add the loadLanguage command to your Sources\Help.php file - in the ShowAdminHelp function.

JPDeni

#2
I was hoping not to have to edit any more of the files than I absolutely have to. Editing the Help.php file has the same problem as editing the Help.english.php file, really. If I can keep my own edits to files I create, I figure I'll be in a whole lot better shape when it comes time to upgrade. Otherwise, I'll have to keep track of everything I've edited and remember to change it when the files change. Remembering is not my long suit. :)

I wonder what would happen if I just did an "include" at the beginning of the article. I think I'll give that a try.

Thanks for your input. Discussion of a problem is always helpful.

Edited to add:
I tried a "require" in my article. Didn't work.

jacortina

Then making a custom version of Help.php (and just include the template statements in it) which would be called directly in that statement (instead of going through an index.php action) would probably do the trick.

JPDeni

I'm afraid I don't understand. How do I not go through an index.php action? I like the little windows that I get when I click the question mark graphic. Would I still get those?

At this point, I've just added my statements to the end of Help.english.php, with a comment line saying that's what it is.  I guess as long as I can remember (oh dear! :)) to check to see if they're still there when I do an upgrade, I'll be okay.

jacortina

Forget it.

It's too big of a hassle to go outside the framework like that for a simple popup.

But you can always put notes on modifications like this into a TP Article and name it 'Customization Notes'. Simply don't show it anywhere except maybe from a link in an Admin-only block.

This website is proudly hosted on Crocweb Cloud Website Hosting.