Need some feedback please on a project

Discuss all aspects of programming here.

Moderator: The Mod Squad

Postby useless comment » Tue Jul 05, 2005 8:08 pm

Toby B. wrote:But like the $add_images, I need to have it work so that if there is no links to place there (such as front panel pinouts, etc.), it shows as or None...


like i said, i don't know php or the totality of the code but if i understand it properly could you not expand the php to encompass the whole html line and use an if statement to decide whether or not the line should be there?

so if there is nothing entered for front panel pinouts, that variable remains in it's initialized state($frontpanelpins = "unknown" or "null" or whatever). once you get to the point of whether or not to display the link, use if to check if $frontpanelpins has changed. if it has changed(hopefully to something useful and not just a " " space character) then you continue with your link code. if it remains the same or is blank then you just skip over the whole link section.

in a php source, does all explicitly written html get processed? when i mentioned expanding the php around the link i meant something like using php to write the whole link line. so instead of:

[fake code]
html + php: $variable :end php + html
[/fake code]

could you?:

[fake code]
php: insert html tag + $variable + html closing tag :end php
[/fake code]

you could make it into a seperate function or module. at that point in the code, send the variable to the function, have the function receive it as a value or data only so it can work on it in it's own temporary variable. the if decision statement in the function will decide whether to write out the link or just skip it and throw control back to where it left off. this is assuming php has functions and modules and has differing ways of sending arguments to them.
useless comment
Black Belt 1st Degree
Black Belt 1st Degree
 
Posts: 1344
Joined: Wed Mar 14, 2001 1:01 am

Postby Toby B. » Tue Jul 05, 2005 8:20 pm

I think this is going to have to hold off til MoboCop gets back... I am completely lost.... :roll:
Toby B.
Lead Mobo-fu Master
Lead Mobo-fu Master
 
Posts: 14277
Joined: Sun Dec 16, 2001 1:01 am
Location: Maine

Postby kltsin » Wed Jul 06, 2005 3:50 am

Toby B. wrote:This code is easy for me to understand since I wrote it. I am trying to make it easier for others who may or may not choose to assist me in building my site...

I think he means me
I can understand it just fine :)
kltsin
Black Belt 2nd Degree
Black Belt 2nd Degree
 
Posts: 2792
Joined: Tue Jun 29, 2004 9:05 am
Location: St. Augustine, Fl

Postby Toby B. » Wed Jul 06, 2005 5:08 am

kltsin wrote:
Toby B. wrote:This code is easy for me to understand since I wrote it. I am trying to make it easier for others who may or may not choose to assist me in building my site...

I think he means me
I can understand it just fine :)


You and who ever else Keith... :wink:
Toby B.
Lead Mobo-fu Master
Lead Mobo-fu Master
 
Posts: 14277
Joined: Sun Dec 16, 2001 1:01 am
Location: Maine

Postby Toby B. » Wed Jul 06, 2005 6:24 am

ok I made a tiny bit of progress, but still not there yet...

Code: Select all
<?php
if ($add_images == None) {
   echo "None";
} else {
   echo '<a href\="$add_images"\>$ai_descript</a>';
   }
?>


http://www.ctechinfo.org/test/zz-top/zz-top.html

Now I just need to figure out how to ativate that link... Another 12 hours of playing with code I might actually get it..... :roll:
Toby B.
Lead Mobo-fu Master
Lead Mobo-fu Master
 
Posts: 14277
Joined: Sun Dec 16, 2001 1:01 am
Location: Maine

Postby useless comment » Wed Jul 06, 2005 8:09 am

i think that's about as far as i'll be able to try to help in this situation(unless i go take a php course in that place with all the books and hot chicks).
useless comment
Black Belt 1st Degree
Black Belt 1st Degree
 
Posts: 1344
Joined: Wed Mar 14, 2001 1:01 am

Postby Toby B. » Wed Jul 06, 2005 8:23 am

No problem, I do appreciate the help.. MoboCop should be able to tell me what I am doing wrong when he gets back...

Till then I will just continue to blow up code... 8O
Toby B.
Lead Mobo-fu Master
Lead Mobo-fu Master
 
Posts: 14277
Joined: Sun Dec 16, 2001 1:01 am
Location: Maine

Postby kltsin » Wed Jul 06, 2005 8:54 am

Okay I see this in the template1.tpl
could it be a missing quote issue?
***************************
what about trying this
Code: Select all
   echo "<a href\=""$add_images"\">$ai_descript</a>"";

read somewhere about adding comas or periods but dont know what they do.
example of what i have seen
Code: Select all
   echo "<a href\="",$add_images,"\">$ai_descript</a>"";

wait im pulling this out my buttocks...
editted post so i can see side by side
Last edited by kltsin on Wed Jul 06, 2005 7:30 pm, edited 1 time in total.
kltsin
Black Belt 2nd Degree
Black Belt 2nd Degree
 
Posts: 2792
Joined: Tue Jun 29, 2004 9:05 am
Location: St. Augustine, Fl

Postby kltsin » Wed Jul 06, 2005 9:17 am

never mind about that... i was looking at wrong thing... duh

where do you have $ai_descript setup.. I didn't see it anywhere else..
kltsin
Black Belt 2nd Degree
Black Belt 2nd Degree
 
Posts: 2792
Joined: Tue Jun 29, 2004 9:05 am
Location: St. Augustine, Fl

Postby Toby B. » Wed Jul 06, 2005 6:20 pm

$ai_descript is a new addition to the zz-top test page. It referers to $add_images description (shortened of coarse)...

But what about this when I dl the whole page (as if I didnt have admin access) here is what shows.
I was messing around with the code all morning before work. Got it partially working as you can see, but its still not right..

I have referrenced all the books I can to figure this one out and still not figured it out.. :roll:
Toby B.
Lead Mobo-fu Master
Lead Mobo-fu Master
 
Posts: 14277
Joined: Sun Dec 16, 2001 1:01 am
Location: Maine

PreviousNext

Return to Programming

Who is online

Users browsing this forum: trendictionbot [Bot] and 2 guests

cron