Web server – Redirect users to the web server based on the user IP

I have a web server with Windows authentication. I want to disable Windows authentication locally. Everyone on the local network can access it without authentication. After a long search, I have not found a way. However, I think I can create two web servers using the same domain name, a local IP address and a public IP address. but the problem is how to redirect the local users to the local web server?

forms – 8 – Set the value for a new term based on a custom vocabulary field

I want to set the value of a field of a term based on a custom field set in the vocabulary. Basically, that's the vocabulary promot_to_index the box is ticked i want that field_index_page the term is checked.

I understand that I have to write a hook like this, but I do not understand how to get the value of the custom vocabulary box

Function polaris_drupal_taxonomy_form_alter (& $ form, FormStateInterface & $ form_state, $ form_id) {

switch ($ form_id) {

case & # 39; taxonomy_term_category_form & # 39 ;:
case & # 39; taxonomy_term_article_type_form & # 39 ;:
case & # 39; taxonomy_term_main_purpose_form & # 39 ;:
case & # 39; taxonomy_term_tags_form & # 39 ;:
case & # 39; taxonomy_term_content_partnership_form & # 39 ;:
case & # 39; taxonomy_term_traffic_source_form & # 39 ;:
case & # 39; taxonomy_term_client_form & # 39 ;:
$ form['field_index_page']['widget']['value']['#default_value']    = true;
}
}

What's the difference between the two examples Google gives for cloaking: changes based on the user program and text instead of Flash for bots?

I do not see the point in the question, since camouflage is pretty easy. What your users see should be seen by search engines. When you analyze what a Google employee has written, nothing changes and you waste your time.

But I will point out the differences in the two examples:

The bottom line is that these examples are written by people, they're not perfect, but if you have to ask, it's likely that you are doing something that deviates from what you know, that you should not do.

First show the post in a loop based on the meta key in an array of multiple categories

I try to achieve the following.
The WordPress Topic Newspaper uses a custom block to display the four most recent multi-category posts specified in a TagDiv composer that came with the topic.

These blocks provide sorting options that are built into the topic as case or wp query arguments. These cases can then be applied to the blocks in which you set the number of posts, categories for displaying posts, and so on.

However, I need the latest post from a category (called Win Win Win) that, when set to this category, sets the custom field "wedstrijd" to "true" to appear as the first post of the four.

So if there is a contest, the first post is always this competitive post, the other three are filled with the latest entries from a range of categories.

Until the contest post is deleted, it should stay in the top position while adding other content, which will have a later release date. This competition category always has only one active published contribution.

I tried the following, but unfortunately I can only show the single post with the key wedstrijd to true. Someone out there who can help me with this?

The categories are set in the TagDiv composer of the site. These are 4,5,9,433.43,47,36,18,17,427,790,31648, where 31648 is the competition category. I've already tried to set the categories in the following query, but this does not work or overrides the settings in tagdiv composer.

                            case & # 39; winfirst & # 39 ;:
$ wp_query_args['meta_query'] = array (
& # 39; relation & # 39; => & # 39; OR & # 39 ;,
& # 39; # 39 & query_one; => array (
& # 39; key & # 39; => & # 39; wedstrijd & # 39 ;,
& # 39; compare & # 39; => & # 39; = & # 39 ;,
& # 39; value & # 39; => & # 39; 1 & # 39;
)
& # 39; # 39 & query_two; => array (
& # 39; key & # 39; => & # 39; wedstrijd & # 39 ;,
& # 39; compare & # 39; => & # 39; = & # 39 ;,
& # 39; value & # 39; => & # 39 ;,
)
);
$ wp_query_args['orderby'] = array ('query_one' => 'ASC', 'query_two' => 'DESC');

Design Pattern – Determine whether an action is possible based on many objects and notify you of status changes

In the game I'm developing, I need to determine if an action is possible. Whether the action is possible depends on a number of factors that are distributed across many objects (ActionDeterminers) in the game. These objects may or may not be present, and whether each of the objects allows the action is dynamic.

My idea was to implement an Observer-style pattern in which these ActionDetermins can register with a subject. When the subject is asked IsActionPossibleEverywherecan it then call an interface function for each of the ActionDeterminers: IsActionPossibleand then AND all of their results. Is there a name for this pattern?

The problem I'm facing is that I also want to notify another set of objects (observers) about changes in the result IsActionPossibleEverywhereusing the standard Observer pattern. As far as I can tell, I have two options:

  1. Survey. I could just call IsActionPossibleEverywhere in the main loop, and then notify each observer if the result changes since the last call. Unfortunately, that is IsActionPossibleEverywhere The call may not be performant (depending on each of the ActionDeterminers).

  2. Give each ActionDeterminer the additional responsibility of informing the subject when he is personal IsActionPossible Call can change. The subject will then call IsActionPossibleEverywhere and inform its observers if the result has changed since the last call. This is much more complex and has more potential sources of error.

