Topic on Project:Support desk

86.173.55.212 (talkcontribs)

Hi I am trying to add something that detects your website address a then goes to the the special upload page. here is the code.


<a href="
    <?php echo $this->data['nav_urls']['upload']['href']; ?>
  ">
  <div class="onhoverbg" style="padding-left:0.8em;padding-right:0.8em;float:left;height:40px;font-size:10pt;">
    <img src="http://images.pidgi.net/uploadlogo.png" /> 
    <span style="color:#fff;position:relative;top:1px;">
      <?php $this->msg('uploadbtn') ?>
    </span>
  </div>
</a>
<?php $this->renderNavigation( array( 'NAMESPACES', 'VARIANTS', 'VIEWS', 'ACTIONS' ) ); ?>

The code worked for a few days then stoped working for me.

86.173.55.212 (talkcontribs)

Hi I think it is to do with people have to be loged in for it to go to correct link please can I have some help to allow everyone to go to the link.

88.130.105.169 (talkcontribs)

Hi!

The code, which you have there creates a link to the Upload page and then attaches some image in that link. The line $this->renderNavigation() basically does not have anything to do with that.

However, I have not really understood what exactly it is that you want to do:

When the wiki (not the IP of the visitor), but when the wiki has a certain domain name, do you then want to have a redirect?

Second question: Which page should get redirected and what should be the redirect target?

And finally: Where should this be added?

86.173.55.212 (talkcontribs)

Hi well for your two question. is that I would like to allow ip address to view the upload link but when clicked will show that error that you have to login so I would like help to allow ip address to view the link.

88.130.105.169 (talkcontribs)

So basically you want IPs to be able to see the link to Special:Upload (which they by default do not(?) see)?

86.173.55.212 (talkcontribs)

Yes please because the link only lets user who are logged in to see it or if you logged out it redirects you to main page.

88.130.105.169 (talkcontribs)

Then the question is: Why are people redirected away from that page?

When you open Special:Upload in a default installation, you can see the page - also when you cannot upload things. E.g. see Special:Upload when you are not logged in.

86.173.55.212 (talkcontribs)

Hi well I added an image and with that image I would like to to show the upload link instead of being hidden when logged out.

88.130.105.169 (talkcontribs)

The more you write the less I understand the problem. You can easily show a link to the upload page with this HTML code:

<li><a title="Upload an image, PDF, etc." href="/Special:Upload">Upload</a></li>

maybe you also want to do this

<?php if( !$this->getSkin()->getUser()->isLoggedIn() ) { ?>
    <li><a title="Upload an image, PDF, etc." href="/Special:Upload">Upload</a></li>
<?php } ?>

In this case the link is only displayed, if the user is logged out - I expect that otherwise MediaWiki will show the link by default already anyway.

86.173.55.212 (talkcontribs)

Hi I tried that and doesent work.

86.173.55.212 (talkcontribs)

Hi I use


<?php echo $this->data['nav_urls']['upload']['href']; ?>


and it only allows users who are logged in to view the link otherwise it just doesent show it and goes straight to main page.

Reply to "Upload link"