Skip to content
This repository has been archived by the owner on Apr 12, 2020. It is now read-only.

Commit

Permalink
Removed ads and auto-clicking of ads on sync.
Browse files Browse the repository at this point in the history
  • Loading branch information
vboctor committed May 27, 2013
1 parent bd8dbcc commit 13f7f4e
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 305 deletions.
19 changes: 0 additions & 19 deletions MainApp/FlickrSync.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

89 changes: 0 additions & 89 deletions MainApp/FlickrSync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@ public enum LogLevel { LogNone = 0, LogBasic, LogAll, LogDebug };
static public LocalInfo li;
static public RemoteInfo ri;
static public string user;
static public bool message_tested=false;
static public bool autorun = false;
static public MessagesLevel messages_level = MessagesLevel.MessagesAll;
static public LogLevel log_level = LogLevel.LogNone;
static public ArrayList HashUsers;
Point MouseDownPos;

static private SyncPropertiesStatus syncprop_status=SyncPropertiesStatus.Default;
Expand Down Expand Up @@ -134,15 +132,6 @@ public static LogLevel StringToLogLevel(string str)
#region Initial Load
private void FlickrSync_Load(object sender, EventArgs e)
{
// probably not needed but just to make sure no message from previous versions is shown
if (Properties.Settings.Default.MessageId.CompareTo("090130_0000")<0)
{
Properties.Settings.Default.MessageId = "090130_0000";
Properties.Settings.Default.Save();
}

HashUsers = new ArrayList();

string token="";
try {
token=Properties.Settings.Default.FlickrToken;
Expand Down Expand Up @@ -172,17 +161,6 @@ private void FlickrSync_Load(object sender, EventArgs e)
else
WindowState = FormWindowState.Maximized;

if (!message_tested)
{
try
{
webBrowser1.Navigate(Properties.Settings.Default.MessageUrl + "?version=" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString());
}
catch (Exception)
{
}
}

if (autorun)
{
ViewAndSync();
Expand Down Expand Up @@ -1167,73 +1145,6 @@ private void organizeSetOnFlickrToolStripMenuItem_Click(object sender, EventArgs
if (lvi != null)
Process.Start(ri.GetPhotosetEditURL(lvi.Name));
}

private void DonateMenuItem_Click(object sender, EventArgs e)
{
MessageBox.Show("To donate, please use Paypal. Any donation is welcomed to support future FlickrSync development and costs. If you donate, please send an email to [email protected] and any further donation requests will be hidden.\nThanks\nFlickrSync Team");
Process.Start(Properties.Settings.Default.DonateUrl);
}
#endregion

#region Check out Messages
private string FindParam(string doc, string str)
{
try
{
int pos = doc.IndexOf(str);
if (pos < 0) return "";
pos += str.Length;

int pos2 = doc.IndexOf('"', pos);
if (pos2 < 0) return "";

return doc.Substring(pos, pos2 - pos);
}
catch (Exception)
{
return "";
}
}

private void webBrowser1_Navigated(object sender, WebBrowserNavigatedEventArgs e)
{
try
{
FlickrSync.message_tested = true;

string mess_id = FindParam(webBrowser1.DocumentText, @"<META name=""mess_id"" content=""message_id=");
string mess_valid = FindParam(webBrowser1.DocumentText, @"<META name=""mess_valid"" content=""message_valid=");
string mess_text = FindParam(webBrowser1.DocumentText, @"<META name=""mess_text"" content=""message_text=");

string hash_users = FindParam(webBrowser1.DocumentText, @"<META name=""hash_users"" content=""hash_users=");
string[] hash_list = hash_users.Split(',');
foreach (string str in hash_list)
HashUsers.Add(str);

if (mess_valid == "1" && mess_id.CompareTo(Properties.Settings.Default.MessageId)>0)
{
Properties.Settings.Default.MessageId = mess_id;
Properties.Settings.Default.Save();

if (mess_text != "" && mess_text != "none")
{
if (messages_level!=MessagesLevel.MessagesNone)
MessageBox.Show(mess_text, "FlickrSync Information");
}
else
{
System.Diagnostics.Process.Start(Properties.Settings.Default.MessageUrl);
Thread.Sleep(10000);
}
}
}
catch (Exception)
{
}
}

#endregion


}
}
39 changes: 0 additions & 39 deletions Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,6 @@
<Setting Name="HelpProperties" Type="System.String" Scope="Application">
<Value Profile="(Default)">http://flickrsync.freehostia.com/index_properties.htm</Value>
</Setting>
<Setting Name="MessageId" Type="System.String" Scope="User">
<Value Profile="(Default)">090130_0000</Value>
</Setting>
<Setting Name="MessageUrl" Type="System.String" Scope="Application">
<Value Profile="(Default)">http://flickrsync.freehostia.com/message.htm</Value>
</Setting>
<Setting Name="UseThumbnailImages" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
Expand Down Expand Up @@ -77,11 +71,5 @@
<Setting Name="OrderType" Type="System.String" Scope="User">
<Value Profile="(Default)">OrderDefault</Value>
</Setting>
<Setting Name="AdUrl" Type="System.String" Scope="Application">
<Value Profile="(Default)">http://flickrsync.freehostia.com/ad.htm</Value>
</Setting>
<Setting Name="DonateUrl" Type="System.String" Scope="Application">
<Value Profile="(Default)">http://flickrsync.freehostia.com/donate.htm</Value>
</Setting>
</Settings>
</SettingsFile>
20 changes: 0 additions & 20 deletions Sync/SyncView.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 1 addition & 41 deletions Sync/SyncView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ struct ThumbnailTask
ArrayList SyncFolders;
ArrayList SyncItems;
static DateTime SyncDate;
string AdsUrlPath;

bool SyncStarted = false;
bool SyncAborted = false;
Expand All @@ -55,7 +54,6 @@ public SyncView(ArrayList pSyncFolders)
Tasks = new ArrayList();
NewSets = new ArrayList();
SyncFolders = pSyncFolders;
AdsUrlPath = "";

CalcSync();
}
Expand Down Expand Up @@ -101,7 +99,7 @@ private void UpdateThumbnails()
try
{
bm = new Bitmap(tt.org);
//bmSize = ThumbnailSize*2;
//bmSize = ThumbnailSize*2;

if (bm == null)
continue;
Expand Down Expand Up @@ -1241,32 +1239,6 @@ private void buttonSync_Click(object sender, EventArgs e)
labelSync.Text = "Synchronizing. Please Wait...";
buttonSync.Visible=false;

//show ads
bool show=true;
string hash = FlickrSync.ri.UserId().GetHashCode().ToString("X");
foreach (string str in FlickrSync.HashUsers)
{
if (str == hash)
{
show = false;
break;
}

if (str == "VERSION" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version)
{
show = false;
break;
}
}

if (show)
{
webBrowserAds.Height = 70;
webBrowserAds.Width = listViewToSync.Width;
webBrowserAds.Visible = true;
listViewToSync.Height = listViewToSync.Height - webBrowserAds.Height - 5;
}

this.Text = "FlickrSync Synchronizing...0%";

ThreadStart ts = new ThreadStart(ExecuteSync);
Expand Down Expand Up @@ -1313,17 +1285,5 @@ private void listViewToSync_DrawItem(object sender, DrawListViewItemEventArgs e)
e.Graphics.DrawString(e.Item.Text, listViewToSync.Font, new SolidBrush(e.Item.ForeColor), r2, fmt);
}
}

private void webBrowserAds_Navigating(object sender, WebBrowserNavigatingEventArgs e)
{
if (webBrowserAds.Visible && e.Url.ToString()!=Properties.Settings.Default.AdUrl && e.Url.LocalPath!=AdsUrlPath)
{
e.Cancel = true;
System.Diagnostics.Process.Start(e.Url.ToString());
}

if (AdsUrlPath == "")
AdsUrlPath = e.Url.LocalPath;
}
}
}
Loading

0 comments on commit 13f7f4e

Please sign in to comment.