Commit 222e1e55 authored by Dries's avatar Dries
Browse files

- Documentation improvements: improved and updated the block module documentation.  Patch #44 by Al.  We should add some real-life path examples!

- Fixed the "blog it" image size.  Patch #49 by Al.

- Some SQL performance improvements to the forum module.  This should also be more PostgreSQL safe.  Patch by me.

mysql> SELECT n.nid, n.created AS timestamp, u.name AS name, u.uid AS uid FROM forum f, node n LEFT JOIN users u ON n.uid = u.uid WHERE f.tid = 2 AND n.nid = f.nid AND n.type = 'forum' AND n.status = 1 ORDER BY timestamp DESC LIMIT 1, 0;
==> 0.63 sec

changed to:

mysql> SELECT n.nid, n.created AS timestamp, u.name AS name, u.uid AS uid FROM forum f LEFT JOIN node n ON n.nid = f.nid LEFT JOIN users u ON n.uid = u.uid WHERE f.tid = 2 AND n.nid = f.nid AND n.type = 'forum' AND n.status = 1 ORDER BY timestamp DESC LIMIT 1, 0;
==> 0.00 sec
parent b0081e5a
......@@ -31,7 +31,7 @@ th {
.form-item .title { font-weight: bold; margin-top: 1.1em; margin-bottom: 1px; }
.form-submit { margin: 0.5em 0; }
.item-list .icon { color: #555; float: right; padding-left: 0.25em; }
.item-list .icon { color: #555; float: right; padding-left: 0.25em; clear: right; }
.item-list .icon a { color: #000; text-decoration: none; }
.item-list .icon a:hover { color: #000; text-decoration: none; }
.item-list .title { font-weight: bold; }
......
......@@ -2,21 +2,18 @@
// $Id$
function block_help() {
$output .= "<p>Blocks are the boxes visible in the side bars on the left- and/or right-hand side of the web site, depending on the chosen theme. They are either exported by the Drupal engine or by any of the active modules. To really get your teeth into a Drupal web site, you are going to have to deal with blocks and administering blocks in a fairly sophisticated fashion. This means you will need to understand how the block placement strategy works.</p>";
$output .= "<p>The placement of blocks is delegated to the administrator. In most cases (i.e., the ". l("\"custom\" blocks","admin/block/add") ."), the user has complete control -- using preferences -- over whether or not they are enabled.</p>";
$output .= "<p>An administrator can lay out and arrange the available blocks to fit in two regions: \"left\" and \"right\". Regions simply contain blocks. In addition, an administrator can assign each block (within a region) a weight to sort them vertically. The heavier blocks will \"sink\" towards the bottom of the column while the lighter blocks will \"float\" towards the top.</p>";
$output .= "<p>As mentioned, blocks may be arranged to fit in two regions: left and right. For theme builders, each region is identified by a corresponding constant: \"left\" and \"right\", though some themes may be written to contain only one column \"all\". In this case, all the blocks are sorted by weight and the region setting is ignored.</p>";
$output .= "<p>The path setting lets you define which pages you want the specific block to be shown. If you leave the path blank it will show on all pages. The path uses a regular expression syntax so remember to escape special characters!<br />Examples:<ul><li>Only show the block on node pages: ^/node\\.php</li><li>Only show the block on the user page: ^/module\\.php\\?mod=user</li><li>Show the block in main and blog pages: ^/(index\\.php|module\\.php\\?mod=blog)</li></ul></p>";
$output .= "<p>The content of the site can be almost entirely altered through ". l("<i>custom blocks</i>", "admin/block/add") .". Simply put, custom blocks are small bits of text, HTML or PHP code which will get plugged into the site just like any other block.</p>";
$output .= "<p>Each custom block consists of a title, a description, and a body of text, HTML, or PHP code which can be as long as you wish. The Drupal engine will 'render' the content of the custom block.</p>";
$output .= "<h3>PHP in custom blocks</h3><p>If you know how to script in PHP, PHP custom blocks are easy to create. But don't worry if you're no PHP-wizard: simply use HTML instead.</p>";
$output .= "<p>You can use any piece of PHP code to make up the content of a PHP custom block: this implies that you can declare and use functions, consult the SQL database, access configuration settings and much more. A PHP custom blocks' code is stored in the database and the engine will dynamically embed the PHP code just-in-time for execution.</p>";
$output .= "<p>There are however some factors to keep in mind when using and creating PHP custom blocks: PHP custom blocks can be extremely useful and flexible, yet they can be dangerous and insecure if not properly used. If you are not familiar with PHP, SQL or with the site engine, avoid experimenting with PHP custom blocks because you can - and probably will - corrupt your database or render your site unusable! If you don't plan to do fancy stuff with custom blocks then you're probably better off with HTML.</p>";
$output .= "<p>Remember that the code within each PHP custom block must be valid PHP code -- including things like correctly terminating statements with a semicolon so that the parser won't die. It is highly recommended that you develop your custom blocks separately using a simple test script on top of a test database before migrating to your production environment.</p>";
$output .= "<p>Note:<br /><ul><li>You can use global variables, such as configuration parameters, within the scope of a PHP box but remember that variables which have been given values in a PHP box will retain these values in the engine or module afterwards.</li><li>register_globals is now set to <b>off</b>. If you need form information you need to get it from the \"superglobals\" \$_POST, \$_GET, etc.</li></ul></p>";
$output .= "<p>You <b>have</b> to use the <code>return</code> statement to return the actual content for your block. You <b>may not</b> <code>print</code> or <code>echo</code> it.</p>";
$output .= "<p><u>A basic example:</u></p>";
$output .= "<p>Given the box with title \"Welcome\", used to create a \"<i>Welcome</i>\" box. The content for this box could be created by using:</p>";
$output .= "<p>Blocks are the boxes visible in the sidebar(s) of your web site. These are usually generated automatically by modules (e.g. recent forum topics), but you can also create your own blocks using either static HTML or dynamic PHP content.</p>";
$output .= "<p>Which sidebar each block appears in depends on which theme you're using (some are left-only, some right, some both), and also on the settings in block management.</p><p>Whether a block is visible in the first place depends on three things:</p><ul><li>It must have its \"enabled\" box checked in block management.</li><li>If it has its \"custom\" box checked in block management, the user must have chosen to display it in their user preferences.</li><li>If the \"path\" field in block management is set, the visitor must be on a page that matches the path specification (more on this later).</li></ul>";
$output .= "<p>The block management screen also lets you specify the vertical sort-order of the blocks within a sidebar. You do this by assigning a <b>weight</b> to each block. Lighter blocks (smaller weight) \"float up\" towards the top of the sidebar. Heavier ones \"sink down\" towards the bottom of it. Once you've positioned things just so, you can preview what the layout will look like in different types of themes by clicking the preview placement link in the menu to the left.</p>";
$output .= "<p>The path setting lets you define on which pages you want a specific block to be shown. If you leave the path blank it will show on all pages. The path uses a regular expression syntax so remember to escape special characters!";
$output .= "<h3>Custom Blocks</h3>";
$output .= "<p>A custom block is a block that contains admin-supplied HTML, text or PHP content (as opposed to being generated automatically by a module). Each custom block consists of a title, a description, and a body of text, HTML, or PHP code which can be as long as you wish. The Drupal engine will 'render' the content of the custom block.</p>";
$output .= "<h4>PHP in custom blocks</h4>";
$output .= "<p>If you know how to script in PHP, Drupal gives you the power to embed any script you like inside a block. It will be executed at page view and dynamically embedded into the page. This gives you amazing flexibility and power, but of course with that comes danger and insecurity if you don't write good code. If you are not familiar with PHP, SQL or with the site engine, avoid experimenting with PHP custom blocks because you can corrupt your database or render your site insecure or even unusable! If you don't plan to do fancy stuff with custom blocks then you're probably better off with straight HTML.</p>";
$output .= "<p>Remember that the code within each PHP custom block must be valid PHP code - including things like correctly terminating statements with a semicolon so that the parser won't die. It is highly recommended that you develop your cusom blocks separately using a simple test script on top of a test database before migrating to your production environment.</p>";
$output .= "<p>Notes:</p><ul><li>You can use global variables, such as configuration parameters, within the scope of a PHP box but remember that variables which have been given values in a PHP box will retain these values in the engine or module afterwards.</li><li>register_globals is now set to <b>off</b> by default. If you need form information you need to get it from the \"superglobals\" \$_POST, \$_GET, etc.</li><li>You can use the <code>return</code> statement to return the actual content for your block as well.</li></ul>";
$output .= "<p>A basic example:</p>";
$output .= "<blockquote><p>You want to have a box with the title \"Welcome\" that you use to greet your visitors. The content for this box could be created by going:</p>";
$output .= "<pre>
return t(\"Welcome visitor, ... welcome message goes here ...\");
</pre>";
......@@ -27,8 +24,8 @@ function block_help() {
}
else {
return t(\"Welcome visitor, ... welcome message goes here ...\");
}
</pre>";
}";
$output .= "</pre></blockquote>";
$output .= "<p>For more in-depth examples, we recommend that you check the existing boxes and use them as a starting point.</p>";
return t($output);
......@@ -45,9 +42,9 @@ function block_perm() {
function block_link($type) {
if ($type == "admin" && user_access("administer blocks")) {
$help["block"] = t("Blocks are the boxes visible in the side bars on the left- and right-hand side of the web site, depending on the chosen theme. They are created by <b>active</b> Drupal modules. In order to view a block it must be enabled, then you can assign the block's placement by giving it a region and/or a weight within that region. This sorts them vertically, the smaller the weight, the lighter the block and it will \"float\" towards the top of the page. The path setting is a mask which lets you define on which pages you want the specific block to be shown. The custom checkbox tells Drupal to use a custom designed block, see both <a href=\"%help\">help</a> and <a href=\"%block\">create new block</a> for more information on custom blocks. If you have a custom block then the \"edit\" and \"delete\" operations will be displayed to edit/delete your custom block.", array("%help" => url("admin/block/help"), "%block" => url("admin/block/add")));
$help["create"] = t("Below you can create a block to be used in the side bars. Once you have created this block you must make it active, and give it a place on the page by using <a href=\"%overview\">block management</a>. The title is used when displaying the block. The description is used in the \"block\" column on the <a href=\"%overview\">block management</a> page. If you are going to place PHP code in the block, and you have <b>create PHP content</b> permission (see <a href=\"%permission\">user management >> user permissions</a>) you <b>must</b> change the type to PHP to make your code active.", array("%overview" => url("admin/block"), "%permission" => url("admin/user/permission")));
$help["preview"] = t("This page shows you the placement of your blocks. Each block is represented by its block name, and it's weight. <b>Layout scheme #1</b> is a layout with both left and right columns. <b>Layout scheme #2</b> has only a right column. And <b>layout scheme #3</b> only a left column.");
$help["block"] = t("Blocks are the boxes visible in the side bars on the left- and right-hand side of the web site, depending on the choosen theme. They are created by <b>active</b> Drupal modules. In order to view a block it must be enabled. You can assign the block's placement by giving it a region and a weight. The region specifies which side of the page the block is on, and the weight sorts blocks within a region. Lighter (smaller weight value) blocks \"float up\" towards the top of the page. The path setting is a mask which lets you define on which pages you want the specific block to be shown. The custom checkbox lets your users hide the block from their account setting page. You can also create your own blocks, where you specify the content of the block rather than it being generated by a module (you can even use PHP in these). You can create one of these by clicking the %createblock link in the menu to the left. Edit and delete links will become active below for these customized blocks.", array("%createblock" => l(t("create new block"), "admin/block/add")));
$help["create"] = t("Here you can create a custom content block. Once you have created this block you must make it active, and give it a place on the page using <a href=\"%overview\">block management</a>. The title is used when displaying the block. The description is used in the \"block\" column on the <a href=\"%overview\">block management</a> page. If you are going to place PHP code in the block, and you have <b>create PHP content</b> permission (see <a href=\"%permission\">user management >> user permissions</a>) you <B>must</b> change the type to PHP to make your code active.", array("%overview" => url("admin/block"), "%permission" => url("admin/user/permission")));
$help["preview"] = t("This page helps show you the placement of your blocks in different themes. The numbers are the weight of each block, which is used to sort them within the sidebars.");
menu("admin/block", "block management", "block_admin", $help["block"], 3);
menu("admin/block/add", "create new block", "block_admin", $help["create"], 2);
......@@ -179,7 +176,7 @@ function block_admin_preview() {
}
$rblocks .= "</table>\n";
$output .= "<h3>layout scheme #1:</h3>\n";
$output .= "<h3>". t("Themes with both left and right sidebars") .":</h3>\n";
$output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n";
$output .= " <tr><td align=\"center\" colspan=\"3\">header</td></tr>\n";
$output .= " <tr><td>\n". ($lblocks ? $lblocks : "&nbsp;") ."</td><td width=\"300\">&nbsp;</td><td>\n". ($rblocks ? $rblocks : "&nbsp;") ."</td></tr>\n";
......@@ -195,14 +192,14 @@ function block_admin_preview() {
}
$blocks .= "</table>\n";
$output .= "<h3>layout scheme #2:</h3>\n";
$output .= "<h3>". t("Themes with right-sidebar only") .":</h3>\n";
$output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n";
$output .= " <tr><td align=\"center\" colspan=\"2\">header</td></tr>\n";
$output .= " <tr><td width=\"400\">&nbsp;</td><td>\n". ($blocks ? $blocks : "&nbsp;") ."</td></tr>\n";
$output .= " <tr><td align=\"center\" colspan=\"2\">footer</td></tr>\n";
$output .= "</table>\n";
$output .= "<h3>layout scheme #3:</h3>\n";
$output .= "<h3>". t("Themes with left-sidebar only") .":</h3>\n";
$output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n";
$output .= " <tr><td align=\"center\" colspan=\"2\">header</td></tr>\n";
$output .= " <tr><td>\n". ($blocks ? $blocks : "&nbsp;") ."</td><td width=\"400\">&nbsp;</td></tr>\n";
......
......@@ -2,21 +2,18 @@
// $Id$
function block_help() {
$output .= "<p>Blocks are the boxes visible in the side bars on the left- and/or right-hand side of the web site, depending on the chosen theme. They are either exported by the Drupal engine or by any of the active modules. To really get your teeth into a Drupal web site, you are going to have to deal with blocks and administering blocks in a fairly sophisticated fashion. This means you will need to understand how the block placement strategy works.</p>";
$output .= "<p>The placement of blocks is delegated to the administrator. In most cases (i.e., the ". l("\"custom\" blocks","admin/block/add") ."), the user has complete control -- using preferences -- over whether or not they are enabled.</p>";
$output .= "<p>An administrator can lay out and arrange the available blocks to fit in two regions: \"left\" and \"right\". Regions simply contain blocks. In addition, an administrator can assign each block (within a region) a weight to sort them vertically. The heavier blocks will \"sink\" towards the bottom of the column while the lighter blocks will \"float\" towards the top.</p>";
$output .= "<p>As mentioned, blocks may be arranged to fit in two regions: left and right. For theme builders, each region is identified by a corresponding constant: \"left\" and \"right\", though some themes may be written to contain only one column \"all\". In this case, all the blocks are sorted by weight and the region setting is ignored.</p>";
$output .= "<p>The path setting lets you define which pages you want the specific block to be shown. If you leave the path blank it will show on all pages. The path uses a regular expression syntax so remember to escape special characters!<br />Examples:<ul><li>Only show the block on node pages: ^/node\\.php</li><li>Only show the block on the user page: ^/module\\.php\\?mod=user</li><li>Show the block in main and blog pages: ^/(index\\.php|module\\.php\\?mod=blog)</li></ul></p>";
$output .= "<p>The content of the site can be almost entirely altered through ". l("<i>custom blocks</i>", "admin/block/add") .". Simply put, custom blocks are small bits of text, HTML or PHP code which will get plugged into the site just like any other block.</p>";
$output .= "<p>Each custom block consists of a title, a description, and a body of text, HTML, or PHP code which can be as long as you wish. The Drupal engine will 'render' the content of the custom block.</p>";
$output .= "<h3>PHP in custom blocks</h3><p>If you know how to script in PHP, PHP custom blocks are easy to create. But don't worry if you're no PHP-wizard: simply use HTML instead.</p>";
$output .= "<p>You can use any piece of PHP code to make up the content of a PHP custom block: this implies that you can declare and use functions, consult the SQL database, access configuration settings and much more. A PHP custom blocks' code is stored in the database and the engine will dynamically embed the PHP code just-in-time for execution.</p>";
$output .= "<p>There are however some factors to keep in mind when using and creating PHP custom blocks: PHP custom blocks can be extremely useful and flexible, yet they can be dangerous and insecure if not properly used. If you are not familiar with PHP, SQL or with the site engine, avoid experimenting with PHP custom blocks because you can - and probably will - corrupt your database or render your site unusable! If you don't plan to do fancy stuff with custom blocks then you're probably better off with HTML.</p>";
$output .= "<p>Remember that the code within each PHP custom block must be valid PHP code -- including things like correctly terminating statements with a semicolon so that the parser won't die. It is highly recommended that you develop your custom blocks separately using a simple test script on top of a test database before migrating to your production environment.</p>";
$output .= "<p>Note:<br /><ul><li>You can use global variables, such as configuration parameters, within the scope of a PHP box but remember that variables which have been given values in a PHP box will retain these values in the engine or module afterwards.</li><li>register_globals is now set to <b>off</b>. If you need form information you need to get it from the \"superglobals\" \$_POST, \$_GET, etc.</li></ul></p>";
$output .= "<p>You <b>have</b> to use the <code>return</code> statement to return the actual content for your block. You <b>may not</b> <code>print</code> or <code>echo</code> it.</p>";
$output .= "<p><u>A basic example:</u></p>";
$output .= "<p>Given the box with title \"Welcome\", used to create a \"<i>Welcome</i>\" box. The content for this box could be created by using:</p>";
$output .= "<p>Blocks are the boxes visible in the sidebar(s) of your web site. These are usually generated automatically by modules (e.g. recent forum topics), but you can also create your own blocks using either static HTML or dynamic PHP content.</p>";
$output .= "<p>Which sidebar each block appears in depends on which theme you're using (some are left-only, some right, some both), and also on the settings in block management.</p><p>Whether a block is visible in the first place depends on three things:</p><ul><li>It must have its \"enabled\" box checked in block management.</li><li>If it has its \"custom\" box checked in block management, the user must have chosen to display it in their user preferences.</li><li>If the \"path\" field in block management is set, the visitor must be on a page that matches the path specification (more on this later).</li></ul>";
$output .= "<p>The block management screen also lets you specify the vertical sort-order of the blocks within a sidebar. You do this by assigning a <b>weight</b> to each block. Lighter blocks (smaller weight) \"float up\" towards the top of the sidebar. Heavier ones \"sink down\" towards the bottom of it. Once you've positioned things just so, you can preview what the layout will look like in different types of themes by clicking the preview placement link in the menu to the left.</p>";
$output .= "<p>The path setting lets you define on which pages you want a specific block to be shown. If you leave the path blank it will show on all pages. The path uses a regular expression syntax so remember to escape special characters!";
$output .= "<h3>Custom Blocks</h3>";
$output .= "<p>A custom block is a block that contains admin-supplied HTML, text or PHP content (as opposed to being generated automatically by a module). Each custom block consists of a title, a description, and a body of text, HTML, or PHP code which can be as long as you wish. The Drupal engine will 'render' the content of the custom block.</p>";
$output .= "<h4>PHP in custom blocks</h4>";
$output .= "<p>If you know how to script in PHP, Drupal gives you the power to embed any script you like inside a block. It will be executed at page view and dynamically embedded into the page. This gives you amazing flexibility and power, but of course with that comes danger and insecurity if you don't write good code. If you are not familiar with PHP, SQL or with the site engine, avoid experimenting with PHP custom blocks because you can corrupt your database or render your site insecure or even unusable! If you don't plan to do fancy stuff with custom blocks then you're probably better off with straight HTML.</p>";
$output .= "<p>Remember that the code within each PHP custom block must be valid PHP code - including things like correctly terminating statements with a semicolon so that the parser won't die. It is highly recommended that you develop your cusom blocks separately using a simple test script on top of a test database before migrating to your production environment.</p>";
$output .= "<p>Notes:</p><ul><li>You can use global variables, such as configuration parameters, within the scope of a PHP box but remember that variables which have been given values in a PHP box will retain these values in the engine or module afterwards.</li><li>register_globals is now set to <b>off</b> by default. If you need form information you need to get it from the \"superglobals\" \$_POST, \$_GET, etc.</li><li>You can use the <code>return</code> statement to return the actual content for your block as well.</li></ul>";
$output .= "<p>A basic example:</p>";
$output .= "<blockquote><p>You want to have a box with the title \"Welcome\" that you use to greet your visitors. The content for this box could be created by going:</p>";
$output .= "<pre>
return t(\"Welcome visitor, ... welcome message goes here ...\");
</pre>";
......@@ -27,8 +24,8 @@ function block_help() {
}
else {
return t(\"Welcome visitor, ... welcome message goes here ...\");
}
</pre>";
}";
$output .= "</pre></blockquote>";
$output .= "<p>For more in-depth examples, we recommend that you check the existing boxes and use them as a starting point.</p>";
return t($output);
......@@ -45,9 +42,9 @@ function block_perm() {
function block_link($type) {
if ($type == "admin" && user_access("administer blocks")) {
$help["block"] = t("Blocks are the boxes visible in the side bars on the left- and right-hand side of the web site, depending on the chosen theme. They are created by <b>active</b> Drupal modules. In order to view a block it must be enabled, then you can assign the block's placement by giving it a region and/or a weight within that region. This sorts them vertically, the smaller the weight, the lighter the block and it will \"float\" towards the top of the page. The path setting is a mask which lets you define on which pages you want the specific block to be shown. The custom checkbox tells Drupal to use a custom designed block, see both <a href=\"%help\">help</a> and <a href=\"%block\">create new block</a> for more information on custom blocks. If you have a custom block then the \"edit\" and \"delete\" operations will be displayed to edit/delete your custom block.", array("%help" => url("admin/block/help"), "%block" => url("admin/block/add")));
$help["create"] = t("Below you can create a block to be used in the side bars. Once you have created this block you must make it active, and give it a place on the page by using <a href=\"%overview\">block management</a>. The title is used when displaying the block. The description is used in the \"block\" column on the <a href=\"%overview\">block management</a> page. If you are going to place PHP code in the block, and you have <b>create PHP content</b> permission (see <a href=\"%permission\">user management >> user permissions</a>) you <b>must</b> change the type to PHP to make your code active.", array("%overview" => url("admin/block"), "%permission" => url("admin/user/permission")));
$help["preview"] = t("This page shows you the placement of your blocks. Each block is represented by its block name, and it's weight. <b>Layout scheme #1</b> is a layout with both left and right columns. <b>Layout scheme #2</b> has only a right column. And <b>layout scheme #3</b> only a left column.");
$help["block"] = t("Blocks are the boxes visible in the side bars on the left- and right-hand side of the web site, depending on the choosen theme. They are created by <b>active</b> Drupal modules. In order to view a block it must be enabled. You can assign the block's placement by giving it a region and a weight. The region specifies which side of the page the block is on, and the weight sorts blocks within a region. Lighter (smaller weight value) blocks \"float up\" towards the top of the page. The path setting is a mask which lets you define on which pages you want the specific block to be shown. The custom checkbox lets your users hide the block from their account setting page. You can also create your own blocks, where you specify the content of the block rather than it being generated by a module (you can even use PHP in these). You can create one of these by clicking the %createblock link in the menu to the left. Edit and delete links will become active below for these customized blocks.", array("%createblock" => l(t("create new block"), "admin/block/add")));
$help["create"] = t("Here you can create a custom content block. Once you have created this block you must make it active, and give it a place on the page using <a href=\"%overview\">block management</a>. The title is used when displaying the block. The description is used in the \"block\" column on the <a href=\"%overview\">block management</a> page. If you are going to place PHP code in the block, and you have <b>create PHP content</b> permission (see <a href=\"%permission\">user management >> user permissions</a>) you <B>must</b> change the type to PHP to make your code active.", array("%overview" => url("admin/block"), "%permission" => url("admin/user/permission")));
$help["preview"] = t("This page helps show you the placement of your blocks in different themes. The numbers are the weight of each block, which is used to sort them within the sidebars.");
menu("admin/block", "block management", "block_admin", $help["block"], 3);
menu("admin/block/add", "create new block", "block_admin", $help["create"], 2);
......@@ -179,7 +176,7 @@ function block_admin_preview() {
}
$rblocks .= "</table>\n";
$output .= "<h3>layout scheme #1:</h3>\n";
$output .= "<h3>". t("Themes with both left and right sidebars") .":</h3>\n";
$output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n";
$output .= " <tr><td align=\"center\" colspan=\"3\">header</td></tr>\n";
$output .= " <tr><td>\n". ($lblocks ? $lblocks : "&nbsp;") ."</td><td width=\"300\">&nbsp;</td><td>\n". ($rblocks ? $rblocks : "&nbsp;") ."</td></tr>\n";
......@@ -195,14 +192,14 @@ function block_admin_preview() {
}
$blocks .= "</table>\n";
$output .= "<h3>layout scheme #2:</h3>\n";
$output .= "<h3>". t("Themes with right-sidebar only") .":</h3>\n";
$output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n";
$output .= " <tr><td align=\"center\" colspan=\"2\">header</td></tr>\n";
$output .= " <tr><td width=\"400\">&nbsp;</td><td>\n". ($blocks ? $blocks : "&nbsp;") ."</td></tr>\n";
$output .= " <tr><td align=\"center\" colspan=\"2\">footer</td></tr>\n";
$output .= "</table>\n";
$output .= "<h3>layout scheme #3:</h3>\n";
$output .= "<h3>". t("Themes with left-sidebar only") .":</h3>\n";
$output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n";
$output .= " <tr><td align=\"center\" colspan=\"2\">header</td></tr>\n";
$output .= " <tr><td>\n". ($blocks ? $blocks : "&nbsp;") ."</td><td width=\"400\">&nbsp;</td></tr>\n";
......
......@@ -369,9 +369,9 @@ function _forum_topics_read($uid) {
}
function _forum_last_post($term) {
$topic = db_fetch_object(db_query_range("SELECT n.nid, n.created AS timestamp, u.name AS name, u.uid AS uid FROM forum f, node n LEFT JOIN users u ON n.uid = u.uid WHERE f.tid = %d AND n.nid = f.nid AND n.type = 'forum' AND n.status = 1 ORDER BY timestamp DESC", $term, 0, 1));
$topic = db_fetch_object(db_query_range("SELECT n.nid, n.created AS timestamp, u.name AS name, u.uid AS uid FROM forum f LEFT JOIN node n ON n.nid = f.nid LEFT JOIN users u ON n.uid = u.uid WHERE f.tid = %d AND n.nid = f.nid AND n.type = 'forum' AND n.status = 1 ORDER BY timestamp DESC", $term, 0, 1));
$reply = db_fetch_object(db_query_range("SELECT n.nid, c.timestamp, u.name AS name, u.uid AS uid FROM forum f, node n LEFT JOIN comments c ON n.nid = c.nid LEFT JOIN users u ON c.uid = u.uid WHERE f.tid = %d AND n.nid = f.nid AND n.type = 'forum' AND n.status = 1 AND c.status = 0 ORDER BY c.timestamp DESC", $term, 0, 1));
$reply = db_fetch_object(db_query_range("SELECT n.nid, c.timestamp, u.name AS name, u.uid AS uid FROM forum f LEFT JOIN node n ON n.nid = f.nid LEFT JOIN comments c ON n.nid = c.nid LEFT JOIN users u ON c.uid = u.uid WHERE f.tid = %d AND n.nid = f.nid AND n.type = 'forum' AND n.status = 1 AND c.status = 0 ORDER BY c.timestamp DESC", $term, 0, 1));
$value = ($topic->timestamp > $reply->timestamp) ? $topic : $reply;
......@@ -451,9 +451,9 @@ function _forum_message_taxonomy() {
function forum_page() {
global $sortby, $forum_per_page, $from, $user;
$op = $_POST["op"];
if (user_access("access content")) {
if (module_exist("taxonomy")) {
$tid = arg(1);
......@@ -466,7 +466,7 @@ function forum_page() {
drupal_goto(url("node/view/$nid"));
}
}
if (empty($sortby)) {
$sortby = isset($user->sortby) ? $user->sortby : variable_get("forum_order",1);
}
......
......@@ -369,9 +369,9 @@ function _forum_topics_read($uid) {
}
function _forum_last_post($term) {
$topic = db_fetch_object(db_query_range("SELECT n.nid, n.created AS timestamp, u.name AS name, u.uid AS uid FROM forum f, node n LEFT JOIN users u ON n.uid = u.uid WHERE f.tid = %d AND n.nid = f.nid AND n.type = 'forum' AND n.status = 1 ORDER BY timestamp DESC", $term, 0, 1));
$topic = db_fetch_object(db_query_range("SELECT n.nid, n.created AS timestamp, u.name AS name, u.uid AS uid FROM forum f LEFT JOIN node n ON n.nid = f.nid LEFT JOIN users u ON n.uid = u.uid WHERE f.tid = %d AND n.nid = f.nid AND n.type = 'forum' AND n.status = 1 ORDER BY timestamp DESC", $term, 0, 1));
$reply = db_fetch_object(db_query_range("SELECT n.nid, c.timestamp, u.name AS name, u.uid AS uid FROM forum f, node n LEFT JOIN comments c ON n.nid = c.nid LEFT JOIN users u ON c.uid = u.uid WHERE f.tid = %d AND n.nid = f.nid AND n.type = 'forum' AND n.status = 1 AND c.status = 0 ORDER BY c.timestamp DESC", $term, 0, 1));
$reply = db_fetch_object(db_query_range("SELECT n.nid, c.timestamp, u.name AS name, u.uid AS uid FROM forum f LEFT JOIN node n ON n.nid = f.nid LEFT JOIN comments c ON n.nid = c.nid LEFT JOIN users u ON c.uid = u.uid WHERE f.tid = %d AND n.nid = f.nid AND n.type = 'forum' AND n.status = 1 AND c.status = 0 ORDER BY c.timestamp DESC", $term, 0, 1));
$value = ($topic->timestamp > $reply->timestamp) ? $topic : $reply;
......@@ -451,9 +451,9 @@ function _forum_message_taxonomy() {
function forum_page() {
global $sortby, $forum_per_page, $from, $user;
$op = $_POST["op"];
if (user_access("access content")) {
if (module_exist("taxonomy")) {
$tid = arg(1);
......@@ -466,7 +466,7 @@ function forum_page() {
drupal_goto(url("node/view/$nid"));
}
}
if (empty($sortby)) {
$sortby = isset($user->sortby) ? $user->sortby : variable_get("forum_order",1);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment