Facebook  Twitter 

SMFHacks.com

+- +-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 12387
Latest: Altha
New This Month: 11
New This Week: 3
New Today: 0
Stats
Total Posts: 39888
Total Topics: 7022
Most Online Today: 78
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 52
Total: 52

Author Topic: Need Menu Button For SIMPLE BLOG  (Read 11128 times)

0 Members and 1 Guest are viewing this topic.

Offline doctoreast

  • Newbie
  • *
  • Posts: 12
    • View Profile
Need Menu Button For SIMPLE BLOG
« on: January 10, 2007, 11:30:25 pm »
Hi,

   Am I in the right forum? 
 
   If any of you are using simple blog, you've noticed
no link on the main menu for it, but there is a page
named: http://YOURWEBSITE/forum/index.php?action=blog
 with someone's name on it, never finished. 

  This page needs to ask for login/registration if not logged,
and then to take you to your freakin blog page.  Does anyone
know how to do this?  I did a temporary thing, where I'm
sending them to the profile page, which has a link to blog,
but that only works if members are logged, and so it's truly
sad that someone hasn't fixed that page.

EAst

Offline doctoreast

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Need Menu Button For SIMPLE BLOG
« Reply #1 on: January 14, 2007, 07:39:37 pm »


   Anyone there ?

  Can someone help to fix action=blog page?

East

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 14953
    • View Profile
Re: Need Menu Button For SIMPLE BLOG
« Reply #2 on: January 14, 2007, 08:15:03 pm »


   Anyone there ?

  Can someone help to fix action=blog page?

East
Thta is not meant to work. Its empty. You access a blog though your profile. Or a user's profile.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline doctoreast

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Need Menu Button For SIMPLE BLOG
« Reply #3 on: January 14, 2007, 09:14:55 pm »
Sir,
   I beg to differ.  Blogs are a very seductive addition for any website;
and therefore I need a Blog Link on my main menu.  Not some link to
to the base of the profile page which gives you an error screen if you
aren't logged in.

  Can you move this to improvements, maybe, that others can consider this?
I'd like to see the blog page have a login/register prompt and then the blog page,
not the profile page.

  My site was dead until I added blogs.  Members are all active daily now, that
I've added blogs.  I need this link on main menu please.

East

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 14953
    • View Profile
Re: Need Menu Button For SIMPLE BLOG
« Reply #4 on: January 14, 2007, 09:43:09 pm »
In the future the blog mod needs to really be redone. I took it over from another guy who left.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline doctoreast

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Need Menu Button For SIMPLE BLOG
« Reply #5 on: January 14, 2007, 11:01:56 pm »

Hi,
   I looked for the original guy, but his email and website is down.  I posted this same request over on SMF also.   Seriously, Simple Blog has turned out to be the winning edge for my website.  It's a health support group with the SMF forum, blog, and coppermine gallery.  I never realize that people were attracted to blogs, but it seems to build character, makes people feel like they make a difference in the world, broadcasting, activism, that sort of thing.

  Please consider this development, fix the bad page (action=blog) to prompt for register/login, and then send them to their blog page.  Their blog page also needs a default starter right content of some kind.  Look at a new member blog, empty right column, and you'll see what I mean.  ../forum/index.php?action=blog

East




In the future the blog mod needs to really be redone. I took it over from another guy who left.

Offline Eliana Tamerin

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Need Menu Button For SIMPLE BLOG
« Reply #6 on: January 28, 2007, 07:39:41 am »
The solution here requires a bit of work and patience. There is a way to make a blog menu link. It all depends on whether your skin works on image or text buttons. I'm going to write this for the default theme for SMF.

Open up your FTP client and go to your forum's home directory. From there go to Themes and then your theme's folder. Open index.template.php in a text editor.

Find the line that says '// Edit Profile'. We're going to use this as a template to create our link for the blog link. Copy the entire text between '// Edit Profile' and '// Go to PM center'. Paste the copied text in between those two blocks of code.