Please let me know if you have any further ideas on how I could implement this system. Many Thanks!

php – based on the status column, how to display different background colors in td

The while loop uses data based on the statusid value to display various background colors

    echo " 
       ". $ Result['exportid'], " 
       ". $ Result['deb_nmr'], " 
       ". $ Result['cost_name'], " 
       ". $ Result['numb_pal'], " 
       ". $ Result['tot_weight'], " 
       ". $ Result['pb_s'], " 
       ". $ Result['date'], " 
       ". $ Result['statusid'], "
 ";

}

discord.py – Role assigned based on Role ID

I try to assign roles to users in a guild based on the ID of the role once they have logged in. However, it does not seem that this is the case if I provide the role ID and I the role name.

I tried both

@ Nao.event
async def on_member_join (member):
database = mysql.connector.connect (
host = & # 39; localhost & # 39 ;,
user = & # 39 ;, root & # 39 ;,
passwd = & # 39 ;,
database = & # 39; Nao & # 39;
)
cursor = database.cursor ()
query = "SELECT THE ROLE FROM THE AUTOROLLE WHERE server =% s"
values ​​= (member.guild.id,)
cursor.execute (query, values)
Result = cursor.fetchall ()
for the role in result:
role = discord.utils.get (member.guild.roles, name = & # 39; Members & # 39;)
wait for member.add_roles (role)

Which works and

@ Nao.event
async def on_member_join (member):
database = mysql.connector.connect (
host = & # 39; localhost & # 39 ;,
user = & # 39 ;, root & # 39 ;,
passwd = & # 39 ;,
database = & # 39; Nao & # 39;
)
cursor = database.cursor ()
query = "SELECT THE ROLE FROM THE AUTOROLLE WHERE server =% s"
values ​​= (member.guild.id,)
cursor.execute (query, values)
Result = cursor.fetchall ()
for the role in result:
role = discord.utils.get (member.guild.roles, id = role[0])
wait for member.add_roles (role)

which does not work.

Dynamic width scale of the container based on the height of the browser window (video iframe)

Since you REALLY do not position anything, you do nothing to justify the use of the additional DIV or 90% + of this CSS. I would also drop the frame, to be honest, f *** IE9 / earlier.

Although I suspect what you really want and why you have the DIV, is to position: Absolutely the iframe to maintain the aspect ratio for larger sizes? I would do that.


Code (surcharge):





.video_16x9 {
Position: relative;
Hidden overflow; / * Cut off surplus * /
maximum height: 1vh; / * View port height * /
}

.video_16x9: before {
Content:"";
Screen lock;
Width: 100%;
Height: 0;
padded floor: 56.25%;
/ *
Use 62.5% for 16:10. Is there an extra fixed amount for
Game controls, set it on padding top or height!
* /
}

.video_16x9 video,
.video_16x9 object,
.video_16x9 iframe {/ * only covers all bases * /
Position: absolutely;
above: 0;
left: 0;
Width: 100%;
Height: 100%;
Limit: 0;
}

Code (surcharge):

With the exception of typos (drive-by-post) that should do the job. Note that older browsers do not know vh, but considering the fact that modern video rendering is slowing down the use of HTML 5 browsers, I think this is not a problem. People who refuse to join us in this decade (which is almost over) should be used to small things being broken for them.

The big trick is that by completely positioning our frame / video / object (whichever you prefer) it will be removed from the river without telling its height. Setting the height 0 for the DIV and then applying the padding produces our aspect ratio since the percent padding is based on the width of the element not height or font size.

So for 16: 9 video 9/16 == 0.5625 == 56.25%. "Easy".

Oh, and if you want the yellow to appear around the aspect of the video when it's zoomed out, put it on the DIV, not on the frame.

– edit – my bad. Min-height does not want to crop in all browsers, so I've created a generated content item to set the height smaller than the viewport, and then use the overflow: hidden to cut it off if it is. Should work. Technically, we should not say width: 100% as a block element, but unfortunately, SOME browsers will not do the trick of percentage height without an explicit width declaration.

Create a custom alert based on document properties

Our organization uses a process in which the creator of a document places it in SharePoint. Examiners must either enter comments or agree with the document. The document will then be approved if everyone agrees.

We are tracking which examiners are still to be examined. Sometimes the checks come too late, which delays the entire process. It would improve efficiency and alert users that a document requiring their attention was placed in the system.

I can create general alerts, but how can I customize SharePoint alerts? For example, one document is entered into the system and three reviewers are selected: ADCO, CapCom, and CCP (Engineering). The required examiners are a select feature of the document library

Document entered in SharePoint

Then everyone can check the document in the system:

Document in the review cycle

Can I create a warning message so that I only receive emails when I create a document that selects ADCO as the required reviewer?

The SharePoint alert does not seem to be very flexible.
SharePoint Alert