need help getting polls to work w/ handyman SEO mod on 3.0.9

Need some coding help with a MOD or tweak you are working on? - Ask here.
Forum rules
Ask for support specifically regarding coding help with phpBB3.
Not for generic usability questions or support.

need help getting polls to work w/ handyman SEO mod on 3.0.9

Postby dont » 30 Dec 2011, 19:55

where is handyman when you need him:)

his is the best and the simplest seo mod there ever was and so mean of him not to integrate all the fixes into the new version and publish it somewhere:)

:grin:
User avatar
dont
Cadet II
Cadet II
 
Posts: 21
Joined: 06 Oct 2009, 20:52
Location: vancouver rain
Gender: Female


Re: need help getting polls to work w/ handyman SEO mod on 3.0.9

Postby Handyman » 30 Dec 2011, 21:46

Hmm, I think I need to track down all the fixes and post it with the MOD.
I've been spending all my spare time finishing up a framework.
Please contact me if you have any news to submit to SCOFF News.
SCOFFing at the candidates while you sleep.
My Mods || My Mod Queue
Image
User avatar
Handyman    
Rear Fleet Admiral
Rear Fleet Admiral
 
Posts: 7456
Joined: 08 May 2006, 04:45
Location: Where no man has gone before!
Favorite Team: Seattle Seahawks
Gender: Male

Re: need help getting polls to work w/ handyman SEO mod on 3.0.9

Postby Handyman » 30 Dec 2011, 22:28

Ok, hopefully this is everything.

Replace your old functions_seo.php with this new file:
functions_seo.php.zip
new functions_seo.php
(3.38 KiB) Downloaded 28 times


Then, here are all the modifications I've found everyone created to fix all the outstanding issues.
I went through and modified anything that wasn't correct in the fixes, but I haven't actually tested it, so please let me know if you find anything else or if something breaks.

OPEN
index.php

FIND
Code: Select all
    'U_MARK_FORUMS'        => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}index.$phpEx", 'mark=forums') : '',
      

REPLACE WITH
Code: Select all
    'U_MARK_FORUMS'        => ($user->data['is_registered'] || $config['load_anon_lastread']) ? '?mark=forums' : '',  


OPEN
viewtopic.php

FIND
Code: Select all
    // Redirect to login or to the correct post upon emailed notification links
    if (isset($_GET['e']))
    {
       $jump_to = request_var('e', 0);

        $redirect_url = format_url($topic_title, "t$topic_id");

       if ($user->data['user_id'] == ANONYMOUS)
       {
          login_box($redirect_url . "&p=$post_id&e=$jump_to",  user->lang['LOGIN_NOTIFY_TOPIC']);
       }

       if ($jump_to > 0)
       {
          // We direct the already logged in user to the correct post...
          redirect($redirect_url . ((!$post_id) ? "&p=$jump_to" : "&p=$post_id") . "#p$jump_to");
       }
    } 


REPLACE WITH
Code: Select all
    // Redirect to login or to the correct post upon emailed notification links
    if (isset($_GET['e']))
    {
       $jump_to = request_var('e', 0);

        $redirect_url = format_url($topic_title, "t$topic_id");

       if ($user->data['user_id'] == ANONYMOUS)
       {
          login_box($redirect_url . "#p$jump_to", $user->lang['LOGIN_NOTIFY_TOPIC']);
       }

       if ($jump_to > 0)
       {
          // We direct the already logged in user to the correct post...
          redirect($redirect_url . "#p$jump_to");
       }
    } 


FIND
Code: Select all
    'U_VIEW_UNREAD_POST'   => format_url($topic_title, "t$topic_id", 0, 'view=unread'), 


REPLACE WITH
Code: Select all
    'U_VIEW_UNREAD_POST'   => format_url($topic_title, "t$topic_id", 0, 'view=unread#unread'), 


FIND
Code: Select all
    'U_VIEW_UNREAD_POST'   => format_url($topic_title, "t$topic_id", 0, 'view=unread'), 