The current text should look like this:
Code: [Select]
// Edit Profile... [profile]
if ($context['allow_edit_profile'])
echo ($current_action == 'profile' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'profile' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=profile">' , $txt[79] , '</a>
</td>' , $current_action == 'profile' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

Now, let's adapt this for our use. We can ignore the comment in the first line, that won't affect our link. The first thing we need to edit is the action text. Change this line:
Code: [Select]
echo ($current_action == 'profile' || $context['browser']['is_ie4']) ?to this:
Code: [Select]
echo ($current_action == 'viewblog' || $context['browser']['is_ie4']) ?
Do that anywhere it says $current_action == 'profile'. There's 3 places total.

Now we need to change the URL to link our users to the blog. Find this line here:
Code: [Select]
<a href="', $scripturl, '?action=profile">' , $txt[79] , '</a>
Here's where it gets tricky. If you are using a theme other than the default, pay attention to the how the address is written. I'm going to break it down so you can understand it.
Code: [Select]
<a href="This is your basic HTML opening link statement.
Code: [Select]
', $scripturl,This is the url of your index.php for your forum.
Code: [Select]
'?action=profileThis tells the forum which page to load.
Code: [Select]
">This is your basic HTML closing link statement.

Ok, now we need to edit the link. We only need to change one part, but it can be confusing. The line you need to write is this:
Code: [Select]
<a href="', $scripturl, '?action=viewblog;u='. $context['user']['id'] .  '">' , $txt[79] , '</a>
Don't forget the '' single quotes around the . $context['user']['id'] .  part, otherwise your theme will be messed up. Some themes only require part of this code, depending on their structure. If you are using any other theme than the default one, and have problems, let me know which theme and I'll write this for that theme.

Now, there's one more part of this we need to do. Your link is coded, but it will say PROFILE on your menu if you don't change the link text. So let's do that now. Change this:
Code: [Select]
<a href="', $scripturl, '?action=viewblog;u='. $context['user']['id'] .  '">' , $txt[79] , '</a>to this:
Code: [Select]
<a href="', $scripturl, '?action=viewblog;u='. $context['user']['id'] .  '">' , 'BLOG' , '</a>
Your final edited text should look something like this:
Code: [Select]
// Edit Profile... [profile]
if ($context['allow_edit_profile'])
echo ($current_action == 'viewblog' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'viewblog' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=viewblog;u='. $context['user']['id'] .  '">' , 'BLOG' , '</a>
</td>' , $current_action == 'viewblog' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

You can change the comment (the first line) if you want, but keep the '// ' there to keep the text commented out, otherwise you'll get errors. I'm not sure if simpleblog has a view permission statement, so you can just leave the view profile permission statement there. If you really want it changed, you can say this:
Code: [Select]
if ($context['user']['is_logged'])instead. Now save your file and view your forum. You should have a link that says BLOG right next to your profile link. If so, good job. If it doesn't work or you get errors, reply here and I'll help you out. Tell me what theme you're using too, and attaching the index.template.php file can help as well.

Have fun with this.

Offline doctoreast

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Need Menu Button For SIMPLE BLOG
« Reply #7 on: January 28, 2007, 08:22:56 am »
Eliana,
  Wow, works beautifully.  Is there some way to keep the
button always visible?  If clicked while not logged, I was previously
using error message #453, which I have modified to say:
$txt[453] = 'Please Login? Otherwise, this profile is not available.';
Either something like that, or can it just redirect to the login page?
This is why I was asking about the index.php?action=blog page,
which is already there, just unfinished.  How would you do it, if
this were a permenant resolve (menu button)?
  Thank you so much, and I have published the patch. Too, be
sure that you get with user:smfhacks, to see if he wants to add
the patch to the next update.
Thanks,
Mike

Offline Eliana Tamerin

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Need Menu Button For SIMPLE BLOG
« Reply #8 on: January 28, 2007, 08:53:09 am »
For that you would have to edit the simpleblog.php itself. When you click the link while not logged in, it would direct you to 'http://path.to.your/forum/index.php?action=viewblog;u='. You just have to edit the error message to include a refresh code to take the user to a login page or display the standard 'No profile selected' message.

And yeah, not sure why action=blog is there anyways. It seems silly to have action=blog and action=viewblog both, but that's how Little15 coded it. I'm hoping SMFHacks will revamp it to consolidate the page to just action=blog and go on from there.

Offline doctoreast

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Need Menu Button For SIMPLE BLOG
« Reply #9 on: January 28, 2007, 12:54:40 pm »
Tamerin,

  This desperately needs attention, IMO.  Blogs really help with certain website traffic, very attractive. Action=blog page should/could handle all of it, is what I'm thinking;  redirect weather logged or not.  It's odd that there's absolutely no blog menu link at all, except as a footer on the profile page. It doesn't even belong there.
  Again, thanks for your support, and "works like a charm".

Doc

« Last Edit: January 28, 2007, 02:17:30 pm by doctoreast »

 

Related Topics

  Subject / Started by Replies Last post
[Mod] Simple Blog

Started by Little15 « 1 2 ... 8 9 » Latest Mods

133 Replies
166466 Views
Last post April 18, 2007, 09:39:07 pm
by pongsak
6 Replies
8354 Views
Last post May 11, 2007, 02:18:33 pm
by asklife
5 Replies
4891 Views
Last post July 17, 2007, 02:33:51 am
by KnightRobby
5 Replies
6113 Views
Last post February 02, 2011, 01:05:44 pm
by SMFHacks
5 Replies
7233 Views
Last post July 14, 2012, 10:09:27 pm
by SMFHacks

+- Recent Topics

prettyurls - TroubleShooting.wiki by Rock Lee
October 10, 2019, 11:37:09 am

Some issues with adding and editing a listing by ajac63
October 07, 2019, 04:16:40 am

Problem update 1.1.21 to 2.0.15 by Rock Lee
October 06, 2019, 06:09:16 pm

[Mod]SMF 2.0.x PHP 7.2 Support by sah62
October 04, 2019, 01:46:00 pm

Ideas by shuban
October 03, 2019, 10:19:06 pm

How to space icons and multiple reacts? by shadav
October 03, 2019, 04:20:07 pm

PrettyUrls SEO Pro by Rock Lee
October 01, 2019, 09:09:38 am

How to get search preciser by SMFHacks
September 23, 2019, 10:09:56 am

How to AVOID SEO Hit when Implementing PrettyURLs by SMFHacks
September 12, 2019, 08:50:42 pm

theme by SMFHacks
September 12, 2019, 07:10:51 am

Powered by EzPortal