werushka
Members-
Posts
94 -
Joined
-
Last visited
Everything posted by werushka
-
this is the link t('ETİKET') for img what should I change it to ????
-
I have a line like this it prints text link but I prefer image link how should i edit it I would appreciate some feedback $templates['etiket'] = array('name' => t('ETİKET'), 'module' => 'uc_invoice_pdf', 'path' => $templates_uc_invoice_pdf_path, 'pdf_settings' => $pdf_settings);
-
I tried this and is working perfect, I really appreciate your help guys <?php if (substr($product->title, 0, 2) == "01"){ echo t('Earring');}?>
-
yes
-
I appreciate your fast reply I have written this but gave me white screen of death, I couldn't understand why <?php if (substr($product['title'], 0, 2) == "01"){ print "Earring";}?>
-
I have a code which I made just up <?php if ($product->title == '01'); print "Earring"; ?> <?php if ($product->title == '02'); print "Necklace"; ?> <?php if ($product->title == '03'); print "Necklace"; ?> <?php if ($product->title == '04'); print "Ring"; ?> I just want to check the product titles first 2 characters and print according to that. Example: If $product->title is "01DSE32" print Earring. This checking must be strgn or something like that which I don't remember. I would appreciate some feedback.
-
thank you very much litebearer the following code works perfectly <?php foreach ($order->products as $product) { $my_array[] = $product->model; } $max_columns = 4; /* set max columns for table */ $i = 0; /* initially set counter to use in starting and ending rows */ ?> <table border ="2"> <?php $total_cells = count($my_array); /* count total cells to be displayed */ $total_rows = ceil($total_cells / $max_columns); /* calculate total rows needed */ $junk1 = $total_rows * $max_columns; /* calculate number of empty cells in last row */ $junk2 = $junk1 - $total_cells; if($junk2==0) { $last_row = "</tr>"; }else{ $j = 0; while($j<$junk2){ $last_row = $last_row . "<td></td>"; $j ++; } $last_row = $last_row . "</tr>"; } $x=0; while($x <$total_cells) { /* begin looping thru the results */ if($i == 0){ echo "<tr>"; $i ++; } ?> <td><?php echo $my_array[$x]; ?></td> <?php $x ++; $i ++; if($i > $max_columns) { /* check if need to close row */ echo "</tr>"; $i=0; } } echo $last_row . "</table>"; /* clean up last row */ ?>
-
I have simplified my code <?php { foreach ($order->products as $product) { echo $product->model; }}?> this code alone gives me all the products in the DB. in a single raw. But I need to implement this to only this code $my_array = array ("123","456","789","101","222","879","245","908","12345","2468","9922"); but I don't know how to make my line of code implemented to my_array
-
anyone pleasee I still couldnt solve this
-
thanks for the code but I wasn't even able to modify the one that jcbones given to me. This seems even more confusing
-
I think I come this far but still can't solve it : <table border="0" cellspacing="5" cellpadding="5"> <?php if (is_array($order->products)) { $context = array( 'revision' => 'formatted', 'type' => 'order_product', 'subject' => array( 'order' => $order, ), ); foreach ($order->products as $product) { $price_info = array( 'price' => $product->price, 'qty' => $product->qty, ); $context['subject']['order_product'] = $product; $context['subject']['node'] = node_load($product->nid); ?> <?php; $i = 0; echo ($i != 0 && $i < 4) ? NULL: '<tr>'; foreach(explode('<tr>',$product->model) as $value) { echo '<td>' . str_replace('<br />','',$value) . '</td>'; if(++$i == 4) { echo '</tr>'; $i = 0; } } echo ($i != 0 && $i < 4) ? '</tr>' : NULL; ?> <?php } }?></table> The out put is <table border="0" cellspacing="5" cellpadding="5"> <tr><td>SKU: 123</td></tr> <tr><td>SKU: 322</td></tr> <tr><td>SKU: 444</td></tr> <tr><td>SKU: 555</td></tr> <tr><td>SKU: 666</td></tr> </table> but it supposed to be <table border="0" cellspacing="5" cellpadding="5"> <tr><td>SKU: 123</td> <td>SKU: 322</td> <td>SKU: 444</td> <td>SKU: 555</td></tr> <tr><td>SKU: 666</td></tr> </table>
-
thanks for your fast reply but it gives an empty page
-
I am editing code to get sku numbers, for now it just prints as below: SKU: 123 SKU: 322 SKU: 444 SKU: 555 SKU: 666 I want to put them in columns so it prints as: SKU: 123 SKU: 322 SKU: 444 SKU: 555 SKU: 666 etc. etc. So it is devided into 4 columns. The code that controls is: <?php if (is_array($order->products)) { $context = array( 'revision' => 'formatted', 'type' => 'order_product', 'subject' => array( 'order' => $order, ), ); foreach ($order->products as $product) { $price_info = array( 'price' => $product->price, 'qty' => $product->qty, ); $context['subject']['order_product'] = $product; $context['subject']['node'] = node_load($product->nid); ?> <?php echo $product->model; ?><br /> <?php } }?> i would appreciate some help
-
I am new to php and I need to write this code simpler..I would appreciate any help function my_module_form_alter(&$form, &$form_state, $form_id) { if ($form['field_age_value']) { $form['field_age_value']['#type'] = "select"; $form['field_age_value']['#options'] = array(All=>"<All>",32=>"32",33=>"33"); $form['field_age_value']['#default_value'] = No; $form['field_age_value']['#size'] = null; } if ($form['field_burc_value']) { $form['field_burc_value']['#type'] = "select"; $form['field_burc_value']['#options'] = array(All=>"Farketmez",Akrep=>"Akrep",Yay=>"Yay",Oglak=>"Oğlak"); $form['field_burc_value']['#default_value'] = No; $form['field_burc_value']['#size'] = null; } }
-
In browser address bar the ? and = replaced by %3D and %3F
werushka replied to werushka's topic in PHP Coding Help
I have tried with the special charaters thing and this does not seem to work. -
In browser address bar the ? and = replaced by %3D and %3F
werushka replied to werushka's topic in PHP Coding Help
thanks for the fast reply actually that spacial charaters is a problem generated when posting here. There is no special characters. Your code is the same as mine. <?php if (!(arg(0) == 'node' && arg(1) == 'add' && arg(2) == 'ilan' && arg(3) == '?' && arg(4) == 'destination' && arg(5) == '=' && arg(6) == 'frontpage')) { print "<div id='ilan'>". l('ilan ver !', "node/add/ilan?destination=frontpage") ."</div>"; } ?> -
In browser address bar the ? and = replaced by %3D and %3F
werushka replied to werushka's topic in PHP Coding Help
sorry for the late reply <?php function l($text, $path, $options = array()) { global $language; // Merge in defaults. $options += array( 'attributes' => array(), 'html' => FALSE, ); // Append active class. if (($path == $_GET['q'] || ($path == '<front>' && drupal_is_front_page())) && (empty($options['language']) || $options['language']->language == $language->language)) { if (isset($options['attributes']['class'])) { $options['attributes']['class'] .= ' active'; } else { $options['attributes']['class'] = 'active'; } } // Remove all HTML and PHP tags from a tooltip. For best performance, we act only // if a quick strpos() pre-check gave a suspicion (because strip_tags() is expensive). if (isset($options['attributes']['title']) && strpos($options['attributes']['title'], '<') !== FALSE) { $options['attributes']['title'] = strip_tags($options['attributes']['title']); } return '<a href="'. check_url(url($path, $options)) .'"'. drupal_attributes($options['attributes']) .'>'. ($options['html'] ? $text : check_plain($text)) .'</a>'; } ?> -
I have code like this <?php if (!(arg(0) == 'node' && arg(1) == 'add' && arg(2) == 'ilan' && arg(3) == '?' && arg(4) == 'destination' && arg(5) == '=' && arg(6) == 'frontpage')) { print "<div id='ilan'>". l('İLAN VER !', "node/add/ilan?destination=frontpage") ."</div>"; } ?> well this is causing me some problems and breaking the link. The link shows as node/add/ilan%3Fdestination%3Dfrontpage. The "?" and "=" is replaced by %3D and %3F. How can I fix this error. I would really appreciate some feedback. Thanks
-
Finding words in a given site and replace them to links
werushka replied to werushka's topic in PHP Coding Help
samshel actually you totally got it the onlyting is that the owner of the site will be putting a simple javascript to their .html so than I think I will solve "Initial case is not possible as u cannot write to pages of a website that does not beling to you" this problem. -
Hi, I want to get some feedback/suggestions about bot that can search a specific site and find a specific word like "TvScreens" and convert them to links and landing page can be set by me. I would appreciate some feedback.
-
I am trying to find Sum of odd numbers from 1 to 100 I have the following code which I came up so far but can't figure the rest <?php for($n=0; $n<100; $n++) { if ($n % 2 != 1) { continue; } echo "$n"; } ?> I would appreciate some help
-
thanks anyway I tried it but no luck in my side
-
thanks for your reply like as far as i learned I know how to output div tag in a code like <?php echo "<div="test"></div>" ?> as follows but in here I can not use echo or print.
-
Hi I am new to PHP i have code that I am trying to edit, the code is below. function phptemplate_views_view_table ($view, $nodes, $type) { $fields = _views_get_fields(); foreach ($nodes as $node) { $row = array(); $row2 = array(); foreach ($view->field as $field) { if ($fields[$field['id']]['visible'] !== FALSE) { switch ($field['field']) { case 'pic'; $cell['data'] = views_theme_field('views_handle_field', $field['queryname'], $fields, $field, $node, $view); $cell['class'] = "view-field ". views_css_safe('view-field-'. $field['queryname']); $row[] = $cell; break; case 'title'; $cell['data'] = views_theme_field('views_handle_field', $field['queryname'], $fields, $field, $node, $view); $cell['class'] = "view-field ". views_css_safe('view-field-'. $field['queryname']); $row[] = $cell; break; case 'totalcount'; $cell['data'] = views_theme_field('views_handle_field', $field['queryname'], $fields, $field, $node, $view); $cell['class'] = "view-field ". views_css_safe('view-field-'. $field['queryname']); $row[] = $cell; break; case 'name'; $cell['data'] = views_theme_field('views_handle_field', $field['queryname'], $fields, $field, $node, $view); $cell['class'] = "view-field ". views_css_safe('view-field-'. $field['queryname']); $row2[] = $cell; break; case 'subscribe'; $cell['data'] = views_theme_field('views_handle_field', $field['queryname'], $fields, $field, $node, $view); $cell['class'] = "view-field ". views_css_safe('view-field-'. $field['queryname']); $row2[] = $cell; break; } } } $rows[] = $row; $rows[] = $row2; } return theme('table', $view->table_header, $rows); } What I want to do is group row and row2 so that it sits inside div class=rowgroup and give div id tags to "pic","title","totalcount","name", "subscribe" If i can understand this it would be great for me so I can start to theme by trial error. Thanks
-
Thanks avon for the feedback...I rather make thing simple. Finally I have decided that I will choose google as they do the best in indexing. I have made a search query as follows allintext: "Jan,28 2009" | "28 Jan 2009" | 28 Jan 2009" |"1/28/2009" | "1/28/09" | "1/28/2009" | "1.28.2009" | "2.2.2009" "Tom Hanks" site:imdb.com this query pretty much gets the result for tom hanks in imdb for that specific date...The query is not perfect and can be narrowed. I need to make a script or some sort that sums the total number of links that Google finds for the above query and store in a database. I would appreciate some feedback.