Welcome to Geeklog, Anonymous Sunday, December 22 2024 @ 08:50 pm EST
Geeklog Forums
Where to find the source for Theme tester?
Status: offline
etegration
Forum User
Full Member
Registered: 02/20/02
Posts: 179
I found this page has it but it seems it's being processed and not showing all the source code.
http://www.etegration.com.sg
http://www.itcow.com
http://www.ministryofhosting.com
http://www.etegration.com.sg
http://www.itcow.com
http://www.ministryofhosting.com
31
34
Quote
Status: offline
Dirk
Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
The code from this story should work.
bye, Dirk
22
18
Quote
Anonymous
Anonymous
which code do you exactly mean? Do i have to edit the lib-common.php
file for geeklog version 1.3.6, too?
Thx!
28
17
Quote
Nic
Anonymous
Hi,
I am using Geeklog 1.3.8 and I would like to install the Theme Tester Blcok.
I have searched high and low, in the forums, tried installing some code but it all seems to be from 2002 or outdated.
Anyone know how I can install the Theme Tester Block?
Many thanks,
Nic.
I am using Geeklog 1.3.8 and I would like to install the Theme Tester Blcok.
I have searched high and low, in the forums, tried installing some code but it all seems to be from 2002 or outdated.
Anyone know how I can install the Theme Tester Block?
Many thanks,
Nic.
19
21
Quote
Status: offline
Turias
Forum User
Full Member
Registered: 10/20/03
Posts: 807
That story link doesn't seem to work, so I'll post the code I have in my lib-custom.php. I'm not sure who originally wrote it, so if that person would like credit or if they would like me to remove it and instead point to a different page, please let me know.
{
global $PHP_SELF, $HTTP_POST_VARS, $HTTP_GET_VARS, $_TABLES, $_USER, $_CONF;
$thememode = $HTTP_GET_VARS['thememode'];
if ($thememode == 'save') {
$usetheme = $HTTP_GET_VARS['usetheme'];
} else {
$usetheme = $HTTP_POST_VARS['usetheme'];
}
if ($_USER['uid'] > 1 AND $thememode == 'save' AND !empty($usetheme)) {
DB_query("UPDATE {$_TABLES['users']} SET theme='$usetheme' WHERE uid = {$_USER['uid']}");
echo COM_refresh($PHP_SELF);
}
$themes = COM_getThemes();
if (count($themes) == 1) {
return 'Sorry, there is only one theme installed on this system';
}
$retval .= 'Test out available themes by selecting one below:<br>';
$retval .= '<form action="' . $PHP_SELF . '" method="POST"><select name="usetheme" onChange="this.form.submit()">';
$retval .= '<option value="">--</option>';
for ($i = 1; $i <= count($themes); $i++) {
$retval .= '<option value="' . current($themes);
if ($usetheme == current($themes)) {
$retval .= ' selected="SELECTED"';
}
$retval .= '">' . current($themes) . '</option>';
next($themes);
}
if ($_USER['uid'] > 1 AND !empty($usetheme)) {
$args = 'thememode=save&usetheme=' . $usetheme;
for ($i = 1; $i <= count($HTTP_GET_VARS); $i++) {
if (key($HTTP_GET_VARS) <> 'thememode' AND key($HTTP_GET_VARS) <> 'usetheme') {
$args .= '&' . key($HTTP_GET_VARS) . '=' . urlencode(current($HTTP_GET_VARS));
}
next($HTTP_GET_VARS);
}
$retval .= '</select></form></center><a href="' . $PHP_SELF . '?' . $args . '">Use Permanently</a>';
} else {
$retval .= '</select></form></center></a>';
}
return $retval;
}
Text Formatted Code
function phpblock_themetester(){
global $PHP_SELF, $HTTP_POST_VARS, $HTTP_GET_VARS, $_TABLES, $_USER, $_CONF;
$thememode = $HTTP_GET_VARS['thememode'];
if ($thememode == 'save') {
$usetheme = $HTTP_GET_VARS['usetheme'];
} else {
$usetheme = $HTTP_POST_VARS['usetheme'];
}
if ($_USER['uid'] > 1 AND $thememode == 'save' AND !empty($usetheme)) {
DB_query("UPDATE {$_TABLES['users']} SET theme='$usetheme' WHERE uid = {$_USER['uid']}");
echo COM_refresh($PHP_SELF);
}
$themes = COM_getThemes();
if (count($themes) == 1) {
return 'Sorry, there is only one theme installed on this system';
}
$retval .= 'Test out available themes by selecting one below:<br>';
$retval .= '<form action="' . $PHP_SELF . '" method="POST"><select name="usetheme" onChange="this.form.submit()">';
$retval .= '<option value="">--</option>';
for ($i = 1; $i <= count($themes); $i++) {
$retval .= '<option value="' . current($themes);
if ($usetheme == current($themes)) {
$retval .= ' selected="SELECTED"';
}
$retval .= '">' . current($themes) . '</option>';
next($themes);
}
if ($_USER['uid'] > 1 AND !empty($usetheme)) {
$args = 'thememode=save&usetheme=' . $usetheme;
for ($i = 1; $i <= count($HTTP_GET_VARS); $i++) {
if (key($HTTP_GET_VARS) <> 'thememode' AND key($HTTP_GET_VARS) <> 'usetheme') {
$args .= '&' . key($HTTP_GET_VARS) . '=' . urlencode(current($HTTP_GET_VARS));
}
next($HTTP_GET_VARS);
}
$retval .= '</select></form></center><a href="' . $PHP_SELF . '?' . $args . '">Use Permanently</a>';
} else {
$retval .= '</select></form></center></a>';
}
return $retval;
}
19
14
Quote
Nic
Anonymous
Thank you, it works!!
25
20
Quote
Status: offline
Dirk
Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by Turias: I'm not sure who originally wrote it, so if that person would like credit or if they would like me to remove it and instead point to a different page, please let me know.
The original theme tester was written by Tony (see this post). I think that's the one you have there.
If you see a version that tests for a variety of browsers - that was written by Squatty.
All the others that are floating around are merely variations of these two, AFAIK. The one we currently have of geeklog.net is also a variation of Squatty's version.
bye, Dirk
17
18
Quote
Status: offline
daynah
Forum User
Newbie
Registered: 07/03/02
Posts: 9
Thanks for the post Turias! I've been looking all over for the theme tester block.
The one on this page had an error or two.
http://php-princess.net
The one on this page had an error or two.
http://php-princess.net
22
24
Quote
Status: offline
young_dfler
Forum User
Newbie
Registered: 08/23/06
Posts: 3
Quote by Turias: That story link doesn't seem to work, so I'll post the code I have in my lib-custom.php. I'm not sure who originally wrote it, so if that person would like credit or if they would like me to remove it and instead point to a different page, please let me know.
{
global $PHP_SELF, $HTTP_POST_VARS, $HTTP_GET_VARS, $_TABLES, $_USER, $_CONF;
$thememode = $HTTP_GET_VARS['thememode'];
if ($thememode == 'save') {
$usetheme = $HTTP_GET_VARS['usetheme'];
} else {
$usetheme = $HTTP_POST_VARS['usetheme'];
}
if ($_USER['uid'] > 1 AND $thememode == 'save' AND !empty($usetheme)) {
DB_query("UPDATE {$_TABLES['users']} SET theme='$usetheme' WHERE uid = {$_USER['uid']}");
echo COM_refresh($PHP_SELF);
}
$themes = COM_getThemes();
if (count($themes) == 1) {
return 'Sorry, there is only one theme installed on this system';
}
$retval .= 'Test out available themes by selecting one below:<br>';
$retval .= '<form action="' . $PHP_SELF . '" method="POST"><select name="usetheme" onChange="this.form.submit()">';
$retval .= '<option value="">--</option>';
for ($i = 1; $i <= count($themes); $i++) {
$retval .= '<option value="' . current($themes);
if ($usetheme == current($themes)) {
$retval .= ' selected="SELECTED"';
}
$retval .= '">' . current($themes) . '</option>';
next($themes);
}
if ($_USER['uid'] > 1 AND !empty($usetheme)) {
$args = 'thememode=save&usetheme=' . $usetheme;
for ($i = 1; $i <= count($HTTP_GET_VARS); $i++) {
if (key($HTTP_GET_VARS) <> 'thememode' AND key($HTTP_GET_VARS) <> 'usetheme') {
$args .= '&' . key($HTTP_GET_VARS) . '=' . urlencode(current($HTTP_GET_VARS));
}
next($HTTP_GET_VARS);
}
$retval .= '</select></form></center><a href="' . $PHP_SELF . '?' . $args . '">Use Permanently</a>';
} else {
$retval .= '</select></form></center></a>';
}
return $retval;
}
Text Formatted Code
function phpblock_themetester(){
global $PHP_SELF, $HTTP_POST_VARS, $HTTP_GET_VARS, $_TABLES, $_USER, $_CONF;
$thememode = $HTTP_GET_VARS['thememode'];
if ($thememode == 'save') {
$usetheme = $HTTP_GET_VARS['usetheme'];
} else {
$usetheme = $HTTP_POST_VARS['usetheme'];
}
if ($_USER['uid'] > 1 AND $thememode == 'save' AND !empty($usetheme)) {
DB_query("UPDATE {$_TABLES['users']} SET theme='$usetheme' WHERE uid = {$_USER['uid']}");
echo COM_refresh($PHP_SELF);
}
$themes = COM_getThemes();
if (count($themes) == 1) {
return 'Sorry, there is only one theme installed on this system';
}
$retval .= 'Test out available themes by selecting one below:<br>';
$retval .= '<form action="' . $PHP_SELF . '" method="POST"><select name="usetheme" onChange="this.form.submit()">';
$retval .= '<option value="">--</option>';
for ($i = 1; $i <= count($themes); $i++) {
$retval .= '<option value="' . current($themes);
if ($usetheme == current($themes)) {
$retval .= ' selected="SELECTED"';
}
$retval .= '">' . current($themes) . '</option>';
next($themes);
}
if ($_USER['uid'] > 1 AND !empty($usetheme)) {
$args = 'thememode=save&usetheme=' . $usetheme;
for ($i = 1; $i <= count($HTTP_GET_VARS); $i++) {
if (key($HTTP_GET_VARS) <> 'thememode' AND key($HTTP_GET_VARS) <> 'usetheme') {
$args .= '&' . key($HTTP_GET_VARS) . '=' . urlencode(current($HTTP_GET_VARS));
}
next($HTTP_GET_VARS);
}
$retval .= '</select></form></center><a href="' . $PHP_SELF . '?' . $args . '">Use Permanently</a>';
} else {
$retval .= '</select></form></center></a>';
}
return $retval;
}
Where do we enter this code?
20
20
Quote
Status: offline
Dirk
Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by young_dfler: Where do we enter this code?
Into your lib-custom.php
Also see What are the different block types for?
bye, Dirk
28
16
Quote
young_dfler
Anonymous
Quote by Dirk:
Into your lib-custom.php
Also see What are the different block types for?
bye, Dirk
Quote by young_dfler: Where do we enter this code?
Into your lib-custom.php
Also see What are the different block types for?
bye, Dirk
I am still having troubles. I tried putting the content above into a new block's content, however when I paste the script, all that comes out is the same code. Help.
18
21
Quote
young_dfler
Anonymous
Quote by Dirk: You may want to actually read what I wrote above ... The code is supposed to go into your lib-custom.php, not into the block.
byem Dirk
byem Dirk
Where is the lib-custom.php?
15
16
Quote
young_dfler
Anonymous
Quote by Dirk: /path/to/geeklog/system/lib-custom.php
bye, Dirk
bye, Dirk
Can somone please put a detailed step to step. I have no idea what this is. It makes me not want to use Geeklog. HELOP
20
13
Quote
Status: offline
young_dfler
Forum User
Newbie
Registered: 08/23/06
Posts: 3
I still don't understand this whole block thing. If someone can please help. I am a noob. PLease help.
15
14
Quote
All times are EST. The time is now 08:50 pm.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content