News:

Wondering if this will always be free?  See why free is better.

Main Menu

Register at post View v.1.1

Started by Mick., April 17, 2010, 09:31:01 AM

Previous topic - Next topic

Mick.

Link to Mod

This mod will add 2 register buttons to post view and message index,..... Top and bottom.

Created on March 15th, 2010
Revision #1 - v.1.1  Added buttons to message index.
             #2 -Updated to 2.0.2

Created by idesignSMF.com


kingkingston

Awesome mod for people who use the twitter mod as well

Afro

#2
This sounds good.. Thanks for the mod..

It would be nice also if you can add the link on the message index to say "REGISTER TO CREATE A TOPIC"
Just a suggestion.

Mick.

Quote from: Afro on April 18, 2010, 07:48:29 AM
This sounds good.. Thanks for the mod..

It would be nice also if you can add the link on the message index to say "REGISTER TO CREATE A TOPIC"
Just a suggestion.

Good idea..... im sure something can be worked out.

Afro

Very well. I remember there was a time i asked for advice on how to allow the guests to see the "NEW TOPIC" Button,
which will of course direct them to Registration page. This is a perfect mod for that.
So you can use something like "START" instead of "CREATE".

Mick.

Added a "Register to create new topic" in message index per request.   Thanx Afro for the idea. ;)

Remove old mod and delete from mod list in admin.    Upload new version v.1.1

Afro

#6
Weldone. Its a good mod since many newbies don't really know where the registration button is located on the menubar.
Installed perfectly. I changed my
"REGISTER TO COMMENT ON THIS TOPIC" to "COMMENT ON THIS TOPIC"
"REGISTER TO CREATE NEW TOPIC" to "START NEW TOPIC" in the language file.
it will of course direct them to the reg page.

..

Rohan_

i wanna use this on 1.1.11 please tell me how do i do that please
Proud To Be An Indian

Rohan_

i made it different :) ... the url is not direct to register .. i made it like this

if ($user_info['is_guest'])
$buttonArray[] = '<a href="' . $scripturl . '?action=post;topic=' . $context['current_topic'] . '.' . $context['start'] . ';num_replies=' . $context['num_replies'] . '">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/reply.gif" alt="' . $txt[146] . '" border="0" />' : $txt[146]) . '</a>';


because of this the url guests see is the reply url not register and when they click on it the forum tell them only registered users are allowed to access this section please register or login

can this be a problem ?

anyways thanks for the mod :)
Proud To Be An Indian

Afro


Rohan_

Proud To Be An Indian

Afro

Quote from: Rohan_ on April 26, 2010, 10:29:03 AM
Thanks Afro

You can also make things a little clear for rookies by writing the file(s) you modified like i did on my post here.
like
theme/default/registertemplate.php
or another file.

Rohan_

no i did not edited registertemplate ......... i just edited the display.template and messageindex.template and and gave the link of reply or new topic for guests and in permissions i set that guests can not reply or create new topic so whenever a guest click on the new topic or reply button they will automatically see the login page because their step has been rejected from the permissions
Proud To Be An Indian

Afro

I understand. I just said that you should tell the file.
Its ok.

ActivePatriot

I get this error when trying to download the package:

QuoteAlthough the package was downloaded to the server it appears to be   empty. Please check the Packages directory, and the "temp" sub-directory   are both writable. If you continue to experience this problem you   should try extracting the package on your PC and uploading the extracted   files into a subdirectory in your Packages directory and try again. For   example, if the package was called shout.tar.gz you should:
1) Download the package to your local PC and extract it into files.
2) Using an FTP client create a new directory in your "Packages" folder, in this example you may call it "shout".
3) Upload all the files from the extracted package to this directory.
4) Go back to the package manager browse page and the package will be automatically found by SMF.

Is the package empty?

Spoogs

download to your computer first then upload via package manager

ActivePatriot

Quote from: Spoogs on August 15, 2010, 08:59:15 PM
download to your computer first then upload via package manager

Thanks, that worked.

PenelopeQ

I received an error message.
QuoteError in Package Installation
At least one error was encountered during a test installation of this package. It is strongly recommended that you do not continue with installation unless you know what you are doing, and have made a backup very recently. This error may be caused by a conflict between the package you're trying to install and another package you have already installed, an error in the package, a package which requires another package that you don't have installed yet, or a package designed for another version of SMF.

