This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public string GetCountry() | |
{ | |
var country = Sitecore.Analytics.Tracker.Current.Interaction.GeoData.Country; | |
if(string.IsNullOrWhiteSpace(country)) | |
{ | |
return GetCountryByIp(); | |
} | |
return country; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public IEnumerable<Dictionary<string, object>> TopViewedPages(int topPagesToGet, string siteName, int daysInterval, string language) | |
{ | |
var provider = (ReportDataProvider)Factory.CreateObject("reporting/dataProvider", true); | |
var query = new ReportDataQuery(string.Format(@"SELECT TOP {0} | |
ItemId, | |
F.LanguageId, | |
SUM(Views) PageViewsCount, | |
SUM(Visits) PageVisitsCount | |
FROM Fact_PageViewsByLanguage F | |
INNER JOIN SiteNames S ON S.SiteNameId = F.SiteNameId |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Coveo.$$(search).on("buildingQuery", | |
function (e, args) { | |
var currentLatitude = getCookie("currentlatitude"); | |
var currentLongitude = getCookie("currentlongitude"); | |
var latitudeField = '@@' + CoveoForSitecore.Context.fields.toCoveo('latitude'); | |
var longitudeField = '@@' + CoveoForSitecore.Context.fields.toCoveo('longitude'); | |
var distanceField = CoveoForSitecore.Context.fields.toCoveo('distance'); | |
if (currentLatitude != '' && currentLongitude != '') { | |
var geoQuery = "$qf(function:'dist(" + latitudeField + "," + longitudeField + "," + currentLatitude + "," + currentLongitude + ")', fieldName: 'distance') "; | |
if (args && args.queryBuilder) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$dnsname = "mysite.com" | |
$pwd = ConvertTo-SecureString -String "123456" -Force -AsPlainText | |
$print = (New-SelfSignedCertificate -certstorelocation cert:\localmachine\my -dnsname $dnsname).Thumbprint | |
$path = "c:\Windows\temp\cert.pfx" | |
Export-PfxCertificate -cert cert:\localMachine\my\$print -FilePath $path -Password $pwd | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Get all Product from the Master index for all languages. | |
#You can change this to get data from specific language codes | |
#like 'en', 'fr', etc. | |
$searchCriteria = @( | |
@{ Filter = "Equals"; Field = "_language"; Value = "*"; } | |
@{ Filter = "Equals"; Field = "_templatename"; Value = "Product"; } | |
) | |
#This script executes against Sitecore master index | |
$searchProps = @{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:role="http://www.sitecore.net/xmlconfig/role/"> | |
<sitecore> | |
<settings> | |
<setting name="AllowDuplicateItemNamesOnSameLevel" value="true" /> | |
</settings> | |
</sitecore> | |
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE | |
[aspnet_Membership] | |
SET | |
[Password]='qOvF8m8F2IcWMvfOBjJYHmfLABc=', | |
[PasswordSalt]='OM5gu45RQuJ76itRvkSPFw==', | |
[IsApproved] = '1', | |
[IsLockedOut] = '0' | |
WHERE | |
UserId IN ( | |
SELECT UserId FROM dbo.aspnet_Users WHERE UserName = 'sitecore\Admin' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace MySite.Foundation.Common | |
{ | |
public interface ILoggerService | |
{ | |
#region Debug | |
void Debug(string message); | |
void Debug(string message, Exception ex); | |
#endregion |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:set="http://www.sitecore.net/xmlconfig/set/" xmlns:env="http://www.sitecore.net/xmlconfig/env/"> | |
<sitecore> | |
<log4net> | |
<appender name="MySite.Feature.Products" type="log4net.Appender.RollingFileAppender, Sitecore.Logging"> | |
<file value="$(dataFolder)/logs/MySite.Feature.Products.log.{date}.txt" /> | |
<appendToFile value="true" /> | |
<rollingStyle value="Size" /> | |
<maximumFileSize value="10MB" /> | |
<maxSizeRollBackups value="-1" /> |