magento2 – how to add custom user agent with android in magento 2?

You can try this.

<?php
//This will identify user agent mobile or not
               if(preg_match('/(android|bbd+|meego).+mobile|avantgo|bada/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)/|plucker|pocket|psp|series(4|6)0|symbian|treo|up.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i',$_SERVER('HTTP_USER_AGENT'))||preg_match('/1207|6310|6590|3gso|4thp|50(1-6)i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez((4-7)0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|/(k|l|u)|50|54|-(a-w))|libw|lynx|m1-w|m3ga|m50/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10(0-2)|n20(2-3)|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-((1-8)|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-(2-7)|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5(0-3)|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i',substr($_SERVER('HTTP_USER_AGENT'),0,4))) {
        
echo $this->getLayout()->createBlock("MagentoFrameworkViewElementTemplate")->setTemplate("Vendor_Module::your-template-file.phtml")->toHtml();
        
}
?>

Allowing users to manually add or remove themselves to/from WordPress multisite blogs

I am trying out WordPress multisite and have set it up so that the main site on the network allows users to register.

From my (beginner level) understanding of how WordPress multisite works: a user registered on the main site is allowed to view all network content unless it is protected. There is only one user table in the database shared by the network. But users don’t have a “role” in sub-sites unless it is explicitly given to them in admin area or by registration or plugins that synchronize users.

So then I set up another few sub-sites, and for them I made the users sync automatically via a plugin, because I want to have some content on them that is restricted to certain user roles. This works fine, no issues here.

But then I tried creating a private sub-site that is viewable only to subscribers. Setting that up was easy. However, what I want to do now is allow users to “manually” join this private sub-site if they want to – instead of me doing that in the admin area.

To clarify, I don’t want to sync all users to this sub-site or other private ones. I want to make it entirely optional by putting a list of the network sub-sites on the main site, with “Join” links next to each one. So if logged in users click “Join” they become subscribers in that sub-site and can view its content (and if they click “Leave” they are no longer counted as subscribers and retain only their other roles).

The plugins and a lot of the sample code I found on the internet usually address automatically adding users to sub-sites, or things like allowing registration per individual sub-sites. They don’t cover allowing users themselves to manually join/leave multisite blogs.

Only one, long abandoned plugin addressed exactly what I am looking for (called Join My Multisite), but I think the PHP code is outdated it does not function very smoothly. It is not available in the WP repository, but the author kept it on Github.

The WordPress codex mentions an add_user_to_blog function, but I need help understanding how to use it in this context. What I want is simple, but I don’t know how to accomplish it.

Can I create a “Join” link that permits my main site users to Join the sub-sites they want to join, or a “Leave” link for them to remove their user role from only that sub-site? If yes, can you show me how, please?

Thank you.

Socks5 Proxy Service Cheap Socks5


