Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 02-22-2022, 05:58 AM
Dr.CustUmz's Avatar
Dr.CustUmz Dr.CustUmz is offline
 
Join Date: Aug 2013
Location: USA
Posts: 647
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Using if Condition in Forum Option

I am trying to make a product that will give me a different header based on the forum I am in, that's no problem and complete. My issue lays with using template conditionals inside of said option.

I am currently using a forum option to insert my custom template additions:
Attachment 158950

In global complete I am using:
PHP Code:
global $vbulletin;

if (
$GLOBALS[foruminfo]["forumid"]>0) {
    
$forum_code '';
    
$_fid $GLOBALS[foruminfo]["forumid"];
    
$forum_info $vbulletin->forumcache[$_fid];

    if (
$forum_info["code"]) {
        
$forum_code $forum_info["code"];
    } elseif (
$forum_info["parentid"]) {
        while (
$forum_code=='' && $forum_info["parentid"]>0) {
            
$forum_info $vbulletin->forumcache[$forum_info["parentid"]];
            
$forum_code $forum_info["code"];
        }
    }

Then I place $forum_code into my header

I would like to be able to get the conditionals to work so I can only show things to members or usergroups within the header. Is there a way to get the variable to not ignore the conditions? they are included in the DB entry, just being ignored when rendered to the page.
Reply With Quote
  #2  
Old 02-22-2022, 11:46 AM
lange's Avatar
lange lange is offline
 
Join Date: Apr 2003
Location: Montreal (Canada)
Posts: 282
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dr.CustUmz View Post
I am trying to make a product that will give me a different header based on the forum I am in, that's no problem and complete...
Hello Dr.CustUmz

Glad to see you still here. You should upgrade to vB5, I made the jump and I don't regret it anymore even though my version vB 3.8.11 still runs on a domain name. The customization possibilities are also numerous but they are different. The big advantage of Vb5 is a better usability of posting topics and the different layouts that allow you to add even more content to a forum if you know what content to add. Conditionals can of course also be used on this content.

I know you have completed your work and want to do this to deliver a product. So I'm not a coder and I don't know your way of proceeding but the goal of changing the header per forum was achieved on my version vB 3.8.11 simply by copying and pasting the content of the header into the Forumdisplay template and using common conditionals on forums and user groups. vB 3.8.11 is a fast forum, you can do it like this.

You can even go further by dynamically changing the header per forum on each page load i.e. three different headers per forum for example by using this PHP function:

Code:
$safe_functions[] = 'rand';
Code:
                <if condition="rand(0, 1)">
                           content1
                        <else />
                        <if condition="rand(0, 1)">
                          content2
                        <else />
                          content3
                        </if>
                 </if>

I do the same thing on vB5 but I proceed differently.
Reply With Quote
Благодарность от:
Dr.CustUmz
  #3  
Old 02-22-2022, 02:09 PM
Dr.CustUmz's Avatar
Dr.CustUmz Dr.CustUmz is offline
 
Join Date: Aug 2013
Location: USA
Posts: 647
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Glad someone familiar is still around lol, but I'm going to hold my ground on vb3 =P

I do agree the simplest way would be to directly edit the template and create conditions per forumid, but once / if I can achieve what I am trying to do then it would be even easier, and ALOT cleaner way of doing so. Basically the new header (per forum) would be stored in the variable $foruminfo[drc_head], and you would never need to touch the templates.

I do have it working properly already in that sense, where in each forums settings (forum manager) all I need to do is put my custom HTML for that forum, the only issue is I can't use conditionals, say... hide this link from this usergroup within that code.

I'm not sure how likely I would actually need to use a conditional within a forums header, but I'd like to have the ability to if the need arises, as my headers (per forum) will be pretty complex.

Main Header:
Attachment 158951

Sample Forum Header:
Attachment 158952
Reply With Quote
  #4  
Old 02-22-2022, 08:10 PM
lange's Avatar
lange lange is offline
 
Join Date: Apr 2003
Location: Montreal (Canada)
Posts: 282
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dr.CustUmz View Post
I am trying to make a product
You should upgrade your wonderful product [DRC] - Currently Active Avatars to vB5.6.6/PHP 8. I would buy it for sure. :up:

https://vborg.vbsupport.ru/showthread.php?t=322378
Attached Images
File Type: png dji.png (25.1 KB, 0 views)
Reply With Quote
  #5  
Old 02-25-2022, 03:06 PM
puertoblack2003's Avatar
puertoblack2003 puertoblack2003 is offline
 
Join Date: Aug 2005
Location: Philadelphia
Posts: 1,073
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by lange View Post
You should upgrade your wonderful product [DRC] - Currently Active Avatars to vB5.6.6/PHP 8. I would buy it for sure. :up:

https://vborg.vbsupport.ru/showthread.php?t=322378
I currently have v2.0, not sure where i got it. my server got corrupted about a year ago and lost the vb forum and database. if Dr.CustUmz gives me permission i can send it to you.

never mind i just seen you on vb5
Reply With Quote
Благодарность от:
lange
  #6  
Old 02-26-2022, 03:26 AM
Dr.CustUmz's Avatar
Dr.CustUmz Dr.CustUmz is offline
 
Join Date: Aug 2013
Location: USA
Posts: 647
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think I gave you a pre release of v2, I'm just getting back into things but will be updating everything. including vb3 to php 8 =)
Reply With Quote
Благодарность от:
puertoblack2003
  #7  
Old 02-26-2022, 03:31 PM
lange's Avatar
lange lange is offline
 
Join Date: Apr 2003
Location: Montreal (Canada)
Posts: 282
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by puertoblack2003 View Post
... if Dr.CustUmz gives me permission i can send it to you.

never mind i just seen you on vb5
I am on vB 3.8.11/ PHP7.4.x too.

Anyway, thank you Puertoblack2003 but as you can see on the following screenshot, I have an alternative since yesterday ... so I'm less interested in this product under vB5.

For vB 3.8.X under PHP 8, I'm not interested if there is a tracking, if the version is not 100% responsive and if the addons do not work under PHP 8. My version 3.8.11 is currently 100% responsive...

So I don't expect to run vB 3.8.11 and vB5 Connect at the same time within one or two years maximum. vB5 will be much more interesting than vB 3.8x in the next months. This is already the case for me right now...
Attached Images
File Type: png screen-dp.png (17.5 KB, 0 views)
Reply With Quote
Благодарность от:
puertoblack2003
  #8  
Old 02-26-2022, 04:10 PM
puertoblack2003's Avatar
puertoblack2003 puertoblack2003 is offline
 
Join Date: Aug 2005
Location: Philadelphia
Posts: 1,073
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dr.CustUmz View Post
I think I gave you a pre release of v2, I'm just getting back into things but will be updating everything. including vb3 to php 8 =)
cool, can't wait. I don't mind giving vb a second go around :up:
Reply With Quote
  #9  
Old 02-26-2022, 04:26 PM
lange's Avatar
lange lange is offline
 
Join Date: Apr 2003
Location: Montreal (Canada)
Posts: 282
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by puertoblack2003 View Post
cool, can't wait. I don't mind giving vb a second go around :up:
My vB 3.8.x version is 300% customized. I am at 200% with vB5 Connect 5.6.6 / PHP 8 and the look is already better.

I saw your Xenforo forum, it is great but vB5 does it and goes even further as I mentioned above. Everything is possible under vB5 as on vB 3.8.x but you have to get out of the canned vB5 version otherwise it's not visually interesting.
Reply With Quote
  #10  
Old 02-26-2022, 04:30 PM
Dr.CustUmz's Avatar
Dr.CustUmz Dr.CustUmz is offline
 
Join Date: Aug 2013
Location: USA
Posts: 647
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

this thread got wayy de railed, but since I already figured out a solution (and released the product) ill roll with it lol.

lange, not sure what addon you are using, but v2 is actually a little cooler


as for using vb3.8.11 on php 7.4, you should upgrade to my 3.8.14, which fixes a lot of 3.8.11 obsolete coding and adds newer version of some features.

I am working on loads of things, but one thing I do plan on is making the default theme fully responsive. not having a separate "mobile" theme like vb4 (it's kind of pointless) responsive is the only way to go.

as for addons, i cant update EVERY addon to be compatible with php 8. That is just Ludacris, but developers will have the ability to update if they so wish. And I will update some. I dont understand when you say "im not interested if there is a tracking" if you're referring to the way my products install and report the install to https://dirtrif.com/installs.php, my vBulletin 3.8.14 installs clean just with upgraded files and features.

vb3 is the only vBulletin worth a damn to me personally, and if I were going to switch I would use xF before using vb4 or vb5. Which I have a license for as well, and have tried, and although pretty cool with the features, vb3 is still where I want to be =)

There is no feature vb4, vb5 or even xF has, that can not be done with vb3. If you look at my site (albeit still working on things) I more features than that of any of the aforementioned. My navbar is a HUGE product, that I am debating with myself to release or not, but the options for it are CRAZY. featuring things like link management for my top links, social links, the user menu links, and the navbar links, as well as instant notifications that offer instant replies within the drop down, and so much more.

With all the work I have put into vb3, its not something I will migrate from anytime soon.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:25 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05023 seconds
  • Memory Usage 2,309KB
  • Queries Executed 14 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (1)bbcode_php
  • (6)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (4)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (2)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete