News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Pages Mod

Started by 2by2host, September 15, 2008, 03:55:43 PM

Previous topic - Next topic

Sabre™

Ok mate..
I or another could do the manual edits for you, but the benefits of learning how to do them yourself, are priceless :)
Either way, I'll walk you through the process :)
Its just a simple step by step thing, so you should be ok :)
Well, backup your files as often as you can, and especially whenever you do a manual install.

So install the mod even though youre recieving the error.
That error is for the index.template.php, so thats the file we will need to edit.

Make sure youve backed up that file!!

Now search for
// Otherwise, they might want to [logout]...
if ($context['user']['is_logged'])
echo ($current_action == 'logout' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'logout' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">' , $txt[108] , '</a>
</td>' , $current_action == 'logout' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


And add before it
/** start Page Manager **/
if(isset($context['pages_mod']))
foreach($context['pages_mod'] as $row)
{
echo (isset($_REQUEST['action']) && $_REQUEST['action'] == 'page' && isset($_REQUEST['id']) && $_REQUEST['id'] == $row['ID']) ?
'<td class="maintab_active_'.$first.'">&nbsp;</td>
<td valign="top" class="maintab_active_back">
<a href="'.$scripturl.'?action=page;id='.$row['ID'].'">'.$row['NAME'].'</a>
</td>
<td class="maintab_active_'.$last.'">&nbsp;</td>'
:
'<td valign="top" class="maintab_back">
<a href="'.$scripturl.'?action=page;id='.$row['ID'].'">'.$row['NAME'].'</a>
</td>';
}
/** end Page Manager **/


Then look for
// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
global


And add $db_prefix, at the end, so it looks like this
// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $db_prefix,


now find this
array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm'

and add   ,'page'   to the end so it now looks like this
array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm', 'page'

Now look for this
<meta name="description" content="', $context['page_title'], '" />

and replace with
<meta name="description" content="'.((isset($context['page_title'])) ? $context['page_title'] : null).' - '.((isset($context['meta_description'])) ? $context['meta_description'] : null).'" />

Then find
<meta name="keywords" content="

and replace with
<meta name="keywords" content="'.((isset($context['meta_keywords'])) ? $context['meta_keywords'] : null).',

search for
', theme_copyright(), '

and add BEFORE it
      ';
      $twoby2host_copyrights = '<br /><a href="http://www.2by2host.com/services/simplemachines/">SMF customization services</a> by <a href="http://www.2by2host.com/">2by2host.com</a>';
echo '


Then add after    ', theme_copyright(), '  this
      <span class="smalltext" style="display: inline; visibility: visible; font-family: Verdana, Arial, sans-serif;">';
if(!empty($twoby2host_copyrights))
{
echo $twoby2host_copyrights;
unset($twoby2host_copyrights);
}
echo '</span>


And there you have it!!
A working mod, and your very first manual additions :)
Congrats :)

If you have any problems, immediately post back :)

Good Luck
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


skidpics

thanks for the info. I will add it tomorrow. I meant that I haven't attempted this manual add.

I have applied many manual mods thought..  I was just more curious why the install didn't work..

Sabre™

hahaa....
Oh ok, well...  in the case that a template fails the check, it usually means that a position the mod needs to edit, has been already taken by another mod.
So you just work around it :)
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


ke4obt

@Sabre, (or whoever can help)
hopefully you can help me out. I did the manual install for the index.template.php file as shown for the mod. Now, I'm getting an error: Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in .../Themes/default/index.template.php on line 68

lines 64-71 are:
// 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="'.((isset($context['page_title'])) ? $context['page_title'] : null).' - '.((isset($context['meta_description'])) ? $context['meta_description'] : null).'" />, empty($context['robot_no_index']) ? '' : '
<meta name="robots" content="noindex" />', '
<meta name="keywords" content="'.((isset($context['meta_keywords'])) ? $context['meta_keywords'] : null).', 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>

I'm sure it's something very simple that I'm missing.

Thanks in advance,
Flip
Thanks Much

Flip - KE4OBT
     The Blind Ham
Helping other blind hams
get on the air!


Yes I am really a BLIND user!

So, if a mod doesn't install properly, and I can't get help from your part of the forum,
I will come begging for YOUR help since you wrote it and know how it works
um, uh, well,
At least I would really, really hope you do!
HEE-HEE-HEE

The Saviour

That's more than lines 64-71

Give us the whole page as an attachment...

It's probably just something simple like you said.

ke4obt

Quote from: The Saviour on October 18, 2008, 11:09:13 PM
That's more than lines 64-71

Give us the whole page as an attachment...

It's probably just something simple like you said.


Here it is.
thanks.
Thanks Much

Flip - KE4OBT
     The Blind Ham
Helping other blind hams
get on the air!


Yes I am really a BLIND user!

So, if a mod doesn't install properly, and I can't get help from your part of the forum,
I will come begging for YOUR help since you wrote it and know how it works
um, uh, well,
At least I would really, really hope you do!
HEE-HEE-HEE

The Saviour

I'm sorry, but I don't see it...

Please wait for help or check back later...

ke4obt

ok, not a problem. I'm just glad I am not totally losing it. :)
My wife looked it over too and she didn't see the problem either.
I'll just sit back and wait patiently.   O:)
Thanks Much