REPLACE WITH
Code: Select all
    'U_VIEW_UNREAD_POST'   => format_url($topic_title, "t$topic_id", 0, 'view=unread#unread'), 


FIND (Find every instance)
Code: Select all
    $forum_id = $row['forum_id']; 


AFTER, ADD (For every instance found)
Code: Select all
    $forum_name = $row['forum_name']; 


FIND (Find every instance)
Code: Select all
    $topic_id = $row['topic_id']; 


AFTER, ADD (For every instance found)
Code: Select all
    $topic_title = $row['topic_title']; 


OPEN
viewforum.php

FIND
Code: Select all
    'U_NEWEST_POST'         => $view_topic_url . '&view=unread#unread', 


REPLACE WITH
Code: Select all
    'U_NEWEST_POST'         => $view_topic_url . '-view=unread#unread', 


OPEN
memberlist.php

FIND
Code: Select all
    $user->setup(array('memberlist', 'groups')); 


AFTER, ADD
Code: Select all
    $forum_folder = (strlen($config['script_path']) > 1) ? $config['script_path'] . '/' : '/' ;  


FIND
Code: Select all
    $messenger->assign_vars(array(
       'TOPIC_NAME'   => htmlspecialchars_decode($row['topic_title']),
                    'U_TOPIC'      => format_url($row['topic_title'], "t$topic_id")
    ); 


REPLACE WITH
Code: Select all
                            $topic_seo_link = format_url($row['topic_title'], "t$topic_id");
                            $topic_seo_link = str_replace('./', $config['server_protocol'] . $config['server_name'] . $forum_folder, $topic_seo_link);
                            $messenger->assign_vars(array(
                         'TOPIC_NAME'   => htmlspecialchars_decode($row['topic_title']),
                                'U_TOPIC'      => $topic_seo_link)
                      ); 

-- TEMPLATE CHANGES --
OPEN
styles/prosilver/template/forum_fn.js

FIND
Code: Select all
    function jumpto()
    {
       var page = prompt(jump_page, on_page);

       if (page !== null && !isNaN(page) && page > 0)
       {
          document.location.href = base_url.replace(/&/g, '&') + '&start=' + ((page - 1) * per_page);
       }
    }


REPLACE WITH
Code: Select all
    function jumpto(base_url, seo_ext)
    {
       var page = prompt(jump_page, on_page);

       if (page !== null && !isNaN(page) && page > 0)
       {
          document.location.href = base_url.replace(/&/g, '&') + 's' + ((page - 1) * per_page) + seo_ext;
       }
    }


OPEN
styles/prosilver/template/viewtopic_body.html

FIND
Code: Select all
<a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">


REPLACE WITH
Code: Select all
<a href="#" onclick="jumpto('{BASE_URL}','{SEO_EXT}'); return false;" title="{L_JUMP_TO_PAGE}">


FIND
Code: Select all
<a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">


REPLACE WITH
Code: Select all
<a href="#" onclick="jumpto('{BASE_URL}','{SEO_EXT}'); return false;" title="{L_JUMP_TO_PAGE}">


OPEN
styles/prosilver/template/viewforum_body.html

FIND
Code: Select all
    <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">


REPLACE WITH
Code: Select all
    <a href="#" onclick="jumpto('{BASE_URL}','{SEO_EXT}'); return false;" title="{L_JUMP_TO_PAGE}">


FIND
Code: Select all
    <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">


REPLACE WITH
Code: Select all
    <a href="#" onclick="jumpto('{BASE_URL}','{SEO_EXT}'); return false;" title="{L_JUMP_TO_PAGE}">
Please contact me if you have any news to submit to SCOFF News.
SCOFFing at the candidates while you sleep.
My Mods || My Mod Queue
Image
User avatar
Handyman    
Rear Fleet Admiral
Rear Fleet Admiral
 
Posts: 7456
Joined: 08 May 2006, 04:45
Location: Where no man has gone before!
Favorite Team: Seattle Seahawks
Gender: Male

Re: need help getting polls to work w/ handyman SEO mod on 3.0.9

Postby dont » 30 Dec 2011, 22:34

sweeet!!! omg thank you, thank you!! k, gonna try it as soon as poss and will report here:).. you are the bestest mr. handy man! :good:
User avatar
dont
Cadet II
Cadet II
 
Posts: 21
Joined: 06 Oct 2009, 20:52
Location: vancouver rain
Gender: Female

Re: need help getting polls to work w/ handyman SEO mod on 3.0.9

Postby dont » 31 Dec 2011, 02:13

k, viewforum.php original code looks like this:

Code: Select all
'U_NEWEST_POST'         => append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params . '&amp;view=unread') . '#unread',

- wasn't sure how to implement the change you suggested.

as far as the other changes - implemented them all and still get Error 404 - Not Found when voting in the poll.. i'm stumped, pls help! :write:
User avatar
dont
Cadet II
Cadet II
 
Posts: 21
Joined: 06 Oct 2009, 20:52
Location: vancouver rain
Gender: Female

Re: need help getting polls to work w/ handyman SEO mod on 3.0.9

Postby dont » 01 Jan 2012, 13:15

bump! and happy new year everyone!:)
User avatar
dont
Cadet II
Cadet II
 
Posts: 21
Joined: 06 Oct 2009, 20:52
Location: vancouver rain
Gender: Female

Re: need help getting polls to work w/ handyman SEO mod on 3.0.9

Postby Handyman » 01 Jan 2012, 14:20

Can you post the URL the page goes to when you vote?
Also, make sure you purge the template cache to make sure all the changes take effect.
Please contact me if you have any news to submit to SCOFF News.
SCOFFing at the candidates while you sleep.
My Mods || My Mod Queue
Image
User avatar
Handyman    
Rear Fleet Admiral
Rear Fleet Admiral
 
Posts: 7456
Joined: 08 May 2006, 04:45
Location: Where no man has gone before!
Favorite Team: Seattle Seahawks
Gender: Male

Re: need help getting polls to work w/ handyman SEO mod on 3.0.9

Postby dont » 02 Jan 2012, 21:26

yes!! here's the URL: http://memebee.com/vancouver/should-gen ... 1964.html-

templates cache purged more than once.. just in case:) - no use.

also, pls help with how to change viewforum.php code as i can't find enough resemblance with the code and the change you requested. this is what i see:

Code: Select all
'U_NEWEST_POST'         => append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params . '&amp;view=unread') . '#unread',


finally i gotta update to 3.0.10 - just saw that there's a new version out - would that help maybe? will upgrade the version later tonight and will post here if it changes anything.

thanks handyman!
User avatar
dont
Cadet II
Cadet II
 
Posts: 21
Joined: 06 Oct 2009, 20:52
Location: vancouver rain
Gender: Female

Re: need help getting polls to work w/ handyman SEO mod on 3.0.9

Postby dont » 03 Jan 2012, 18:48

bump! just to say i didn't update to 3.0.10 yet!.. but will do first chance i get! soon! lol:(

Image
User avatar
dont
Cadet II
Cadet II
 
Posts: 21
Joined: 06 Oct 2009, 20:52
Location: vancouver rain
Gender: Female

Re: need help getting polls to work w/ handyman SEO mod on 3.0.9

Postby Handyman » 03 Jan 2012, 19:03

Ok, that shouldn't make a difference as I actually designed this MOD back when phpBB 3.0 was still in Beta :grin:
I haven't had a chance to look at the polls template just yet.
Please contact me if you have any news to submit to SCOFF News.
SCOFFing at the candidates while you sleep.
My Mods || My Mod Queue
Image
User avatar
Handyman    
Rear Fleet Admiral
Rear Fleet Admiral
 
Posts: 7456
Joined: 08 May 2006, 04:45
Location: Where no man has gone before!
Favorite Team: Seattle Seahawks
Gender: Male

Next

Return to phpBB3 Coding Assistance

Who is online

Users browsing this forum: Baidu [spider], Exabot [Bot] and 12 guests