Forums: Bootstrap Theme Selector for ASPrunner.net - Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

Bootstrap Theme Selector for ASPrunner.net I have seen one for php Rate Topic: -----

#1 User is offline   DennisB 

  • Member
  • PipPip
  • Group: Members
  • Posts: 20
  • Joined: 09-February 19

Posted 12 February 2019 - 12:10 AM

I tried to modify an example I found on the forum that was written for PHPrunner but wasn't successful. Has anyone been able to set this up for ASPRunner.net ?

I just started using version 10 after not using ASPRunner for quite a while.
0

#2 User is offline   admin 

  • Administrator
  • PipPipPip
  • Group: Admin
  • Posts: 16322
  • Joined: 03-February 03
  • Gender:Male

Posted 12 February 2019 - 03:37 PM

Themes work exactly the same way in PHPRunner and ASPRunner.NET. You need to explain what exactly you tried and what exactly didn't work.
Best regards,
Sergey Kornilov
0

#3 User is offline   DennisB 

  • Member
  • PipPip
  • Group: Members
  • Posts: 20
  • Joined: 09-February 19

Posted 12 February 2019 - 10:13 PM

View Postadmin, on 12 February 2019 - 10:37 AM, said:

Themes work exactly the same way in PHPRunner and ASPRunner.NET. You need to explain what exactly you tried and what exactly didn't work.


I found this link on the PHP forum: Bootstrap Selector

I create the tables, copied files, etc. But the code seemed not to work with .net

$sql = "SELECT theme AS mytheme FROM theme_chooser WHERE status = 'ACTIVE'";
$rs = CustomQuery($sql);
$data = db_fetch_array($rs);
$_SESSION["MyCoolTheme"] = $data["mytheme"];

guessing the $ were a problem I tried:

sql = "SELECT theme AS mytheme FROM theme_chooser WHERE status = 'ACTIVE'";
rs = CustomQuery(sql);
data = db_fetch_array(rs);
x_SESSION["MyCoolTheme"] = data["mytheme"];

still no joy

I also think I am missing something in the layoutbuilder.cs changes

I think this would work and be pretty cool if I figure the .php to .net changes I need to make.
0

#4 User is offline   DennisB 

  • Member
  • PipPip
  • Group: Members
  • Posts: 20
  • Joined: 09-February 19

Posted 14 February 2019 - 06:25 PM

View PostDennisB, on 12 February 2019 - 05:13 PM, said:

View Postadmin, on 12 February 2019 - 10:37 AM, said:

Themes work exactly the same way in PHPRunner and ASPRunner.NET. You need to explain what exactly you tried and what exactly didn't work.


I found this link on the PHP forum: Bootstrap Selector

I create the tables, copied files, etc. But the code seemed not to work with .net

$sql = "SELECT theme AS mytheme FROM theme_chooser WHERE status = 'ACTIVE'";
$rs = CustomQuery($sql);
$data = db_fetch_array($rs);
$_SESSION["MyCoolTheme"] = $data["mytheme"];

guessing the $ were a problem I tried:

sql = "SELECT theme AS mytheme FROM theme_chooser WHERE status = 'ACTIVE'";
rs = CustomQuery(sql);
data = db_fetch_array(rs);
x_SESSION["MyCoolTheme"] = data["mytheme"];



still no joy

I also think I am missing something in the layoutbuilder.cs changes

I think this would work and be pretty cool if I figure the .php to .net changes I need to make.


Build gives errors like: The name 'sql' does not exist in the current context - so it takes more than removing the $ signs.

I really would like to be able to include the ability for end users to choose their bootstrap theme they prefer but I haven't found how to implement this in ASPRunner.net

As the reply "Themes work exactly the same way in PHPRunner and ASPRunner.NET." may be correct, but does not help me to implement the same thing, a Theme Selector.

- I think I will post in a PHPrunner forum to see if I can get some help there.
0

#5 User is offline   timnorvel 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 279
  • Joined: 21-September 07
  • Gender:Male
  • Location:Minnesota, USA

Posted 15 February 2019 - 10:03 PM

Hi Dennis,

I'm not sure I fully understand what you are trying to do, or that I know how to help, but I can take a stab at changing your code to work in ASP.Net.

Here is what you had:

sql = "SELECT theme AS mytheme FROM theme_chooser WHERE status = 'ACTIVE'";
rs = CustomQuery(sql);
data = db_fetch_array(rs);
x_SESSION["MyCoolTheme"] = data["mytheme"];


It looks to me like it should be this:

string sql = "SELECT theme AS mytheme FROM theme_chooser WHERE status = 'ACTIVE'";
XVar rs = tDAL.CustomQuery(sql);
XVar data = CommonFunctions.db_fetch_array(rs);
XSession.Session["MyCoolTheme"] = data["mytheme"].ToString();


Hope this helps.
Good luck!
Tim
0

#6 User is offline   DennisB 

  • Member
  • PipPip
  • Group: Members
  • Posts: 20
  • Joined: 09-February 19

Posted 16 February 2019 - 01:09 AM

View Posttimnorvel, on 15 February 2019 - 05:03 PM, said:

Hi Dennis,

I'm not sure I fully understand what you are trying to do, or that I know how to help, but I can take a stab at changing your code to work in ASP.Net.

Here is what you had:

sql = "SELECT theme AS mytheme FROM theme_chooser WHERE status = 'ACTIVE'";
rs = CustomQuery(sql);
data = db_fetch_array(rs);
x_SESSION["MyCoolTheme"] = data["mytheme"];


It looks to me like it should be this:

string sql = "SELECT theme AS mytheme FROM theme_chooser WHERE status = 'ACTIVE'";
XVar rs = tDAL.CustomQuery(sql);
XVar data = CommonFunctions.db_fetch_array(rs);
XSession.Session["MyCoolTheme"] = data["mytheme"].ToString();


Hope this helps.
Good luck!
Tim


Thanks, Tim

This now compiles. The final piece of the puzzle for me seems to be changing the file layoutbuilder.cs - has a similar line on line number 50.

t_layout.version = ##@layout.version##;

here I will try
t_layout.version = XSession.Session["MyCoolTheme]";


no luck

I then tried replacing a couple more lines, but still no luck, so I think I will move on. I opened up the Project in Visual Studio and used Find for "United" the theme I chose initially and found tons of instances so I think what I was trying to do will not work. The idea was to let anyone logging in to the site to choose a theme. Some people might like Darkly and others would prefer something lighter like yeti. I was imagining something like a language selector but for themes.

Anyway, thanks again, Tim. I really appreciate it.

Dennis
0

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users