From which file does this code come?

Having trouble installing serendipity?
Post Reply
usr
Regular
Posts: 6
Joined: Thu May 22, 2008 6:01 pm

From which file does this code come?

Post by usr »

Hi there,

i've just installed serendipity, it all works quite well. However there is still a little problem.

If i'm visiting my blog and view the sourcecode in the browser, there is a line like this:

Code: Select all

<td id="serendipityRightSideBar" valign="top">    <div class="serendipitySideBarItem container_serendipity_superuser_plugin">
        <h3 class="serendipitySideBarTitle serendipity_superuser_plugin">Verwaltung des Blogs</h3>        <div class="serendipitySideBarContent"><a href="https://xxxxxxx.net/index.php?/admin" rel="nofollow" title="Login">Login</a></div>
I would like to change the url in the last line of the code. I've searched the ftp for hours, but i didn't find the correct file. If i'm oppening the index.php on the ftp, it looks completly different than the one the webserver is serving.

I guess its because its dynamically generated, right?

Would be really great if someone could me name the file, where to find the 3 line of codes from above.

And yes: i've searched nearly the complete ftp, including the plugin and template folders etc. Not just the index.php...

Thanks a lot, usr :)
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: From which file does this code come?

Post by garvinhicking »

Hi!

This comes from the serendipity "Superuser login" plugin. The PHP code is in include/plugin_internal.inc.php, the class serendipity_superuser_plugin.

Maybe if you want your own link there, you should simply add a HTML Nugget plugin and then insert the code that you would like to see/have.

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
usr
Regular
Posts: 6
Joined: Thu May 22, 2008 6:01 pm

Post by usr »

The problem is: when i want to login to write entrys, the ssl-connection doesn't work correct. I spoke with my hoster, and he advised me to make the url relative like xxxx.php, instead of https://bla.net/xxxx.php

I will try in some minutes and report back. Thanks!


edit: The browser is complaining that not all the data was encrypted beforce sending over the net. And i hope with a relative url instead of absolute it will work. :)
usr
Regular
Posts: 6
Joined: Thu May 22, 2008 6:01 pm

Post by usr »

The code looks like this:

Code: Select all

class serendipity_superuser_plugin extends serendipity_plugin {
    var $title = SUPERUSER;

    function introspect(&$propbag)
    {
        $propbag->add('name',          SUPERUSER);
        $propbag->add('description',   ALLOWS_YOU_BLAHBLAH);
        $propbag->add('stackable',     false);
        $propbag->add('author',        'Serendipity Team');
        $propbag->add('version',       '1.0');
        $propbag->add('configuration', array('https'));
        $propbag->add('groups',        array('FRONTEND_FEATURES'));
    }

    function generate_content(&$title)
    {
        global $serendipity;

        $title = $this->title;
        if ($this->get_config('https', 'false') == 'true') {
            $base = str_replace('http://', 'https://', $serendipity['baseURL']);
        } else {
            $base = $serendipity['serendipityHTTPPath'];
        }

        $link = $base . ($serendipity['rewrite'] == 'none' ? $serendipity['indexFile'] .'?/' : '') . PATH_ADMIN;
        $text = (($_SESSION['serendipityAuthedUser'] === true) ? SUPERUSER_OPEN_ADMIN : SUPERUSER_OPEN_LOGIN);
        echo '<a href="' . $link . '" rel="nofollow" title="'. $text .'">'. $text .'</a>';
    }

    function introspect_config_item($name, &$propbag)
    {
        switch($name) {
            case 'https':
                $propbag->add('type',        'boolean');
                $propbag->add('name',        PLUGIN_SUPERUSER_HTTPS);
                $propbag->add('description', PLUGIN_SUPERUSER_HTTPS_DESC);
                $propbag->add('default',     'false');
                break;

            default:
                return false;
        }
        return true;
    }
}

I've tested different things, but it didn't work out. I would like to give serendipity the relative path to the admin.php file, not the absolute one like "'serendipityHTTPPath". I've changed various things, including "<a href="'index.php?/admin'" rel="nofollow" title="'. $text .'">

But this doesn't work either. What am i doing wrong? Any suggestions?

Thanks!
usr
Regular
Posts: 6
Joined: Thu May 22, 2008 6:01 pm

Post by usr »

Allright: finally SSL is working correctly... :)

Just one last question: how can i delete the words "Verwaltung des Blogs" and the line between "Verwaltung" and "Login".

I want to see only "Login"

Thanks a lot!
Don Chambers
Regular
Posts: 3657
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

Try this in your template's stylesheet:

Code: Select all

.container_serendipity_superuser_plugin .serendipitySideBarTitle {
    display: none !important;
}
I only put the !important in there because I am not sure how your template otherwise defines rules for the sidebar containers, and the sidebar title.
=Don=
usr
Regular
Posts: 6
Joined: Thu May 22, 2008 6:01 pm

Post by usr »

Sorry, maybe i'm a little bit stupid. :/

I'm using "mt-trendy", and looked in the folder: there are only two .css files, both don't contain your code. I've searched also for it in the "default" folder, and viewed the index.tpl and sidebar.tpl, but the was also no success.

Where do i have to search? :/

Sorry.
Don Chambers
Regular
Posts: 3657
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

Open that template's style.css file... look for this:

Code: Select all

/* Sidebars */

#serendipityLeftSideBar,
#serendipityRightSideBar {
  background-color: #333333;
  color: #cccccc;
  display: block;
  margin-top: 35px;
  padding: 10px;
  vertical-align: top;
}

.serendipitySideBarTitle {
  border-bottom: 1px solid #666666;
  color: #cccccc;
  margin: 0;
  font-size: x-small;
  font-weight: bold;
  padding-left: 2px;
  text-transform: uppercase;
}

div.serendipitySideBarItem {
  color: #666666;
  font-size: small;
  font-weight: normal;
  margin-bottom: 12px;
  padding-bottom: 12px;
}
And right after that last block, add this one:

Code: Select all

.container_serendipity_superuser_plugin h3.serendipitySideBarTitle {
    display: none;
}
=Don=
usr
Regular
Posts: 6
Joined: Thu May 22, 2008 6:01 pm

Post by usr »

Working. Thanks so much! :)
Don Chambers
Regular
Posts: 3657
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

Happy to help!
=Don=
Post Reply