SOCKS Proxy List by Tisocks.net
If you Need Socks5 , Please visit service and add fund via PM , BTC WMZ . Thanks all!!
Add fund : https://tisocks.net/addfund
Check socks5 Online here : https://checksocks5.com
LIVE | 213.136.89.190:9821 | 0.247 | SOCKS5 | Unknow | Unknow | | Unknow | Checked at https://tisocks.net
LIVE | 132.230.7.2:64419 | 0.217 | SOCKS5 | Baden-Württemberg | 79104 | moca.phil2.uni-freiburg.de | Germany | Checked at https://tisocks.net
LIVE | 97.74.230.16:33415 | 0.563 | SOCKS5 | Unknow | Unknow | ip-97-74-230-16.ip.secureserver.net | United States | Checked at https://tisocks.net
LIVE | 69.163.165.204:42224 | 0.608 | SOCKS5 | California | 92821 | hermiston.dreamhost.com | United States | Checked at https://tisocks.net
LIVE | 69.163.161.111:42224 | 0.587 | SOCKS5 | California | 92821 | hermiston.dreamhost.com | United States | Checked at https://tisocks.net
LIVE | 104.238.111.218:40215 | 0.579 | SOCKS5 | Unknow | Unknow | ip-104-238-111-218.ip.secureserver.net | United States | Checked at https://tisocks.net
LIVE | 154.209.93.155:10808 | 1.23 | SOCKS5 | Sichuan | Unknow | China Mobile Guangdong | China | Checked at https://tisocks.net
LIVE | 198.12.151.247:43478 | 5.358 | SOCKS5 | Unknow | Unknow | ip-198-12-157-28.ip.secureserver.net | United States | Checked at https://tisocks.net
LIVE | 63.250.32.241:23757 | 1.512 | SOCKS5 | New York | 11234 | 89.sub-166-141-133.myvzw.com | United States | Checked at https://tisocks.net
LIVE | 198.12.151.247:43263 | 1.243 | SOCKS5 | Unknow | Unknow | ip-198-12-157-28.ip.secureserver.net | United States | Checked at https://tisocks.net
LIVE | 5.63.10.198:58417 | 0.671 | SOCKS5 | Unknow | Unknow | Markus Koch | Unknow | Checked at https://tisocks.net
LIVE | 198.12.151.247:38001 | 2.313 | SOCKS5 | Unknow | Unknow | ip-198-12-157-28.ip.secureserver.net | United States | Checked at https://tisocks.net
LIVE | 198.12.157.28:43263 | 3.318 | SOCKS5 | Unknow | Unknow | ip-198-12-157-28.ip.secureserver.net | United States | Checked at https://tisocks.net
LIVE | 54.36.244.137:49775 | 0.128 | SOCKS5 | California | 90745 | cpe-107-185-247-60.socal.res.rr.com | United States | Checked at https://tisocks.net
LIVE | 198.12.151.247:36022 | 3.285 | SOCKS5 | Unknow | Unknow | ip-198-12-157-28.ip.secureserver.net | United States | Checked at https://tisocks.net
LIVE | 198.12.151.247:36922 | 5.422 | SOCKS5 | Unknow | Unknow | ip-198-12-157-28.ip.secureserver.net | United States | Checked at https://tisocks.net


tisocks
Reviewed by tisocks on
.
[Tisocks.net] – Socks5 Proxy Service Cheap Socks5
SOCKS Proxy List by Tisocks.net
If you Need Socks5 , Please visit service and add fund via PM , BTC WMZ . Thanks all!!
Add fund : https://tisocks.net/addfund
Check socks5 Online here : https://checksocks5.com
LIVE | 213.136.89.190:9821 | 0.247 | SOCKS5 | Unknow | Unknow | | Unknow | Checked at https://tisocks.net
LIVE | 132.230.7.2:64419 | 0.217 | SOCKS5 | Baden-Württemberg | 79104 | moca.phil2.uni-freiburg.de | Germany | Checked at https://tisocks.net
LIVE | 97.74.230.16:33415 | 0.563 |

Rating: 5



.

themes – How do I add a div class to the posts in a filter and not the entire filter element?

I am having some troubles with the Isotope filter gallery, as discussed in my Stackoverflow question here.

As per the first point of the accepted answer, I need to add the class .isotope, to the parent (the .row element) to make it work with URL hashes. Otherwise, it only works when you click on the filter links, as you can try on the live webpage.

Here is the element to which the user told me to add the class:

<div class="isotope row masonry" data-masonry-id="d2546a5a8aed79adf8c0b3b78a16b29f" style="position: relative; height: 969.6px;">

Notice the <div class ="isotope before row masonry bit? That is what I need to add.

However, I can only apply a custom class to the entire Posts element in Elementor. If I do that, it causes the JS to think that it needs to sort the whole grid itself and makes it disappear.

How do I target this specific row element?

search – How do I add a managed property for a column on a list when I do not see a crawled property to map to?

I’m working with SharePoint 2013 Enterprise. I’ve taken over the management of another SharePoint setup created by the person that had my job before me. I want to be able to query against the search api against a specific column, Alternate Name, for which I do not see any managed or crawled property created. I know the column is not a site column. That said, SharePoint shows that it has an internal name of "Alternate_x0020_Name". I’ve done both an incremental and full crawl after ensuring that numerous list items have an Alternate Name value. I have searched both managed & crawled properties via the Search Schema on nearly every variation of "Alternate_x0020_Name" I can think of, including searching on each singular part of the column name. Best I can see is that there simply isn’t one. That said, if I try creating a new managed property and mapping it to a crawled property…well I could, but I do not see a field to map to.

The api I’m querying against follows a URL signature like:

http://sharepoint_server/_api/search/query?querytext='alt name value'&rowlimit=500

There are A LOT of columns that this particular api does not return as part of it’s xml, though, I haven’t figured out how to add more columns even by adding the &SelectedProperties='properties here'.

I’ve reviewed a number of links, but am still not sure what to make of my scenario. It doesn’t seem like a managed property was auto-created and it doesn’t seem like there’s anything to map it to if I create a new one.

Any input would be greatly appreciated.

The links I’ve reviewed are below. I’ve also gone further into these by following and reading subsequent links that were posted as part of various answers.

List Column as Crawled Property

How to check correct Crawled property for a list column

Creating Custom Managed Properties

Socks5 Proxy Service Cheap Socks5


SOCKS Proxy List by Tisocks.net
If you Need Socks5 , Please visit service and add fund via PM , BTC WMZ . Thanks all!!
Add fund : https://tisocks.net/addfund
Check socks5 Online here : https://checksocks5.com
LIVE | 213.136.89.190:9821 | 0.247 | SOCKS5 | Unknow | Unknow | | Unknow | Checked at https://tisocks.net
LIVE | 132.230.7.2:64419 | 0.217 | SOCKS5 | Baden-Württemberg | 79104 | moca.phil2.uni-freiburg.de | Germany | Checked at https://tisocks.net
LIVE | 97.74.230.16:33415 | 0.563 | SOCKS5 | Unknow | Unknow | ip-97-74-230-16.ip.secureserver.net | United States | Checked at https://tisocks.net
LIVE | 69.163.165.204:42224 | 0.608 | SOCKS5 | California | 92821 | hermiston.dreamhost.com | United States | Checked at https://tisocks.net
LIVE | 69.163.161.111:42224 | 0.587 | SOCKS5 | California | 92821 | hermiston.dreamhost.com | United States | Checked at https://tisocks.net
LIVE | 104.238.111.218:40215 | 0.579 | SOCKS5 | Unknow | Unknow | ip-104-238-111-218.ip.secureserver.net | United States | Checked at https://tisocks.net
LIVE | 154.209.93.155:10808 | 1.23 | SOCKS5 | Sichuan | Unknow | China Mobile Guangdong | China | Checked at https://tisocks.net
LIVE | 198.12.151.247:43478 | 5.358 | SOCKS5 | Unknow | Unknow | ip-198-12-157-28.ip.secureserver.net | United States | Checked at https://tisocks.net
LIVE | 63.250.32.241:23757 | 1.512 | SOCKS5 | New York | 11234 | 89.sub-166-141-133.myvzw.com | United States | Checked at https://tisocks.net
LIVE | 198.12.151.247:43263 | 1.243 | SOCKS5 | Unknow | Unknow | ip-198-12-157-28.ip.secureserver.net | United States | Checked at https://tisocks.net
LIVE | 5.63.10.198:58417 | 0.671 | SOCKS5 | Unknow | Unknow | Markus Koch | Unknow | Checked at https://tisocks.net
LIVE | 198.12.151.247:38001 | 2.313 | SOCKS5 | Unknow | Unknow | ip-198-12-157-28.ip.secureserver.net | United States | Checked at https://tisocks.net
LIVE | 198.12.157.28:43263 | 3.318 | SOCKS5 | Unknow | Unknow | ip-198-12-157-28.ip.secureserver.net | United States | Checked at https://tisocks.net
LIVE | 54.36.244.137:49775 | 0.128 | SOCKS5 | California | 90745 | cpe-107-185-247-60.socal.res.rr.com | United States | Checked at https://tisocks.net
LIVE | 198.12.151.247:36022 | 3.285 | SOCKS5 | Unknow | Unknow | ip-198-12-157-28.ip.secureserver.net | United States | Checked at https://tisocks.net
LIVE | 198.12.151.247:36922 | 5.422 | SOCKS5 | Unknow | Unknow | ip-198-12-157-28.ip.secureserver.net | United States | Checked at https://tisocks.net


tisocks
Reviewed by tisocks on
.
[Tisocks.net] – Socks5 Proxy Service Cheap Socks5
SOCKS Proxy List by Tisocks.net
If you Need Socks5 , Please visit service and add fund via PM , BTC WMZ . Thanks all!!
Add fund : https://tisocks.net/addfund
Check socks5 Online here : https://checksocks5.com
LIVE | 213.136.89.190:9821 | 0.247 | SOCKS5 | Unknow | Unknow | | Unknow | Checked at https://tisocks.net
LIVE | 132.230.7.2:64419 | 0.217 | SOCKS5 | Baden-Württemberg | 79104 | moca.phil2.uni-freiburg.de | Germany | Checked at https://tisocks.net
LIVE | 97.74.230.16:33415 | 0.563 |

Rating: 5



.

Cannot add events to Google Calendar using Windows Calendar

I have been using Windows calendar to manage my Google Calendar for the last 2 years. And it was working flawlessly. Now when I try to add events to my calendar thru Windows calendar I am getting following error message:

“something went wrong and we were unable to save your recent edits “

and event is NOT added to Google. I tried everything: removed/added back account, uninstalled and installed the mail app but no results. it is so frustrating.

Does anybody have similar issues.

I always keep my laptop updated with all the Windows updates.

python – Randomly selected integers from predetermined lists add up to specific input value

Hello im trying to write a Python code that selects integers from arrays up to a certain value.

I wrote this code however the code uses every list once (as is intended). But sometimes it is still below the input value and has no more options to choose from.

For example if i say WantedNumber is 15 and it picks 4 from listC and 5 from listA, it then has no more options for a correct answer in listB.

or sometimes it picks 1 from every list and then it has no more lists to choose from cause it used all of them already.

How can I make it select a random sequence of integers that adds up to WantedNumber

Note: ”similar questions” are always about completely random numbers adding up to input value. But I don’t want random numbers, I want randomly selected predetermined numbers from my lists.

import random

WantedNumber = input('please input your wanted number:')

listA = (1,2,3,4,5)
listB = (1,2,3)
listC = (1,2,4,7)

All = (listA,listB,listC)

x = 0

while x < int(WantedNumber):
    print(x) #this prints the new x value with the new Random2 added up
    
    Random1 = random.choice(All)
    Random2 = random.choice(Random1)

    print(Random1) #this prints which variable of the list it chose
    print(Random2) #this prints which integer from the array from Random1 it chose
    index = All.index(Random1)
    All.pop(index)

    Y = int(x) + int(Random2)
    
    if Y<=int(WantedNumber):
        x=Y
```

microsoft excel – Add % sign in Data Labels Google Sheets

You can use a VBA macro for this:

Sub AppendPercent()
  Dim objCell as Range
  For Each objCell in Selection
    If objCell.Value <> "" Then objCell.Value = objCell.Value & "%"
  Next
End Sub

Now before running this macro, select all the cells where percent is needed to be appended. Then click Alt+F1 to open Microsoft Visual Basic for Applications and then in Insert > Module paste the code. Then hit F5 to run macro.