Poll

What do you think about this  hack ?

Great! i want the same at home.
I like the idea.
I like the idea but not the realization.
I do not like this idea.
It is very bad.

Author Topic: [HACK] Many More colors with only ONE template  (Read 60304 times)

0 Members and 1 Guest are viewing this topic.

Offline impss

  • Sr. Member
  • ****
  • Posts: 382
    • View Profile
    • Cusstom.net
Re: [HACK] Many More colors with only ONE template
« Reply #30 on: September 29, 2005, 10:19:15 PM »
i get

http://www.cusstom.com/4images/
Warning: Cannot modify header information - headers already sent by (output started at C:\CuSStom.com\www\4images\send_design.php:4) in C:\CuSStom.com\www\4images\send_design.php on line 6


Offline ch€ri{Bi}²

  • Sr. Member
  • ****
  • Posts: 315
  • A PRoBLeM wIthOUt SoLuTioN Is NoT rEAllY a PRoBLeM
    • View Profile
    • Pat's Gallery
Re: [HACK] Many More colors with only ONE template
« Reply #31 on: September 29, 2005, 10:29:01 PM »
all these codes works for me  :oops:
check that you let no space (or a new line) at the end of the file after ?>
ch€ri{Bi}²


Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [HACK] Many More colors with only ONE template
« Reply #32 on: September 30, 2005, 12:05:23 AM »
@v@no, not sure to understand :
1 - what do you mean by IMO?
2 - and why all cookie set should be done in global.php : I did not see any cookie declared in my global.php file and i know that some mod uses cookies. is there a specific file where to declare the cookies?
1)  IMO = In My Oppinion
2) global.php being executed by any 4images pages. That's why if you do all needed cookie set in global.php you can use $self_url in the form:
Code: [Select]
$multi_color = "\n<form name=\"colorname\" method=\"post\" action=\"".$self_url."\"><select name=\"color\" >\n";By doing that, it will "refresh" the current page no mwork on 9 pages out of 10. (some restrictions apply, such as $mode or such variable might not be avalable through $self_url)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline ch€ri{Bi}²

  • Sr. Member
  • ****
  • Posts: 315
  • A PRoBLeM wIthOUt SoLuTioN Is NoT rEAllY a PRoBLeM
    • View Profile
    • Pat's Gallery
Re: [HACK] Many More colors with only ONE template
« Reply #33 on: September 30, 2005, 12:23:36 AM »
@all : thanks for your answers  8) I usually do not speak English and there are subtleties which I do not know

@ impss
it seems you got problems with paramters in the url  :?

try this 2 urls (COPY AND PASTE):
Quote
http://www.cusstom.com/4images/send_design.php?color=style
and after refresh your home page, style is applyed
then try:
Quote
http://www.cusstom.com/4images/send_design.php?color=style2
return to your home page and you will see the switch is working (style2 is applied) but still got JS errors (try to comment ALL lines with JS : everything should work with only PHP)

Note : I found why the code didn't work with my browser Opera   :arrow: there is a menu to enable/disable referrer logging  :wink:
ch€ri{Bi}²


Offline ch€ri{Bi}²

  • Sr. Member
  • ****
  • Posts: 315
  • A PRoBLeM wIthOUt SoLuTioN Is NoT rEAllY a PRoBLeM
    • View Profile
    • Pat's Gallery
Re: [HACK] Many More colors with only ONE template
« Reply #34 on: October 01, 2005, 02:01:14 AM »
Major update of original code

since there were problems with send_design.php file, I removed it.

no regrets  :arrow:  all the corresponding code is in the page_header.php file and now the code of the MOD is closer to 4images original code 
no JS and no redirection 8)
ch€ri{Bi}²


Offline impss

  • Sr. Member
  • ****
  • Posts: 382
    • View Profile
    • Cusstom.net
Re: [HACK] Many More colors with only ONE template
« Reply #35 on: October 01, 2005, 02:28:41 AM »
Great job!!

Working Perfect now 8)

http://www.cusstom.com/4images/index.php

Now just gotta make come sytle sheets for my gallery

Thanks cheribibi, I appreciate the work!!  :D

Offline ch€ri{Bi}²

  • Sr. Member
  • ****
  • Posts: 315
  • A PRoBLeM wIthOUt SoLuTioN Is NoT rEAllY a PRoBLeM
    • View Profile
    • Pat's Gallery
Re: [HACK] Many More colors with only ONE template
« Reply #36 on: October 01, 2005, 02:37:22 AM »
well don't forget change the following value  to your default style without the extension:
Quote
$design = isset($HTTP_COOKIE_VARS[$cookie_name.'design']) ? unserialize(stripslashes($HTTP_COOKIE_VARS[$cookie_name.'design'])) : "css_blue";
css_blue is my default stylesheet without the extension.

without that the visitors will have no stylesheet with their first visit until they choose a new style  :roll:


have fun  :wink:
ch€ri{Bi}²


Offline impss

  • Sr. Member
  • ****
  • Posts: 382
    • View Profile
    • Cusstom.net
Re: [HACK] Many More colors with only ONE template
« Reply #37 on: October 01, 2005, 02:42:07 AM »
well don't forget change the following value  to your default style without the extension:
Quote
$design = isset($HTTP_COOKIE_VARS[$cookie_name.'design']) ? unserialize(stripslashes($HTTP_COOKIE_VARS[$cookie_name.'design'])) : "css_blue";

without that the visitors will have no stylesheet with their first visit until they choose a new style  :roll:


have fun  :wink:

Yea i just did that, noticed it when i tested it out in Firefox and Opera
Thanks again

Offline JensF

  • Addicted member
  • ******
  • Posts: 1.028
    • View Profile
    • http://www.terraristik-galerie.de
Re: [HACK] Many More colors with only ONE template
« Reply #38 on: November 07, 2005, 08:36:33 PM »
Hello,

a Great Mod but i have one Problem. I have installed this Mod (Cache Mod) and when i change the color i can´t see it. The cache is active.

Is there a way to clear the cache before change the color???

I mean, i change the color and before it where load the cache where cleared...


And now i have another Problem. When i disable the CAche Mod this Mod works but now for the start Page. When i click to a categorie i have my standard style...
Mit freundlichem Gruß
Jens Funk



-> Sorry for my bad English <-

Offline Acidgod

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 2.421
  • It's me?
    • View Profile
    • Flash-Webdesign
Re: [HACK] Many More colors with only ONE template
« Reply #39 on: November 07, 2005, 09:35:39 PM »
Quote
if (isset($HTTP_POST_VARS['design'])) {
  $design = $HTTP_POST_VARS['design'];
 
  $site_sess->set_session_var("design", $design);
  $session_info['design'] = $design;

  $cookie_expire = time() + 60 * 60 * 24 * 90;
  setcookie($cookie_name.'design', serialize($design), $cookie_expire, COOKIE_PATH, COOKIE_DOMAIN, COOKIE_SECURE);

   @set_time_limit(0);
   clear_cache();


}

Habe es nicht getestet aber versuche das doch mal...

Offline JensF

  • Addicted member
  • ******
  • Posts: 1.028
    • View Profile
    • http://www.terraristik-galerie.de
Re: [HACK] Many More colors with only ONE template
« Reply #40 on: November 07, 2005, 09:47:10 PM »
Hi,

vielen Dank. Scheint zu funktionieren. Cache ist wieder an und ich kann das Style ändern. Leider habe ich aber immer noch mein 2tes Problem und natürlich mal wieder keine Ahnung woran das liegt.

Und zwar kann ich das Style ändern und es wird mir dann auf der Startseite angezeigt. Klicke ich jetzt aber auf eine Kategorie oder ein Bild dann habe ich plötzlich wieder mein Standard Style. Und auch wenn ich dann wieder zur Startseite gehe ist wieder der Standard drin.

Kannst du da vielleicht auch helfen???


--------------------------------------------------------

My Problem. When i change the color i see the start page in the new color but when i click a categorie now i have the standard......
Mit freundlichem Gruß
Jens Funk



-> Sorry for my bad English <-

Offline Acidgod

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 2.421
  • It's me?
    • View Profile
    • Flash-Webdesign
Re: [HACK] Many More colors with only ONE template
« Reply #41 on: November 07, 2005, 10:15:42 PM »
Ich denke das ist ein Cookie Problem, haste die Cookie bei dir deaktiviert?

Offline JensF

  • Addicted member
  • ******
  • Posts: 1.028
    • View Profile
    • http://www.terraristik-galerie.de
Re: [HACK] Many More colors with only ONE template
« Reply #42 on: November 07, 2005, 10:22:34 PM »
Ich denke das ist ein Cookie Problem, haste die Cookie bei dir deaktiviert?

Ne, Cookies sind eigentlich aktiviert. Bleibe ja auch eingeloggt wenn ich die Seite neu aufrufe nachdem ich den Browser geschlossen habe.

Das komische ist das sich nun etwas geändert hat. Wenn ich zur Startseite zurückkehre dann habe ich immer noch mein eingestelltes Style. Nur wenn ich halt irgendwas anderes aufrufe wird mir wieder der Standard angezeigt.

Teste es doch bitte mal kurz. Seite ist http://www.terraristik-galerie.de . Dort kannst du das Style ändern und dann klicke mal eine Kategorie. Dann siehst du was ich meine. Und wenn du dann wieder zum Start zurückkehrst ist das ausgewählte Style wieder da...
Mit freundlichem Gruß
Jens Funk



-> Sorry for my bad English <-

Offline Acidgod

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 2.421
  • It's me?
    • View Profile
    • Flash-Webdesign
Re: [HACK] Many More colors with only ONE template
« Reply #43 on: November 07, 2005, 10:33:29 PM »
war das den auch schon der fall bevor wir das cache lerren eingebaut haben?

Offline JensF

  • Addicted member
  • ******
  • Posts: 1.028
    • View Profile
    • http://www.terraristik-galerie.de
Re: [HACK] Many More colors with only ONE template
« Reply #44 on: November 07, 2005, 10:54:01 PM »
war das den auch schon der fall bevor wir das cache lerren eingebaut haben?

Ja, da war das selbe Problem. Hatte die Cache Funktion ja auch mal deaktiviert und da war das dann auch.

Habe eben mal in meinem Cookie Ordner geschaut und wie es scheint wird doch kein Cookie angelegt.
Wenn ich den Code richtig verstehe sollte ja ein Cookie mit dem Namen 4images_ angelegt werden.

Code: [Select]
$cookie_name = (defined("COOKIE_NAME")) ? COOKIE_NAME : "4images_";
Allerdings habe ich keinen Cookie der mit 4images_ anfängt....
Mit freundlichem Gruß
Jens Funk



-> Sorry for my bad English <-