Here is the table of what failed and what did not fail.
TypeActionDescription
Execute Modification ./Themes/default/Display.template.PHPTest failed
Replace ./Themes/default/Display.template.PHPTest successful
Add After ./Themes/default/Display.template.PHPTest failed
Execute Modification ./Themes/default/MessageIndex.template.PHPTest failed
Replace ./Themes/default/MessageIndex.template.PHPTest failed
Add After ./Themes/default/MessageIndex.template.PHPTest successful
Execute Modification ./Themes/default/languages/Modifications.english.PHPTest successful
Add Before ./Themes/default/languages/Modifications.english.PHPTest successful
Execute Modification ./Themes/default/languages/Modifications.english-utf8.PHPTest successful

henrik1782

Nice mod....

Here is the Danish tranlation


<file name="$themedir/languages/Modifications.danish.php" error="skip">
<operation>
<search position="after"><![CDATA[?>]]></search>
<add><![CDATA[
$txt['registertopost'] = 'Registrer for at kommentere dette indlæg';
$txt['registertocreate'] = 'Registrer for at tilføje et indlæg';
]]></add>
</operation>

</file>

<file name="$themedir/languages/Modifications.danish-utf8.php" error="skip">
<operation>
<search position="after"><![CDATA[?>]]></search>
<add><![CDATA[
$txt['registertopost'] = 'Registrer for at kommentere dette indlæg';
$txt['registertocreate'] = 'Registrer for at tilføje et indlæg';
]]></add>
</operation>

</file>


Best regards
Henrik Poulsen
My favorite mods: Forum Firewall, httBL, MessagePreviewOnHover, BoardHover Mod, VB Style Board Index, Separate Replies and Views Column, Realtime clock by Joker, ENotify, Topic Solved.

Mick.


Clickout

can i use this mod for smf 2.0 ?

Mick.


Eclipse16V

I worked with:
SMF 2 in German

Shop:
SID Giessen


ApplianceJunk

Could a button be placed on the BoardIndex.template.php too?

I have been trying to get one to display there by looking at the code you created for the other buttons, but I'm not having much luck.

Mick.

@AJ

You used the $user_info at the top of the BoardIndex.template.php?

if ($user_info['is_guest'])
$normal_buttons['register'] = array('text' => 'registertocreate', 'image' => 'register.gif', 'lang' => true, 'custom' => 'rel="new_win nofollow"', 'url' => $scripturl . '?action=register',
   );



Add the code above either before or after...

if ($context['user']['is_logged'])
{
echo '
<div id="posting_icons" class="floatleft">';

// Mark read button.
$mark_read_button = array(
'markread' => array('text' => 'mark_as_read', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=all;' . $context['session_var'] . '=' . $context['session_id']),
);

echo '
<ul class="reset">
<li class="floatleft"><img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'new_some.png" alt="" /> ', $txt['new_posts'], '</li>
<li class="floatleft"><img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'new_none.png" alt="" /> ', $txt['old_posts'], '</li>
<li class="floatleft"><img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'new_redirect.png" alt="" /> ', $txt['redirect_board'], '</li>
</ul>
</div>';

ApplianceJunk

QuoteYou used the $user_info at the top of the BoardIndex.template.php?

In BoardIndex.template.php I found this around line 15.

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

and changed it to this.

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

Then I found this...

if ($context['user']['is_logged'])
{
echo '
<div id="posting_icons" class="floatleft">';

// Mark read button.
$mark_read_button = array(
'markread' => array('text' => 'mark_as_read', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=all;' . $context['session_var'] . '=' . $context['session_id']),
);

echo '
<ul class="reset">
<li class="floatleft"><img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'new_some.png" alt="" /> ', $txt['new_posts'], '</li>
<li class="floatleft"><img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'new_none.png" alt="" /> ', $txt['old_posts'], '</li>
<li class="floatleft"><img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'new_redirect.png" alt="" /> ', $txt['redirect_board'], '</li>
</ul>
</div>';



and added this above it..

if ($user_info['is_guest'])
$normal_buttons['register'] = array('text' => 'registertocreate', 'image' => 'register.gif', 'lang' => true, 'custom' => 'rel="new_win nofollow"', 'url' => $scripturl . '?action=register',
   );


so I end up with....


if ($user_info['is_guest'])
$normal_buttons['register'] = array('text' => 'registertocreate', 'image' => 'register.gif', 'lang' => true, 'custom' => 'rel="new_win nofollow"', 'url' => $scripturl . '?action=register',
   );

if ($context['user']['is_logged'])
{
echo '
<div id="posting_icons" class="floatleft">';

// Mark read button.
$mark_read_button = array(
'markread' => array('text' => 'mark_as_read', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=all;' . $context['session_var'] . '=' . $context['session_id']),
);

echo '
<ul class="reset">
<li class="floatleft"><img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'new_some.png" alt="" /> ', $txt['new_posts'], '</li>
<li class="floatleft"><img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'new_none.png" alt="" /> ', $txt['old_posts'], '</li>
<li class="floatleft"><img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'new_redirect.png" alt="" /> ', $txt['redirect_board'], '</li>
</ul>
</div>';


and as a guest on my test site and the rest of your mod installed and don't see the extra button.

What did I do wrong?

Thanks,


Mick.

Forget my previous post.  Lets make it simple for us.  ;)

Find:
template_info_center();

Add before...
if ($context['user']['is_guest'])
{
// Register at post view mod
echo'
                <div class="buttonlist">
                        <ul>
                             <li><a rel="nofollow" href="' ,$scripturl , '?action=register"><span>', $txt['registertocreate'], '</span></a></li>
                        </ul>
                </div><br />';
}

ApplianceJunk

That works, but puts it as shown in the attachment.
I would like to have it placed towards the top and bottom right side instead.

Thanks,

Mick.

Quote from: ApplianceJunk on February 05, 2013, 08:05:59 AM
That works, but puts it as shown in the attachment.
I would like to have it placed towards the top and bottom right side instead.

Thanks,
gimmie a few ;)

Mick.

The css
.buttonlist_reg ul
{
z-index: 100;
padding: 5px;
margin: 0 0.2em 5px 0;
}
.buttonlist_reg ul li
{
margin: 0;
padding: 0;
list-style: none;
float: right;
}
.buttonlist_reg ul li a
{
display: block;
font-size: 0.8em;
color: #000;
background: #e8e8e8 url(../images/theme/menu_gfx.png) no-repeat 0 -60px;
padding: 0 0 0 8px;
margin-left: 12px;
text-transform: uppercase;
cursor: pointer;
}
.buttonlist_reg ul li a:hover
{
background: url(../images/theme/menu_gfx.png) no-repeat 0 0;
color: #fff;
text-decoration: none;
}
.buttonlist_reg ul li a span
{
background: url(../images/theme/menu_gfx.png) no-repeat 100% -60px;
display: block;
height: 19px;
line-height: 19px;
padding: 0 8px 0 0;
}
.buttonlist_reg ul li a:hover span
{
background: #fff url(../images/theme/menu_gfx.png) no-repeat 100% 0;
}


The code:
if ($context['user']['is_guest'])
{
// Register at post view mod
echo'
                <div class="buttonlist_reg">
                    <ul>
                        <li><a rel="nofollow" href="' ,$scripturl , '?action=register"><span> ', $txt['registertocreate'], '</span></a></li>
                    </ul>
                </div>
                <br />';
}


Add before:
echo '
<div id="boardindex_table">
<table class="table_list">';


and add before...
template_info_center();

ApplianceJunk

That works great. Just one thing and I'm sorry if I'm being anal about this...

Could the bottom button be moved up so it's in the same location the "Mark All Messages As Read" is?

I have attached screenshots of how it looks to me.

Thanks,

Mick.

Try this...

Find:
if ($context['user']['is_logged'])
{
echo '
<div id="posting_icons" class="floatleft">';

// Mark read button.



Add before...
if ($context['user']['is_guest'])
{
// Register at post view mod
echo'
                <div class="buttonlist_reg">
                    <ul>
                        <li><a rel="nofollow" href="' ,$scripturl , '?action=register"><span> ', $txt['registertocreate'], '</span></a></li>
                    </ul>
                </div>
                <br />';
}

ApplianceJunk

That moved it up, but it also ended up moving the post icons on the right side down.


Mick.

lol try this...

find:

   if ($context['user']['is_logged'])
{
echo '
<div id="posting_icons" class="floatleft">';

// Mark read button.



add before...

if ($context['user']['is_guest'])
{
// Register at post view mod
echo'
                <div id="posting_icons" class="floatright">
                <div class="buttonlist_reg">
                    <ul>
                        <li><a rel="nofollow" href="' ,$scripturl , '?action=register"><span> ', $txt['registertocreate'], '</span></a></li>
                    </ul>
                </div>
                </div>';
}

ApplianceJunk

That location worked great, thanks!

But instead of using the code in your last post for the button, this...

if ($context['user']['is_guest'])
{
// Register at post view mod
echo'
                <div id="posting_icons" class="floatright">
                <div class="buttonlist_reg">
                    <ul>
                        <li><a rel="nofollow" href="' ,$scripturl , '?action=register"><span> ', $txt['registertocreate'], '</span></a></li>
                    </ul>
                </div>
                </div>';
}


I used the button code from the post with the .css

this...

if ($context['user']['is_guest'])
{
// Register at post view mod
echo'
                <div class="buttonlist_reg">
                    <ul>
                        <li><a rel="nofollow" href="' ,$scripturl , '?action=register"><span> ', $txt['registertocreate'], '</span></a></li>
                    </ul>
                </div>
                <br />';
}


and the reason I did not is because the button/text looks really small on the bottom button compared to the buttons on the Message and Post template pages.

but when using the other button code as I did the button on the BoardIndex looks larger then on the Message and Post pages, lol...

It's not a big deal, just thought I would point it out. I'm using the code on my live site now so you can see what I mean, http://appliancejunk.com

I thought that I could maybe fix the size difference by simply changing the font size in the .css that you had me add, but when I use firebug to inspect all the buttons they all show, font-size: 0.8em.

Thanks a million for all the help. 

Mick.



IchBin™

Mick, saw someone post about this mod and noticed it was perfect for hooks. No files required on the SMF files anymore if you'd like to use this package. Code is all yours if you want to use it.

IchBin™        TinyPortal

Mick.

Quote from: IchBin™ on July 10, 2013, 07:13:00 PM
Mick, saw someone post about this mod and noticed it was perfect for hooks. No files required on the SMF files anymore if you'd like to use this package. Code is all yours if you want to use it.


Awesome. Thanks Brian. The thing is, i dont know crap about hooks lol, mayBE thats why i quit writing mods. Bahahaha!

Mick.

Oh dang, i see how you did it. Time to study a bit about hooks. Thanx again.

IchBin™

Yeah, hooks are pretty dang cool. Just a couple of database entries and you're good to go. It'll call the file, an the other hooks call the functions needed. I think in SMF2.1 you can call a file with a hook, so no more requiring a file separately which is awesome.
IchBin™        TinyPortal

Mick.

Quote from: IchBin™ on July 10, 2013, 09:11:50 PM
Yeah, hooks are pretty dang cool. Just a couple of database entries and you're good to go. It'll call the file, an the other hooks call the functions needed. I think in SMF2.1 you can call a file with a hook, so no more requiring a file separately which is awesome.
Im studying it. This is something i should get into as i have a couple of mod ideas id like to make.

SDMiller

Seems like a great mod... but see the attached ss for where the instal tests fail.

FYI, I have the following mods installed:
Stop Spammer 2.3.9
httpBL 2.5.1
SimplePortal 2.3.5
Sneaky Editing 1.1
Glossary 0.3.1 (version 0 means what?, lol)
Ohara YouTube Embed 1.0
Peoplesign 1.6
Add IP2Location to Track IP 1.3
More Spiders 1.2


Any hope of an easy fix/manual instal situation?

Thanks.

IchBin™

Assuming you are using SMF2, try the package in this post on page 2 of this topic. I updated it for Mick. but it looks like he didn't put the update on the mod page. :)
IchBin™        TinyPortal

MotRude

This mod works great with 2.0.7..also works with different themes.


pocttopus

Works on 2.0.15. :D
Thanks... this is great mod!  ;)

Mick.


Advertisement: