244861
mqualls
Accessing PHP variables from template? How to?
  • 2004/7/22 13:44

  • mqualls

  • Just popping in

  • Posts: 2

  • Since: 2004/7/22


According to this page on Smarty's Web site:

PHP Variables in Smarty Templates

You should be able to access a PHP variable from the template...However, I am having a rough go of it...

This is what I have put in the "mylinks_topten.html" template:

<{if $rate == 1}>
<img src="<{$xoops_url}>/modules/mylinks/images/chlulinkstop.jpg" border="0" alt="Top Rated Links" /></a>
<{else}>
<img src="<{$xoops_url}>/modules/mylinks/images/chlulinkspop.jpg" border="0" alt="Most Popular Links" /></a>
<{/if}>

It, as you might guess, is executing the else clause every time....Any ideas on what I am doing wrong? Do I need to make some sort of explicit reference to the PHP variable in order to access the value from the template? Thanks!



244862
Herko
Re: New Hosting Provider Wanted
  • 2004/7/22 13:43

  • Herko

  • XOOPS is my life!

  • Posts: 4238

  • Since: 2002/2/4 1


Being able to read Dutch perfectly fine, I find the hosting a bit expensive (€9.95/month = $12/month for 100 MB, 2GB datatransfer, 1 domain, 10 pop mailboxes and 2 MySQL databases). For just a little more ($13.75/month = €11.40/month), you get 10GB space, 100 GB datatransfer, 4 domains, unlimited pop3 accounts and unlimited MySQL db's at Surpass Hosting's Pro account.

This isn't an affiliate posting, just a quick and simple comparison. I'm disappointed tho that Dutch webhosts are so expensive, and that you have to go abroud to host a site...

Herko



244863
ChadK
Re: XOOPS/SQL Question
  • 2004/7/22 13:42

  • ChadK

  • Quite a regular

  • Posts: 242

  • Since: 2004/7/9 1


Not sure why you're trying to return a result but use this:
Quote:
$sql = "INSERT INTO `xoops_caseyguestlist` (name, street1, street2, city, state, zip) VALUES '$name', '$street1', '$street2', '$city', '$state', '$zip')";
$xoopsDB->queryF($sql) or $eh->show("0013");



244864
ChadK
[SOLUTION]
  • 2004/7/22 13:33

  • ChadK

  • Quite a regular

  • Posts: 242

  • Since: 2004/7/9 1


Done. Here's what you need to modify to get yours working like mine.
Currently I've hard-coded the forum and categories into my hack so you'll want to edit your own category number(s) and forum(s) in the supplied code to suit your needs. Mine is set up so that if they submit a listing to the "Breeders" category then they get access to the breeder discussion private forum when an admin approves the listing. Same for Rescues.

In your file modules\xclassified\admin\index.php:

Find:
Quote:
echo "<br /><input type=\"hidden\" name=\"op\" value=\"approve\"></input>";
echo "<input type=\"hidden\" name=\"lid\" value=\"$lid\"></input>";


Replace with:
Quote:
echo "<br /><input type=\"hidden\" name=\"op\" value=\"approve\"></input>";
//Added by CMK 7/22/04
// Need the submitterid on the form so it can be
// used in the approval
echo "<input type=\"hidden\" name=\"submitterid\" value=\"$submitterid\"></input>";
//end additions
echo "<input type=\"hidden\" name=\"lid\" value=\"$lid\"></input>";



Find:
Quote:
$query = "update ".$xoopsDB->prefix("xdir_text")." set description='$description' where lid=".$lid."";
$xoopsDB->query($query) or $eh->show("0013");
global $xoopsModule;


Replace with:
Quote:
$query = "update ".$xoopsDB->prefix("xdir_text")." set description='$description' where lid=".$lid."";
$xoopsDB->query($query) or $eh->show("0013");
// ADDED BY CHAD KOVAC 7/22/04 to grant access to breeder forum
// breeder: category ID = 154, forum id = 28
// breeder: category ID = 156, forum id = 34
if($cid=='154') {
$sql = "INSERT INTO `xoops_bb_forum_access` ( `forum_id` , `user_id` , `can_post` ) VALUES ('28', '".$submitterid."', '1');";
} else {
if($cid=='156') {
$sql = "INSERT INTO `xoops_bb_forum_access` ( `forum_id` , `user_id` , `can_post` ) VALUES ('34', '".$submitterid."', '1');";
}
}
$xoopsDB->queryF($sql) or $eh->show("0013");
// END ADDITION
global $xoopsModule;



Find:
Quote:
$premium = $HTTP_POST_VARS['premium'];
if ( empty($cid) ) {


Replace with:
Quote:
$premium = $HTTP_POST_VARS['premium'];

//Added by CMK 7/22/04
$submitterid = $HTTP_POST_VARS['submitterid'];
//End addition
if ( empty($cid) ) {


Now when someone on my site submits a breeder listing and an admin approves it they are automatically given access to the breeder message forum. Same for rescue listings. I could go further and add functions to do the same for bird clubs, whatever...

Enjoy.



244865
lykoszine
Re: Block with changing text
  • 2004/7/22 13:33

  • lykoszine

  • Module Developer

  • Posts: 244

  • Since: 2002/1/2 2


The Quote of the Day module would be very easy to change into what you want...



244866
theprof
Yet another hard one to fix...please help...
  • 2004/7/22 13:27

  • theprof

  • Quite a regular

  • Posts: 225

  • Since: 2004/7/14


Ok I have been getting, emails from future users....when they signup they cant log onto site. I found the reason why......after the (User Registration) after they agree to terms and SUBMIT it takes them to the second page.


Username: mikey123
Email: mikey123@hotmail.com
Time Zone: GMT -5

and then it has the little

FINISH

where the user is suppose to click to finish the register process....

well that button FINISH is just a text..and the user can not really tell its a BUTTON...do to the fact it does no act lik a button unless you actually click it. When you mouse over it...it seems like it is just text...the arrow point does not convert to a hand, like all other links.

What can I do about maybe making this lil FINISH button bigger....or maybe a have different Text I.E. (click here to Finish)

I really need to fix this...im losing maybe users by the hour...

I went to my register.php

I could not find anything in there to fix the problem

Thank you





244867
wimvos
Re: New Hosting Provider Wanted
  • 2004/7/22 13:11

  • wimvos

  • Just popping in

  • Posts: 2

  • Since: 2004/7/22


For a good host reach out and have a look around you, in Netherlands for instance. Distance is no object these days.
translate with Babelfish if need be:

. 100 MB diskspace
. free domainname
. 2 GB data trafic
. 10 pop mailboxes
. scripting (PHP, Perl, CGI) and two MySQL databases
. fast internet connection
. 100% niet-tevreden-geld-terug-garantie
. excellent dutch support

visithttp://www.globalgeniusmanagement.nl and click on:
"Heb je genoeg van je Gratis host?"



244868
OpMama
Re: 2 Newbie Questions!
  • 2004/7/22 13:04

  • OpMama

  • Just popping in

  • Posts: 10

  • Since: 2004/7/22


Thank you from here too, that just saved a lot of newbie pain!!



244869
OpMama
Re: Homepage
  • 2004/7/22 13:00

  • OpMama

  • Just popping in

  • Posts: 10

  • Since: 2004/7/22


Chapi, related question - how do I have two "module free pages" - I want a start page and a second page where I can customize the center text, have blocks on the side columns. I have a top page and module pages, I assume I need to duplicate the top page, but I'm not sure which files in the main directory that involves (sorry, total newbie!!). Be gentle in your answers, I'm VERY new to playing in code .

Thank you!

(Love Tiny Content by the way).



244870
OpMama
Block with changing text
  • 2004/7/22 12:53

  • OpMama

  • Just popping in

  • Posts: 10

  • Since: 2004/7/22


First, let me say that I'm having a lot of fun with Xoops. As a total "non-coder", I'm still managing to figure it out - thank you, thank you, thank you, to the community who is putting this together!

I want to know if there is a module/block available that will allow me to have a block of text that changes every xx seconds. What I want to do is put quotes from customers in a box, and have those quotes change every 30 seconds or so.

I suspect I just don't have the right language to find what I need in the search, I've managed to track down everything else I think I need. Very exciting, I thought I was going to be launching my business with a static site (ahh, where the search for a threaded forum tool can take you...)!







Login

Who's Online

142 user(s) are online (95 user(s) are browsing Support Forums)


Members: 0


Guests: 142


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits