@@ -95,27 +95,49 @@ function tootpress_paint_image($tootid){
9595 }
9696
9797 $ image_html .='"> ' ;
98- $ image_html .='<img ' ;
99- $ image_html .='src=" ' ;
100- $ image_html .=tootpress_get_url_image_directory ();
101- $ image_html .=$ toot_image [$ i ]['attachment_file ' ];
102- $ image_html .='" ' ;
103- $ image_html .='alt=" ' ;
104- $ image_html .=$ toot_image [$ i ]['attachment_description ' ];
105- //$image_html.='" ';
106- //$image_html.='width="';
107- //$image_html.=$toot_image[0]['attachment_width'];
108- //$image_html.='" ';
109- //$image_html.='height="';
110- //$image_html.=$toot_image[0]['attachment_height'];
111- $ image_html .='" /> ' ;
98+ $ image_html .=tootpress_create_image_tag ($ toot_image [$ i ]['attachment_file ' ],$ toot_image [$ i ]['attachment_description ' ],$ amount_of_images ,($ i +1 ));
11299 $ image_html .='</div> ' ;
113100
114101 }
115102
116103 return $ image_html ;
117104}
118105
106+ /**
107+ * Create the Image Tag
108+ *
109+ * @since 0.5
110+ *
111+ * @param string Image File Name
112+ * @param string Image Description
113+ * @param int Amount of Images
114+ * @param int Image Number
115+ * @return string Image Tag
116+ */
117+
118+ function tootpress_create_image_tag ($ filename , $ description , $ amount_of_images , $ image_number ) {
119+
120+ $ image_tag ='<img ' ;
121+ $ image_tag .='src=" ' ;
122+ $ image_tag .=tootpress_get_url_image_directory ();
123+ $ image_tag .=$ filename ;
124+ $ image_tag .='" ' ;
125+ $ image_tag .='alt=" ' ;
126+ $ image_tag .=$ description ;
127+ //$image_tag.='" ';
128+ //$image_tag.='width="';
129+ //$image_tag.=$toot_image[0]['attachment_width'];
130+ //$image_tag.='" ';
131+ //$image_tag.='height="';
132+ //$image_html.=$toot_image[0]['attachment_height'];
133+ $ image_tag .='" /> ' ;
134+
135+ $ image_tag =tootpress_image_filter_apply ($ image_tag ,$ amount_of_images ,$ image_number );
136+
137+ return $ image_tag ;
138+
139+ }
140+
119141/**
120142 * Creates the Elephant
121143 *
@@ -157,7 +179,7 @@ function tootpress_paint_elephant( $instance, $account, $mastodon_id, $backlink)
157179 *
158180 * @since 0.5
159181 *
160- * @param string Date (Format: )
182+ * @param string Date
161183 * @return string html
162184 */
163185
@@ -179,7 +201,7 @@ function tootpress_paint_date($date) {
179201
180202 }
181203
182- $ date_html. ='<div class="toot-date"><p> ' .esc_html ($ date ).'</p></div> ' ;
204+ $ date_html ='<div class="toot-date"><p> ' .esc_html ($ date ).'</p></div> ' ;
183205 return $ date_html ;
184206
185207}
0 commit comments