By allen on
hello
how do i make it where i can post this script on a php page in my root but outside of my drupal website. i want to greet users on my main page as well.
global $user;
if ($user->uid) {
print t("Welcome $user->name, ... welcome message goes here ...");
}
else {
print t("Welcome visitor, ... welcome message goes here ...");
}
I also would like them to be able to log on from the same wep page. www.allensworld.org
Comments
i also have two more
i also have two more questions,
1)how do i remove these logs i have pages and pages, i went into setting > statistics (Discard access logs older than) and added 1 hour.. still nothing i keep refreshing the cron.php but nothing. my news updates when i refresh it. which brings me to my next question
2)how do i set up crontab if my host server dont support it and i have no access to a unix machine?
poormanscron
#2 http://drupal.org/project/poormanscron
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide
A few suggestions..
Hi Allen,
(not sure if you have already sorted this - had a quick look at your website and it said WELCOME GUEST to me.)
A few suggestions:
a) Have you tried inserting the php code to be part of your MISSION. You can set that by going to the themes administration area. I know it's possible to paste in html code into the mission..assume php code is allowed as well.
b) have you tried the front_page.module?
That allows you to setup a custom front page to your site for not-logged in users and a different page for logged in users.
http://cvs.drupal.org/viewcvs/drupal/contributions/modules/front/
Have a quick look at the readme.txt file for the module before downloading and installing to make sure it does what you want to do.
I'm guessing it maybe of use as you can specify a completely different layout and style sheet for your front_page...
As an aside, the correct spelling is technician (not technition)...from the header of your site..
Jason
Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate
thanks
Im glad to have a prompt reply, im surprised i havent gotten an email for the reply i wonder if mine will email after every post, anyhow thats a later battle.
I dont quite understand how the mission statment php will help me, im not a programmer so itll have to be explained to me a little simple. but i set it up to say guest if the user wasnt logged in and its wierd but it only worked after I removed the T after print.
global $user;
if ($user->uid) {
print t("Welcome $user->name, ... welcome message goes here ...");
}
else {
print t("Welcome visitor, ... welcome message goes here ...");
}
but it only shows the message guest, if i log in and go to that page it still shows the same message.
and i can log in from the main page, but it doesnt send me anywhere or change any content
I will check out the frontpage modual, but i have another site too a www.allensworld.org/sales that i was trying to make that page be alike aswell
thanks for the typos, i was never to good at that.
off shore : this isnt to compatible with frontpage extentions is it? i had to remove it to get it to work right and now its more of a hassle to edit them.
not an expert response..but
Hi Allen,
I'm not an expert so please bear that in mind..when nobody else answered your query I thought I would volunteer.
Don't know anough about PHP to decipher what is going on...but, quick question:..when you login..does your username appear above the navigation?
re: mission...maybe worth checking out other discussions on it..
http://drupal.org/node/2166
re: front_page.module.
I'm not sure what you mean when you say it isn't compatible with front page extensions. What did you remove To get what working right?
Jason
Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate
ohh ok
ohh the drupul site works all the way, nothing wrong with that, its the first entry page that i was trying to make compatible with and display the username in the welcome screen. no matter who is logged on, it says guest on www.allensworld.org
and for frontpage i had to remove all the _vti folders, actually i removed all folders starting with an _ simular post below
http://drupal.org/node/10911
okay.
Hi Allen
I'm wasn't familiar, until now, the html editor called frontpage you were talking about......I understand the confusion.
There is a module called front_page.module for drupal (nothing to do with the front page software product) that allows you to set up a custom home page for users not logged in and automatically show a different page for users that are logged in.
Recommend you install it and use that to setup the front-end to your site..click through to the link below and open up the readme.txt file which explains everything.
http://cvs.drupal.org/viewcvs/drupal/contributions/modules/front/
Hope that helps.
Jason
Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate
ok
thanks, i understand the differnce. there too sepreate issues. i just installed the module an i like, only i cant get past the error- unathorized user when i log out, Access denied
You are not authorized to access this page.
i tryed differt ways, with html- just plain text and the defualt theme-
all fails
whats your settings?
Hi Allen,
what have you set the VIEW FRONT PAGE checkbox to under ADMINISTER - USER - CONFIGURE - PERMISSIONS for anonymous users?
i.e. anonymous users should be able to VIEW FRONT_PAGE.
if you have accidentally logged yourself out of your drupal site...simply go to the following link:
hope that helps.
Jason
Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate
opps
this was a duplicate. sorry
just tried a quick test...
Hi Allen,
Just tried a quick test to create an account and login at allensworld.org...
Worked fine for me...email came through with password..when I logged in, it worked and brought me to the main page...
The only glitch is when I click on your home link it seems to bring me out of drupal and into another website or pages built using a different CMS to drupal...
Hope that helps..
Jason
Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate
thanks
yes that differnt cms is the one i built (to be changed shortly), when you clicked on home it should of read your username instead of (Guest) in the welcome box on www.allensworld.org . Im about to test some new modules what would you recomment for top 5? I forgot what was said on the last post, so ill read it again and reply to that on, im greatful for your help jason.