ellawella Posted March 11, 2006 Posted March 11, 2006 It's really annoying when spiders index your topics in a non-standard display mode because if a guest follows a link to your board from a search engine and the page was indexed using a non-standard mode, he/she may not register or read any further due to the display mode being strange or, in the case of outline mode, something that totally gets in the way of user-friendliness. Of course, the natural way to solve a problem like this is to ban the URI in robots.txt. But because IPB tacks the "mode" parameter onto the end of the URI (e.g. index.php?showtopic=123&mode=threaded) it isn't possible to ban. I thought a simple workaround would be to edit the skin templates to rearrange the order in which these links are output but it turns out the template code for the menu choices is arranged as follows: {$data['TOPIC']['to_button_threaded']} so I assume that you can't change the order very easily because if you switched those two around you would end up with "&mode=threadedhttp://www.domain.com/boards/index.php?showtopic=123" <_< So, IPS, please can you take this into consideration for the next version? I think it's a pretty obvious suggestion, I'd be surprised if it hadn't been mentioned already in fact.
ellawella Posted March 11, 2006 Posted March 11, 2006 OK well I devised a simple edit which will put the mode parameter at the front of the URL so it can be banned in robots.txt. It's one simple copy/paste job, if IPS could make this behaviour default then that would be lovely. :) Open /sources/action_public/topics.php. Find: if ( $this->topic_view_mode == 'linearplus' ) { $this->topic['to_button_standard'] = $this->ipsclass->compiled_templates['skin_topic']->toutline_mode_choice_off( "{$this->ipsclass->base_url}showtopic={$this->topic['tid']}&mode=linear".$linear_pid, $this->ipsclass->lang['tom_standard'] ); $this->topic['to_button_linearpl'] = $this->ipsclass->compiled_templates['skin_topic']->toutline_mode_choice_on( "{$this->ipsclass->base_url}showtopic={$this->topic['tid']}&mode=linearplus".$linear_pid, $this->ipsclass->lang['tom_linear'] ); } else { $this->topic['to_button_standard'] = $this->ipsclass->compiled_templates['skin_topic']->toutline_mode_choice_on( "{$this->ipsclass->base_url}showtopic={$this->topic['tid']}&mode=linear".$linear_pid, $this->ipsclass->lang['tom_standard'] ); $this->topic['to_button_linearpl'] = $this->ipsclass->compiled_templates['skin_topic']->toutline_mode_choice_off( "{$this->ipsclass->base_url}showtopic={$this->topic['tid']}&mode=linearplus".$linear_pid, $this->ipsclass->lang['tom_linear'] ); $this->topic['to_button_threaded'] = $this->ipsclass->compiled_templates['skin_topic']->toutline_mode_choice_off( "{$this->ipsclass->base_url}showtopic={$this->topic['tid']}&mode=threaded".$threaded_pid, $this->ipsclass->lang['tom_outline'] ); Replace with: $this->topic['to_button_standard'] = $this->ipsclass->compiled_templates['skin_topic']->toutline_mode_choice_off( "{$this->ipsclass->base_url}mode=linear&showtopic={$this->topic['tid']}".$linear_pid, $this->ipsclass->lang['tom_standard'] ); $this->topic['to_button_linearpl'] = $this->ipsclass->compiled_templates['skin_topic']->toutline_mode_choice_off( "{$this->ipsclass->base_url}mode=linearplus&showtopic={$this->topic['tid']}".$linear_pid, $this->ipsclass->lang['tom_linear'] ); } else { $require = 'topic_linear.php'; $this->topic['to_button_threaded'] = $this->ipsclass->compiled_templates['skin_topic']->toutline_mode_choice_off( "{$this->ipsclass->base_url}mode=threaded&showtopic={$this->topic['tid']}".$threaded_pid, $this->ipsclass->lang['tom_outline'] ); if ( $this->topic_view_mode == 'linearplus' ) { $this->topic['to_button_standard'] = $this->ipsclass->compiled_templates['skin_topic']->toutline_mode_choice_off( "{$this->ipsclass->base_url}mode=linear&showtopic={$this->topic['tid']}".$linear_pid, $this->ipsclass->lang['tom_standard'] ); $this->topic['to_button_linearpl'] = $this->ipsclass->compiled_templates['skin_topic']->toutline_mode_choice_on( "{$this->ipsclass->base_url}mode=linearplus&showtopic={$this->topic['tid']}".$linear_pid, $this->ipsclass->lang['tom_linear'] ); } else { $this->topic['to_button_standard'] = $this->ipsclass->compiled_templates['skin_topic']->toutline_mode_choice_on( "{$this->ipsclass->base_url}mode=linear&showtopic={$this->topic['tid']}".$linear_pid, $this->ipsclass->lang['tom_standard'] ); $this->topic['to_button_linearpl'] = $this->ipsclass->compiled_templates['skin_topic']->toutline_mode_choice_off( "{$this->ipsclass->base_url}mode=linearplus&showtopic={$this->topic['tid']}".$linear_pid, $this->ipsclass->lang['tom_linear'] ); $this->topic['to_button_threaded'] = $this->ipsclass->compiled_templates['skin_topic']->toutline_mode_choice_on( "{$this->ipsclass->base_url}mode=threaded&showtopic={$this->topic['tid']}".$threaded_pid, $this->ipsclass->lang['tom_outline'] );
ellawella Posted March 11, 2006 Posted March 11, 2006 Um, OK, I seem to have posted it wrong, ignore the above thing. I'm a retard.NOTE: IGNORE THE INSTRUCTIONS IN THE ABOVE POST OK, try replacing: $this->topic['to_button_standard'] = $this->ipsclass->compiled_templates['skin_topic']->toutline_mode_choice_off( "{$this->ipsclass->base_url}showtopic={$this->topic['tid']}&mode=linear".$linear_pid, $this->ipsclass->lang['tom_standard'] ); $this->topic['to_button_linearpl'] = $this->ipsclass->compiled_templates['skin_topic']->toutline_mode_choice_off( "{$this->ipsclass->base_url}showtopic={$this->topic['tid']}&mode=linearplus".$linear_pid, $this->ipsclass->lang['tom_linear'] ); } else { $require = 'topic_linear.php'; $this->topic['to_button_threaded'] = $this->ipsclass->compiled_templates['skin_topic']->toutline_mode_choice_off( "{$this->ipsclass->base_url}showtopic={$this->topic['tid']}&mode=threaded".$threaded_pid, $this->ipsclass->lang['tom_outline'] ); if ( $this->topic_view_mode == 'linearplus' ) { $this->topic['to_button_standard'] = $this->ipsclass->compiled_templates['skin_topic']->toutline_mode_choice_off( "{$this->ipsclass->base_url}showtopic={$this->topic['tid']}&mode=linear".$linear_pid, $this->ipsclass->lang['tom_standard'] ); $this->topic['to_button_linearpl'] = $this->ipsclass->compiled_templates['skin_topic']->toutline_mode_choice_on( "{$this->ipsclass->base_url}showtopic={$this->topic['tid']}&mode=linearplus".$linear_pid, $this->ipsclass->lang['tom_linear'] ); } else { $this->topic['to_button_standard'] = $this->ipsclass->compiled_templates['skin_topic']->toutline_mode_choice_on( "{$this->ipsclass->base_url}showtopic={$this->topic['tid']}&mode=linear".$linear_pid, $this->ipsclass->lang['tom_standard'] ); $this->topic['to_button_linearpl'] = $this->ipsclass->compiled_templates['skin_topic']->toutline_mode_choice_off( "{$this->ipsclass->base_url}showtopic={$this->topic['tid']}&mode=linearplus".$linear_pid, $this->ipsclass->lang['tom_linear'] ); $this->topic['to_button_threaded'] = $this->ipsclass->compiled_templates['skin_topic']->toutline_mode_choice_on( "{$this->ipsclass->base_url}showtopic={$this->topic['tid']}&mode=threaded".$threaded_pid, $this->ipsclass->lang['tom_outline'] ); with $this->topic['to_button_standard'] = $this->ipsclass->compiled_templates['skin_topic']->toutline_mode_choice_off( "{$this->ipsclass->base_url}mode=linear&showtopic={$this->topic['tid']}".$linear_pid, $this->ipsclass->lang['tom_standard'] ); $this->topic['to_button_linearpl'] = $this->ipsclass->compiled_templates['skin_topic']->toutline_mode_choice_off( "{$this->ipsclass->base_url}mode=linearplus&showtopic={$this->topic['tid']}".$linear_pid, $this->ipsclass->lang['tom_linear'] ); } else { $require = 'topic_linear.php'; $this->topic['to_button_threaded'] = $this->ipsclass->compiled_templates['skin_topic']->toutline_mode_choice_off( "{$this->ipsclass->base_url}mode=threaded&showtopic={$this->topic['tid']}".$threaded_pid, $this->ipsclass->lang['tom_outline'] ); if ( $this->topic_view_mode == 'linearplus' ) { $this->topic['to_button_standard'] = $this->ipsclass->compiled_templates['skin_topic']->toutline_mode_choice_off( "{$this->ipsclass->base_url}mode=linear&showtopic={$this->topic['tid']}".$linear_pid, $this->ipsclass->lang['tom_standard'] ); $this->topic['to_button_linearpl'] = $this->ipsclass->compiled_templates['skin_topic']->toutline_mode_choice_on( "{$this->ipsclass->base_url}mode=linearplus&showtopic={$this->topic['tid']}".$linear_pid, $this->ipsclass->lang['tom_linear'] ); } else { $this->topic['to_button_standard'] = $this->ipsclass->compiled_templates['skin_topic']->toutline_mode_choice_on( "{$this->ipsclass->base_url}mode=linear&showtopic={$this->topic['tid']}".$linear_pid, $this->ipsclass->lang['tom_standard'] ); $this->topic['to_button_linearpl'] = $this->ipsclass->compiled_templates['skin_topic']->toutline_mode_choice_off( "{$this->ipsclass->base_url}mode=linearplus&showtopic={$this->topic['tid']}".$linear_pid, $this->ipsclass->lang['tom_linear'] ); $this->topic['to_button_threaded'] = $this->ipsclass->compiled_templates['skin_topic']->toutline_mode_choice_on( "{$this->ipsclass->base_url}mode=threaded&showtopic={$this->topic['tid']}".$threaded_pid, $this->ipsclass->lang['tom_outline'] ); That's lines 376 to 395.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.