Log in with username/password: lyceum/lyceum

root/trunk/src/lyceum/portal.php

Revision 616, 4.6 kB (checked in by jjb, 4 years ago)

Subdomains!

Most of the pieces in order to use subdomains. The way that cookies are set needs to be adapted to this system. As it is now, users have to keep re-logging-in when they switch from one domain to another.

Many thanks to coffelius of http://bloggear.net for help and code.

ticket:326

Line 
1 <?php
2 define('WP_USE_THEMES', true);
3 $blogdata='NULL';
4 $blog='NULL';
5 $optiondomain='system';
6 require('system-config.php');
7 //require_once('../lib/wp-includes/template-functions-general.php');
8 get_currentuserinfo();
9 ?>
10 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
11 <html xmlns="http://www.w3.org/1999/xhtml">
12
13 <head profile="http://gmpg.org/xfn/11">
14 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
15
16 <title>Lyceum</title>
17
18 <link rel="stylesheet" href="<?php echo get_option('siteurl'); ?>/wp-content/themes/default/style.css" type="text/css" media="screen" />
19
20 <style type="text/css" media="screen">
21     body { background: url("<?php echo get_option('siteurl'); ?>/wp-content/themes/default/kubrickbgcolor.jpg"); }   
22     #page { background: url("<?php echo get_option('siteurl'); ?>/wp-content/themes/default/images/kubrickbg.jpg") repeat-y top; border: none; }
23     #header { background: url("<?php echo get_option('siteurl'); ?>/wp-content/themes/default/images/kubrickheader.jpg") no-repeat bottom center; }
24     #footer { background: url("<?php echo get_option('siteurl'); ?>/wp-content/themes/default/images/kubrickfooter.jpg") no-repeat bottom; border: none;}
25
26     #header     { margin: 0 !important; margin: 0 0 0 1px; padding: 1px; height: 198px; width: 758px; }
27     #headerimg     { margin: 7px 9px 0; height: 192px; width: 740px; }
28
29     /*
30     #headerimg { background: url('<?php echo get_option('siteurl'); ?>/wp-content/themes/default/personalheader.jpg') no-repeat top;}
31     */
32 </style>
33
34     </head>
35 <body>
36
37 <div id="page">
38
39 <div id="header">
40     <div id="headerimg">
41         <h1>Welcome to <?php echo get_settings('site_title')?>!</h1>
42         <div class="description"><?php  echo $user_identity?"logged in as $user_identity":''?></div>
43     </div>
44 </div>
45 <hr />
46
47     <div id="content" class="widecolumn">
48     <?php if ($userdata->user_admin): ?>
49     <p style="font-size: 2em; margin: .3em 0" >
50     <a href="system-admin/settings.php">System Settings</a>
51     </p><br/><br/>
52     <? endif; ?>
53     <p>Thank you for helping to test Lyceum. Lyceum is an enterprise-scalable multi-blog branch of <a href="http://wordpress.org">WordPress</a>.</p>
54    
55     <p>Click <em>Register</em> to sign up for a username and blog. This will generate a password which will be emailed to you. After logging in, you can:
56     <ul>
57         <li>create posts</li>
58         <li>adjust blog settings</li>
59         <li>comment on your blog and other blogs</li>
60         <li>give other users in the system privileges on your blog! (Admin&rarr;Users&rarr;Authors&amp;Users)</li>
61         <li>You can even create multiple users/blogs and cross post between them, logged in, or anonymously</li>
62     </ul></p>
63
64     <fieldset>Send <ul><li>bug reports</li> <li>questions</li> <li>feature suggestions</li></ul> to: <strong>lyceum-bugs <em>AT</em> lists.ibiblio.org</strong></fieldset><br/>
65
66     <p><strong>Important Notes:</strong>
67     <ul>
68         <li>This is a test installation of Lyceum for the debugging phase. All the blogs here are likely to be deleted in a few weeks.</li>
69         <li>If you are unfamiliar with WordPress, you may wish to consult their helpful <a href="http://codex.wordpress.org/Working_with_WordPress">documentation</a>.</li>
70     </ul>
71     </p>
72     <?php
73     echo '
74         <ul style="font-size: 2em">
75             <li style="margin: .3em 0";><a href="wp-register.php">Register</a></li>
76             <li style="margin: .3em 0";><a href="wp-login.php">Log In</a></li>
77             <li style="margin: .3em 0";><a href="wp-login.php?action=logout">Log Out</a></li>
78         </ul>';
79
80     $myblogs = get_userblogs();
81
82     echo "<hr/><h2>My Blogs</h2>";
83     if ($myblogs) {
84         foreach ($myblogs as $b)
85             echo "<a href=\"".$b->home."\">$b->blogname</a><br/>";
86     } else
87         echo "You do not have permissions on any blogs. Click <em>Register</em> above to make a username and a blog.";
88
89     $blogs = $wpdb->get_results("
90         SELECT DISTINCT $wpdb->blogs.id, $wpdb->blogs.slug, option_value as blogname, status
91         FROM $wpdb->blogs
92             INNER JOIN $wpdb->options ON ($wpdb->blogs.id = $wpdb->options.blog)
93             INNER JOIN $wpdb->posts
94             INNER JOIN $wpdb->post2cat ON (post_id = $wpdb->posts.ID)
95             INNER JOIN $wpdb->categories ON (category_id = cat_ID AND $wpdb->categories.blog = $wpdb->options.blog)
96         WHERE
97             status = 'active' AND
98             option_name = 'blogname'
99         ORDER BY post_date_gmt DESC       
100     ");
101
102     echo "<hr/><h2>All Blogs</h2>";
103     if ($blogs)
104         if(SUBDOMAINS)
105             foreach ($blogs as $b)
106                 echo "<a href=\"http://$b->slug.".MAINDOMAIN."\">$b->blogname</a><br/>";
107         else
108             foreach ($blogs as $b)
109                 echo "<a href=\"./$b->id\">$b->blogname</a><br/>";
110
111     else
112         echo "The system does not yet have any blogs";
113     ?>       
114     </div>
115
116
117 <hr />
118 <div id="footer">
119 <p>LYCEUM</p>
120 </div>
121 </div>       
122 </body>
123 </html>
124
Note: See TracBrowser for help on using the browser.
Log in with username/password: lyceum/lyceum