Flip - KE4OBT
     The Blind Ham
Helping other blind hams
get on the air!


Yes I am really a BLIND user!

So, if a mod doesn't install properly, and I can't get help from your part of the forum,
I will come begging for YOUR help since you wrote it and know how it works
um, uh, well,
At least I would really, really hope you do!
HEE-HEE-HEE

Snappo

This mod messed up my buttons, but with a simple edit from this thread I  stopped the mod from creating the buttons.

thx

kota069

Hmmm......
I created a "Test" page just to see what it did....... it worked GREAT!

But I can't edit, unpublish or delete the page I created!!

I get the following:
An Error Has Occurred!
The article isn't active, hasn't been approved yet, or simply does not exist.


somebadguy711

Quote from: kota069 on October 25, 2008, 10:18:41 PM
Hmmm......
I created a "Test" page just to see what it did....... it worked GREAT!

But I can't edit, unpublish or delete the page I created!!

I get the following:
An Error Has Occurred!
The article isn't active, hasn't been approved yet, or simply does not exist.

I get the same error >.<

Anyone?

Sabre™

hmmm  dont know how I missed this page  :-\

@ke4obt
Im not sure if you still need assistance, but your index.template is attached and ready for you either way.


@kota069 & somebadguy711
I cannot replicate your error.
Have you tried reinstalling the mod?
Have you checked that the templates were edited correct?
Have you checked the db tables were loaded?
etc etc etc..
Let me know what you have already tried, and we'll go from there :)

Cheers
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


Roman Jankovski

Hi,
You should rename "Pages.russian.php" in "Pages.russian-utf8.php" to make Russian translation work ;)

Sabre™

Quote from: Roman Jankovski on January 12, 2009, 04:30:02 PM
Hi,
You should rename "Pages.russian.php" in "Pages.russian-utf8.php" to make Russian translation work ;)

That is only good for those using utf8, and not for those that are not.
A good reference for those that do not figure it out though.
Cheers :)
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


buspass

Is there a way to use this to include some PHP code?

Either directly in the Page Content: box for short scripts, or to put an include() in that box



buspass

Found it, although it's a bit hackish

This is the original mod code from pages.template.php
if($flag)
echo ' <div class="tborder" style="margin-top: 1ex;">
<div id="helpmenu" class="titlebg" style="padding: 4px;">'.$pages[$_REQUEST['id']]['title'].'</div>
<div style="padding: 2ex;" id="helpmain" class="windowbg2">'.$pages[$_REQUEST['id']]['content'].'</div>
</div>';

Which I changed to:

if($flag) {
echo ' <div class="tborder" style="margin-top: 1ex;">
<div id="helpmenu" class="titlebg" style="padding: 4px;">'.$pages[$_REQUEST['id']]['title'].'</div>
<div style="padding: 2ex;" id="helpmain" class="windowbg2">';
include $pages[$_REQUEST['id']]['content'];
echo '</div></div>';
}

And then in the Page Content: box under admin, I put something like Sources/testpage.php. When the page is displayed, it loads up all the header info and then goes right into including whatever testpage.php is supposed to do

I realize that these changes "as-is" will ONLY work with includes and that it breaks being able to just put text in the box and have it display

Murph

Hello, I'm new to SMF, but learning.  I installed the pages mod without error according to the packages control panel. But, in the admin, under configuration, there is a blank space instead of a link to Pages management. (I installed SMF Media Gallery Prior to this and it bumps it down leaving a blank space.)

I've compared the installs to the manual instructions and it all appears correct. I found the url link to page management, typed it in and it came up, but incomplete. It has the basic page structure, but no text.

I'm running SMF 1.1.8 using Babylon as default theme. I've added a couple of external links to the top menu.
Mods installed SMF Media Gallery 1.5.4

Any recommendations as to where I should look for the problem would be very welcomed.

Below is a screen grab of my admin page, not sure if it helps, but you see the blank space where the link should be.

Thank you! Nubee Murph'

Enders

Quote from: somebadguy711 on January 08, 2009, 11:00:16 AM
Quote from: kota069 on October 25, 2008, 10:18:41 PM
Hmmm......
I created a "Test" page just to see what it did....... it worked GREAT!

But I can't edit, unpublish or delete the page I created!!

I get the following:
An Error Has Occurred!
The article isn't active, hasn't been approved yet, or simply does not exist.

I get the same error >.<

Anyone?


I got the same error .... smf 1.1.8

Murph

Murph here again, just an update on my situation, I wiped my server and reinstalled to smf1.1.6. without adding a thing, I tried installing the Pages Mod. I got the same results. The Install went without failure, no indications of such. But the mod is not showing up in the admin. I can see the updates in the files, so the install did it's thing, but I can't do mine!

I'm not seeing any reports in the forum that match this, I'm not sure where to look for the error.

Any help would be more than welcomed.

Thanks, Nubee Murph'

chinaren

Okay, I've installed this and it works fine (thanks), but what I'd really like to do is to give certain of my forum members their own pages.

These pages would be up-datable by the page 'owner', but viewable by everyone (or selected usergroups as you have now).  Update access could be by usergroup too.

Is this possible? 
The Opus Path - The Next Generation of the Written Word

Advertisement: