Author Topic: vbulletin header und global...  (Read 12680 times)

0 Members and 1 Guest are viewing this topic.

Offline Patt

  • Pre-Newbie
  • Posts: 8
    • View Profile
vbulletin header und global...
« on: January 15, 2003, 02:56:48 PM »
Hallo,

ich habe das 4images in mein vbulletin v. 2.2.6 integriert! läuft soweit sehr gut.
Nur ein paar Dinge stören noch:
1) wenn ich mich anmelden möchte, dann öffnet sich immer ein Fenster wo ich Benutzername und Kennwort eingeben soll, jedoch ohne Erfolg!??

2) wie kann ich die global.php von vbulletin integrieren, damit die Variablen vom forum auch in den templates von 4images funktionieren?
oder ist hierfür was anderes zu tun?

Danke für jede Hilfe!

btw, tolles Programm! und vor allem super gemacht bezüglich Installation, Administration etc..

Grüße

Uii ich glaube ich bin im falschen Forum gelandet, Sorry!!!

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
vbulletin header und global...
« Reply #1 on: January 16, 2003, 10:41:07 AM »
1. Hast Du das Template user_loginform.html ersetzt?

2. Welche Variablen brauchst Du denn? Wenn die die global.php einfach inkludieren würdest, würde z.B. ein zweite Datenbankverbindung geöffnet, die vBulletin Session gestartet etc. Ist dann ne ziemliche Resourcenverschwendung.

Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline Patt

  • Pre-Newbie
  • Posts: 8
    • View Profile
vbulletin header und global...
« Reply #2 on: January 16, 2003, 12:46:30 PM »
Hi Jan,

also ich habe das login template ersetzt!? Wie ist es denn ausserdem mit dem registrierungslink? den sollte man doch dann besser entfernen, wenn sich alle User übers Forum anmelden sollen, oder?

Ich habe bei mir ein Jacascript Menü installiert! Es heisst XMenu. und das funktioniert eben nicht ;)

Grüße

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
vbulletin header und global...
« Reply #3 on: January 16, 2003, 11:27:45 PM »
Der Registrierungslink sollte auf das Forum zeigen. Wenn nicht, hast Du was falsch gemacht.

Falls Du den Loginvorgang übers Control Panel meinst, der funktioniert leider nicht mehr. Man muss sich über die Galerie einloggen und dann durch den Link am Fußende der Seite ins CP gehen.

Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline Patt

  • Pre-Newbie
  • Posts: 8
    • View Profile
vbulletin header und global...
« Reply #4 on: January 20, 2003, 06:06:18 PM »
Hi Jan,

also wie gesagt, ich habe ein Javascript Menue installiert! Dies greift eben auf die globals.php des vb zu.

Ohne Navigation binich aufgeschmissen :)

den Hack findest du hier, falls du sehen musst, wie es funzt:
-> http://www.vbulletin.org/forum/showthread.php?s=&threadid=34731&highlight=xmenu

Grüße

Offline Patt

  • Pre-Newbie
  • Posts: 8
    • View Profile
vbulletin header und global...
« Reply #5 on: January 20, 2003, 09:47:21 PM »
Hi Jan,

ich habe mir die Installationsanleitung des menues nochmal genauer angeschaut! Man muss in vb lediglich 4 templates hinzufügen und dann in globals.php dies tun:

Next part is a small but important hack in "GLOBALS.PHP" is needed to make the templates work.

First look for this line: "// ###################### Start templates #######################"
You can find it around line 248, you are now in the right section of the file.


You also now should see the following 2 lines:

$templatesused.='gobutton,timezone,username_loggedout,username_loggedin,phpinclude,headinclude,header,footer,forumjumpbit,forumjump,nav_linkoff,nav_linkon,navbar,nav_joiner';
$templatesused.=',pagenav,pagenav_curpage,pagenav_firstlink,pagenav_lastlink,pagenav_nextlink,pagenav_pagelink,pagenav_prevlink';


fill in  "xmenu_menustyle,"  before  "headerinclude"
fill in  "xmenu_cssexpr,xmenu_menucode,xmenu_menudef"  before  "header"


A few lines down you should see the following line: "// parse css, header & footer ##################"
This is around line 276



There you change the following lines:

eval("\$headinclude = \"".gettemplate('headinclude')."\";");
eval("\$header .= \"".gettemplate('header')."\";");


into:

eval("\$xmenustyle = \"".gettemplate('xmenu_menustyle')."\";");
eval("\$headinclude = \"".gettemplate('headinclude')."\";");

eval("\$xmenucssexpr = \"".gettemplate('xmenu_cssexpr')."\";");
eval("\$xmenucode = \"".gettemplate('xmenu_menucode')."\";");
eval("\$xmenudef = \"".gettemplate('xmenu_menudef')."\";");
eval("\$header .= \"".gettemplate('header')."\";");


As you can see we have put in 4 extra template evaluations.

Still nothing apears on your pages, for this to happen you now need to edit
2 templates, namely "headinclude" and "header"


In "headinclude" look for the following tag:  </style>
put the variable called $xmenustyle just before that.


In "Header" look for: <!-- toplinks -->
Just below that you find your current menu links or system


On my board i replaced that with the 3 remaining variables which are evaluated templates
with the same name, it looks like this:

<!-- toplinks -->
   $xmenucssexpr
   $xmenucode
   $xmenudef
   <!-- /toplinks -->

IMPORTANT: leave the order as you see it here

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

After this you should see the menusystem with the menudefinition that i left in for you as example

If you just want to use this as soon as posible and don't want experimenting then DON'T edit
xmenu_cssexpr and xmenu_menucode.

Following templates you should edit:
xmenu_menudef   contains all menudefinitions and examples just comment out and change as needed.
xmenu_menustyle contains all coloring for the menu system

***********************************************************
added because i forgot in first place:                     *
                                       *
I have put the 3 used images now in the pack.                  *
just put them in the images directory of the style you install this hack in.   *
***********************************************************


-------------------------------------------------------------------------------------------------------------------------
Success with your menusystem,


Kannst du mir sagen wie ich das in die 4images Dateien bekomme?
Naja die templates auch hier hinzuzufügen ist ja nicht das Problem.
Sondern wo ist der entsprechende Code in der globals.php von 4images.
Ist leider vom Code her anderst geschrieben, da blick ich überhaupt nicht durch!

Wäre super wenn du mir helfen könntest!

Grüße

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
vbulletin header und global...
« Reply #6 on: January 21, 2003, 11:50:25 AM »
Das ist doch alles nur JavaScript Code. Den kannst Du doch ganz einfach ins Template header.html kopieren.

Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline Patt

  • Pre-Newbie
  • Posts: 8
    • View Profile
vbulletin header und global...
« Reply #7 on: January 21, 2003, 03:15:57 PM »
Ja und wie soll das dann gehen? ich habe ja noch 4 templates, wo der Code für das Menü bzw. die Struktur interlegt ist! und im vb mach ich in der global.php den code rein, dass diese templates auch ausgeführt bzw. angezeigt werden.

Wie also soll das alles nur in die header.html gehen?

Danke!

Grüße

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
vbulletin header und global...
« Reply #8 on: January 21, 2003, 04:31:16 PM »
Die Code-Modifikationen an vB sind nur nötig um den JavaScript Code in den Templates anzuzeigen. Alles was Du als Templates in der Datenbank von VB speicherst kannst Du direkt in die Templates von 4images einfügen.

Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline Patt

  • Pre-Newbie
  • Posts: 8
    • View Profile
vbulletin header und global...
« Reply #9 on: January 21, 2003, 06:30:13 PM »
Hi Jan,
du meinst also einfach den Code der 4 templates in das header template von 4images kopieren?

Grüße
 :?:

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
vbulletin header und global...
« Reply #10 on: January 21, 2003, 07:38:54 PM »
Ja
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline Patt

  • Pre-Newbie
  • Posts: 8
    • View Profile
vbulletin header und global...
« Reply #11 on: January 21, 2003, 08:22:24 PM »
Hey Jan,

super funktioniert! War nur etwas schwierig das ganze in die richtige Reihenfolge zu bekommen :)

Dank Dir!!!!


Jetzt habe ich nur noch ein kleines Problem :)
Ich habe in der vb global.php eine Schleife reingemacht, welche in Äbhängigkeit des Users (eingeloggt oder nicht) verschiedene Menüs anzeigt!

Der Code sieht so aus:

Code: [Select]

// parse css, header, vbpopup code & footer ##################
if ($bbuserinfo['userid']==0) {

//neues Menue wenn User nicht eingeloggt
eval("\$xmenustyle = \"".gettemplate('xmenu_menustyle')."\";");
eval("\$headinclude = \"".gettemplate('headinclude')."\";");

eval("\$xmenucssexpr = \"".gettemplate('xmenu_cssexpr')."\";");
eval("\$xmenucode = \"".gettemplate('xmenu_menucode')."\";");
eval("\$xmenudef = \"".gettemplate('xmenu_menudef_loggedout')."\";");
eval("\$header .= \"".gettemplate('header')."\";");

// Ende neues Menue

  eval("\$vbpopup .= \"".gettemplate('vbpopup')."\";");
  eval("\$footer .= \"".gettemplate('footer')."\";");


} else {


//neues Menue wenn User angemeldet ist
//und Links in jedem Forum (Forumhome)

eval("\$xmenustyle = \"".gettemplate('xmenu_menustyle')."\";");
eval("\$headinclude = \"".gettemplate('headinclude')."\";");

eval("\$xmenucssexpr = \"".gettemplate('xmenu_cssexpr')."\";");
eval("\$xmenucode = \"".gettemplate('xmenu_menucode')."\";");
eval("\$xmenudef = \"".gettemplate('xmenu_menudef_loggedin')."\";");
eval("\$header .= \"".gettemplate('header')."\";");

// Ende neues Menue
  eval("\$footer .= \"".gettemplate('footer')."\";");
}



kannst du mir sagen, wie ich das noch reinbekomme, ab dann knutsch ich dich ;)
 :twisted:
Grüße
 :D

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
vbulletin header und global...
« Reply #12 on: January 22, 2003, 03:13:27 PM »
Du kannst in den Templates folgendes verwenden.
Code: [Select]
{if user_loggedin}
  User ist eingeloggt
{endif user_loggedin}

{if user_loggedout}
  User ist nicht eingeloggt
{endif user_loggedout}

Wenn Du den Code in header.html verwenden willst, musst Du noch folgende kleine Änderung in includes/page_header.php vornehmen:

Setze folgenden Abschnitt ganz an das Ende der Datei (genau vor ?>):
Code: [Select]
//-----------------------------------------------------
//--- Parse Header & Footer ---------------------------
//-----------------------------------------------------
if (isset($main_template) && $main_template) {
  $header = $site_template->parse_template("header");
  $footer = $site_template->parse_template("footer");
  $site_template->register_vars(array(
    "header" => $header,
    "footer" => $footer
  ));
  unset($header);
  unset($footer);
}

Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline Patt

  • Pre-Newbie
  • Posts: 8
    • View Profile
vbulletin header und global...
« Reply #13 on: January 24, 2003, 02:17:23 PM »
Hi Jan,

also vielen Dank das funktioniert! Komischerweise muss ich den Code für "Wenn eingelogged" in den Bereich {if user loggedout} schreiben und umgekehrt?

Wunder? :?:

Grüße und danke! :D