|
|
楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////
. v8 ]( ^& O3 y& b8 E9 j5 Q( U// Theme Option5 K @ C2 F- a- S; N6 E
////////////////////////////////////////////////////////////////////////////////
' y7 |) ^3 p& W8 `, {( ]0 R m/ v$ q# f# } F. M$ R; U: v
$themename = "Zenx";
' R1 B, b8 j0 n% m$shortname = str_replace(' ', '_', strtolower($themename));0 ^& h: M; @( O; K x
6 Z0 {, X; L+ y$ _! R3 W8 M+ zfunction get_theme_option($option)
$ Q8 T: s$ t3 M' G% D$ \ N1 c{9 S3 Z% Z8 t6 K
global $shortname;
9 U- s9 H/ l, x return stripslashes(get_option($shortname . '_' . $option));
2 e) U! l7 {+ i# F L4 H9 V. ^}
/ d1 |; ?% G4 U% D: D6 `$ S: U9 ^! p, h; |3 W( Z+ \
function get_theme_settings($option)
3 J: l* G0 J N% {) C2 [1 k2 V{
- O5 u! t2 P$ T+ e, y return stripslashes(get_option($option));
& t' {2 v: n. P F9 a}
- k4 _5 }7 \; B ~% E$wp_dropdown_rd_admin = $wpdb->get_results("SELECT $wpdb->term_taxonomy.term_id,name,description,count FROM $wpdb->term_taxonomy LEFT JOIN $wpdb->terms ON $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id WHERE parent > -1 AND taxonomy = 'category' AND count != '0' GROUP BY $wpdb->terms.name ORDER by $wpdb->terms.name ASC");
+ Y( {) [' h. b" ?$wp_getcat = array();) B0 Y( H/ ~! e
foreach ($wp_dropdown_rd_admin as $category_list) {
/ j" M w8 {8 @; v0 C$wp_getcat[$category_list->term_id] = $category_list->name;
( \! Y; k# S; Q2 s2 a* S% M}
0 k6 ], [* K3 Y$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");2 ]. F W- g' W& O5 o4 _8 s
$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");9 C. T8 c/ V5 U$ o8 Y7 ]
$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");$ o: ^3 P& h. l. O
, l2 _- @3 I/ i
$options = array (
1 [- ?" g% [; z* R* ` }; o" L* p1 j5 L0 M }
3 \6 v! F: I7 B
array( "name" => "Blog Header Settings",1 B2 U1 I E3 X
"type" => "heading",
6 [6 P: y4 M; q1 `; V9 d5 a* \ ),
6 } _9 d3 ~, m) J! d
, `8 G6 _, C0 g array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",2 R1 x% L" J( V# ?8 x" v$ F& i
"id" => $shortname."_header_logo_activate",) \5 f8 d6 r, a' F( Q' u
"type" => "select",) q- j+ y7 Z# A1 y
"std" => "No",
$ V4 @7 s" W9 q) s% z "options" => array("No", "Yes")),
# [$ F( w& R+ @- c4 h/ m
1 i. Z8 C" b: E; Z' H% G9 K' x array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",7 `4 V9 m. Y. D" v0 E r. D
"id" => $shortname."_logo_url",7 k! d7 o6 ]7 n# |. W( [# f
"type" => "text",
3 J& Z+ B# t- C/ f "box" => "social",$ q: |+ m4 i7 t9 Y9 p8 N+ Q9 B
"std" => "",
3 v! f0 | E( n: v5 U9 w ),9 M: t6 H, ^% ?4 i1 U, p4 r
3 l& F1 K# ^+ N6 j4 E
array( "name" => "Insert Header Banner HTML Code (Header)
i( o, V3 P; F4 t, K$ M. c, Q& b6 U8 C <br /><em>*Recommended Size 468 x 60</em>
$ m( a) V" c) j1 L$ o2 R <br /><em>*leave blank if not use</em>",1 }2 n5 A9 ]" |# x- r, ?
"id" => $shortname."_header_banner",
" w U7 d# ^( G Q7 t( y" T4 o0 G "type" => "textarea",
8 ~5 ?6 I' J4 b% F" y& C5 I1 [4 f "std" => "",
( W8 v. Y" h7 \ i. _6 R ),1 G% ^) [9 n5 @' K4 V. M/ r7 {
0 S4 Q: h$ y9 W4 ]' a) x0 _& Y+ E
array( "name" => "</div></div>",
}; ^8 U5 {; O) f( M "type" => "close",
1 @* [' i l. m: E F% Z ),
/ S: s! w1 i1 W9 A* y3 U$ W' P! W5 ~' \8 r' U. Y
- q' @" q, L+ n1 z, @. O
array( "name" => "Header Navigation Settings",' s# A% I* S: E) o
"type" => "heading",( U1 w# U* O' q# \" X' K
),4 H7 O$ [- c. Q
7 B/ {% V* |9 n; D2 B" M0 P4 ]
array( "name" => "Insert Page ID To Exclude On Header Navigation<br />
2 D7 n% P, V8 o0 f! m" [ <em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />
3 k: ^ s7 T' b; I4 K& f: [ <em>*Enter the page post ID number only</em><br />
- o, D8 \4 H, n7 \9 C% q' B <em>*separate by comma</em><br />5 L+ A/ e; x# `5 A0 z$ O% b
<em>*Exclude pages which you don't want to show on the header navigation</em>",
N) o1 ~% H' P3 c "id" => $shortname."_header_page_navigation",, C v% L3 k5 q/ l* h
"type" => "text",
( G+ X7 e" i( N, R; w# Z "std" => "",9 W' r! G- _8 ~
),* p: M, ^6 [* O2 q# S
% q* z5 m6 U, z- f array( "name" => "</div></div>",
8 z. H4 s$ m. h5 ?' Z: t "type" => "close",
) p2 S- u' b) | U" x- M ),1 F0 N! B* p: @) t9 c- X
/ U" \! _' H {; f0 I9 O D
8 G0 D3 @ C% E" D/ e( t array( "name" => "Post Auto Thumbnails Settings",+ k% P: G) K6 L" W
"type" => "heading",% b% V8 D6 D3 ?6 c! @7 b& j
),
2 u% k, @6 B: W& q/ O6 B: J/ F6 F 8 @% P9 Y! O. l* \8 Z2 N; M
array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",+ s3 J3 o9 ~. Q u/ k, u, r4 e/ W
"id" => $shortname."_timthumb_activate",& ~8 t7 X+ t0 s6 B' q
"type" => "select",( A7 T+ [; M- M% i2 ~9 a
"std" => "No",
$ H* G3 G$ _$ U" u! r& c "options" => array("No", "Yes")),3 ^9 g& P; E& k; C: H6 F
: t, R: ?" }/ [; I0 V- e
array( "name" => "If Timthumb is enabled, Please choose its cropping method",
/ I9 O8 J; \; ] b9 J "id" => $shortname."_timthumb_cropping",) j/ Y0 G) k+ n, c' M* e, z
"type" => "select",
3 w# A, i# T* D$ k "std" => "",
& f2 W$ C- O2 F% c7 G+ W' c9 o "options" => $crop_position),
6 K8 n/ Q# k* v: \* e; ?3 g2 a" h5 c/ L2 [! j3 W! z; ~
array( "name" => "Insert Width Of Thumbnail Image<br />% N8 v0 `7 R7 Z1 p* p: Q
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />7 G2 B2 T# [6 i( o" S9 d0 D" k- p. ^7 t( |
<em>*Leave Blank To Use Default: 250</em><br />",
7 ^9 B/ l1 |+ _1 j2 J1 U, ~ "id" => $shortname."_thumb_width",
8 l {) j% g4 F7 Z/ B "type" => "text",
6 E; k4 P* C. | "std" => "",
" _# e ~5 ?9 I9 q ),
0 |. ~2 A o7 E. _- A
9 `2 c# X2 n @4 ^ array( "name" => "Insert Height Of Thumbnail Image<br />2 j6 n `3 q: ~
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
; B( ?7 P" n' {% I2 [) b <em>*Leave Blank To Use Default: 200</em><br />",* X: v& L( x2 T6 O9 ?
"id" => $shortname."_thumb_height"," s* }! y$ }$ E8 Q0 E) }
"type" => "text",- |2 A. I$ K3 i: r* F% Y2 @9 K" J
"std" => "",' y0 W* ^% U) W
),* C! z8 @% E/ O3 o2 S |
9 ^9 r6 Y8 ]$ }" s ?! ^
array( "name" => "</div></div>",2 {$ ?6 [9 Y: l
"type" => "close",
: e7 I/ ]5 K# @* g, C h# q ),
' `# K% F i$ H0 v7 i
# ?6 O' ]% _( }" u" j& @/ Y9 L array( "name" => "Featured Content Slider Settings",
; l8 b0 e$ R4 p. } "type" => "heading",
. k, @3 P* `: j3 q ),
1 A# {. X. d# u* q- l; k8 k
1 \0 e9 c/ v3 r8 T! J/ _( ]4 P array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",1 d* J: n9 I5 @5 [( {
"id" => $shortname."_featured_activate",
1 x' {/ O1 Q! h1 W3 C& K "type" => "select",& b* A% w0 L3 b7 Q- E" x
"std" => "No",& x1 E0 ^5 c8 F4 M4 o- h2 \
"options" => array("No", "Yes")),% x# C4 W0 D- W3 F4 ^! D$ U
' D; C% i. v4 T2 P2 S
8 \$ x5 t' ]& c* f# k array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",
" o8 i0 E/ G1 P, B: S8 h9 N "id" => $shortname."_featured_category",
1 i4 X1 a2 |6 k d( i7 x "type" => "select",
7 n: ]$ `0 y) K. |" K! C7 x "std" => "Choose a category:",
3 E8 u8 b" }( o" d( j/ Q) f "options" => $wp_getcat),/ Q( x( T7 j/ a% m. u" T5 a- e) F
" \# G7 q2 x* f4 |0 B: ~
array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",
+ ?6 q2 D' M8 T; Y+ Z% K h) i# I! J "id" => $shortname."_featured_number",+ E6 e% R8 [% a
"type" => "select",
) R. X; v4 S. |2 z& `; |8 o" y "std" => "Number of post:"," h$ e7 E+ R; r5 E8 L2 A6 ?! ^/ ^+ T
"options" => $number_entries),
6 H3 r. b8 {8 L5 y, \3 |. h# t; p- d1 B) \
array( "name" => "</div></div>",
5 R" t) z/ a4 Q6 i "type" => "close",
- F8 W7 R7 Z( x# f9 W- F: ~& F ),
$ g3 p1 G. K6 s; d _# D; H% ]9 z. e 3 J' }! i1 w6 K6 V% R8 [
array( "name" => "Featured Category Settings",
: C4 ?0 l6 _3 I8 \4 z" l0 } "type" => "heading",
0 ]2 x" v$ U4 Q! ^ m9 S ),
' @" R0 D5 w& W+ d9 s/ Q
. E# I; Z7 p+ D. }" U* F array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",# \& z) f; ~+ _8 ~. k* i
"id" => $shortname."_featured_category_activate",
. D/ D' F3 L) A7 k( m "type" => "select",
: x9 _) p: I1 ]- I) N- ?& m$ N "std" => "No",+ ^2 H) Y A- E1 T0 @5 e' G' c
"options" => array("No", "Yes")),
8 H ~" d& d( C6 \2 D
+ m+ C/ ]' Q5 K$ I+ h array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",
5 m8 l' C* c9 {% q) e# r "id" => $shortname."_featured_category_id1",$ [4 E; M1 w3 T+ d% y0 Z
"type" => "select",8 R- r8 r2 q* t* r
"std" => "Choose a category:",3 O8 {6 X: k/ r3 K" \* Q% T& @
"options" => $wp_getcat),6 W4 }: k+ z u4 M0 P. R3 Y. }
& T. ~# J( ~4 C5 w
array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",
" e1 i3 V5 o( h k1 D' b "id" => $shortname."_featured_number1",& {+ }+ B( n! P2 {
"type" => "select",
8 A! e+ B0 a5 I, y; s- H2 N "std" => "Number of post:",
' }9 E0 z0 o3 W- C5 `, Z "options" => $number_entries),
) P& H/ ~* g& R$ Q1 u
# T/ D- M) [3 E" F2 k array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",7 C+ x7 m$ s2 b8 U
"id" => $shortname."_featured_category_id2",# A5 P3 b" y0 `% |
"type" => "select",/ L; C) q o. g: C l- X# v, M
"std" => "Choose a category:",
% a( i8 I: j2 T' Y0 h, k- m "options" => $wp_getcat),, j A2 T# H* `/ ~. G- |
- k, D9 r/ M8 p6 I, C' {
array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
0 \9 i6 K+ \" z5 d+ R "id" => $shortname."_featured_number2",
& f. \) [! n! G2 O% v6 d: L5 z7 ]! ? "type" => "select",
( y7 R- J/ ]7 P: F5 F; z "std" => "Number of post:",& s* K% f* P7 L9 Y: |: y; Z
"options" => $number_entries),8 Y' d9 Q8 Q% k/ Q( \7 f- M
9 G' Z, t" D0 t, D# ] ) b! b! ]7 f) w2 i, g, I/ h3 _: n
array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
6 n( |/ I; B2 L. H q6 B m; E" j "id" => $shortname."_featured_category_id3",% x+ k3 c3 t. \5 |
"type" => "select",/ \6 [4 g3 b7 S1 ^* S- s- H
"std" => "Choose a category:",
/ x; i; o" G, u6 N1 ~ "options" => $wp_getcat),
) `7 O0 s& e; e8 G; C; c4 g * x3 e- D) v! ~6 \) c, E. S0 r2 }
array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
4 Z9 H, l- R: d+ @) ^( U "id" => $shortname."_featured_number3",! S+ C! C- Q& o8 G
"type" => "select",
& d+ Q) j0 S8 {% g( `& ^" c "std" => "Number of post:",8 R! K. G8 _. M0 o
"options" => $number_entries),5 \% g! h: O/ g
! r6 O5 X; z8 ]7 q/ ]: l' H; J) ^
1 e" w) t! X6 n8 e; C array( "name" => "</div></div>",3 J3 Y( ?' N+ t; h* k& [
"type" => "close",
- a# |# D* Q5 m0 W* L ),
5 E, S$ S3 O0 D# ?: [4 d' w+ X2 Q# X' v5 k2 J0 r7 M
& ~6 H7 c {/ w4 V' @* y& J
array( "name" => "Google Adsense & Analytics Settings",8 A2 U m* x5 K$ P. r) X4 f/ J e; Z& \, O
"type" => "heading",
' Z# f6 B% K3 R2 U5 R ),
8 l1 P6 ~8 {: @7 |: b) v+ G( J3 y) [5 k5 U& I# ?
array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",
2 N, s, ?9 P9 l% l( j "id" => $shortname."_adsense_loop_activate",
" k* s$ x# Q" `: N, K1 x "type" => "select",
& N/ B6 P# ?' A# e, j& m "std" => "Disable",: z' O9 L& O! {: n" @* z# x1 w: U
"options" => array("Disable", "Enable")),
- q$ t; G& O, h6 j) A
' \) u' c4 ?: ^ array( "name" => "Insert Google Adsense Code For Loops Here<br /># t% `5 r O6 P- V; f
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
+ h7 s4 e& f% P, L! s8 x5 M "id" => $shortname."_adsense_loop",
* b: W% k* f8 J "type" => "textarea",5 e, c& J. [8 P3 p% a
"std" => "",' p) G4 C% k7 W/ K% f' G
),
; e" V. ^6 l5 w3 C5 Y7 t. [! d/ H- ^
array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",8 i" g( S3 ?! S; w' I
"id" => $shortname."_adsense_single_activate",( M% D( J8 k- i' \: p3 O
"type" => "select",
; O) A/ E v, k+ v "std" => "Disable",
, g2 k- ^ d' A "options" => array("Disable", "Enable")),
* B/ g7 ?' I9 I/ S
4 y9 l! ]+ F' i& b' W array( "name" => "Insert Google Adsense Code For Single Page Here<br />4 A7 _8 u5 }8 @
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",+ N9 }: P9 k3 Z. n3 W% b
"id" => $shortname."_adsense_single",1 P( q9 C; m% H8 A' ^
"type" => "textarea",
2 E$ F4 Y, m$ v+ T% Q1 f "std" => "",7 }* A, M( P6 H- r
),
. z: K. J& k0 t4 A2 K, z) O3 \+ r
: X& B/ j/ V& z1 i array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",8 e* g& C! K4 [7 G0 L- z
"id" => $shortname."_google_analytics",
2 ^' x1 A2 n# Z "type" => "textarea",! t7 m1 I7 ~/ j
"std" => "",3 ~$ M' D0 C9 m, }+ w# u
),$ N; Z+ e+ o2 Q. x j) G* q% ?- C
# q1 n3 R! k- ^2 r array( "name" => "</div></div>",- [; h& e. ~) P% ?8 @! y
"type" => "close",
' l* p- M/ o, `5 i) z% N ),: F \3 V! [6 x
+ K9 z% p% T# |$ O5 [* D
; o2 ?! ^: S: v" c5 K- Q array( "name" => "AddThis Social Bookmarking Settings",9 j' y/ C% }- d- A
"type" => "heading", |5 T2 `& Z! C% y: J% ?( N j
),
2 X) H) I, a; y/ X
6 _2 k* Q- J- E; C8 n array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>
8 N* ^, Y; Y* @/ P+ U <br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",
' Z0 {9 d6 B+ z& q, P$ q; } "id" => $shortname."_addthis",
0 ~2 ~$ z$ V! j5 `/ |$ P "type" => "text",
9 T1 M& X$ x4 Y% h$ C& g8 L "box" => "social",
! @( C$ w8 h5 |. a U9 n: Z9 o "std" => "",
9 H7 m) @, ]3 M ),
2 Q) p$ y) R9 V z8 A: s9 P) M; F/ V+ f$ j# c O
array( "name" => "</div></div>",
4 N7 {+ i5 p* g: ~0 _ "type" => "close",
/ c8 S3 H$ x* \2 [ ),( n f C, U" ]7 n- ?
, w" o, f$ G4 o/ ?+ _# v. z
& B3 Z b: |1 w/ o$ x H' D
6 ` f6 I! k4 ? b/ L array( "name" => "YouTube Video Settings",) v# X: C% N1 A
"type" => "heading",
6 q' D% J+ i: s% y( H: c ),
9 m- G/ L2 W8 f( Z2 ~# g5 M) d, l1 i1 i i
array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",' }$ z& T5 }( h! _
"id" => $shortname."_emvideo_activate",0 I" U, [4 _- o* l' y1 Q" s
"type" => "select",3 z- F6 g9 i3 y/ t0 ]
"std" => "No",1 Q% y# A5 m- n& D7 G; T
"options" => array("No", "Yes")),& W- ]$ I6 ]0 c# z$ g8 [: O' a
, M* {* n: H3 s" {5 b+ b" A5 Q" L array( "name" => "Insert YouTube Video Unique Code<br /><em>*You can find videos to embed on <a href=\"http://www.youtube.com\" target=\"_blank\">YouTube</a> site.</em><br /><em>i.e. Youtube - http://www.youtube.com/watch?v=<span class=\"redbold\">Hr0Wv5DJhuk</span></em><br /><em>*Only Insert The Red Bolded Code Inside Below Setting Box.</em>",2 r: X; ^) Q9 Y# K4 w! \
"id" => $shortname."_emvideo",, g; }) Y q9 _6 G# \* y$ |
"std" => "",, V/ q; p; _4 [
"type" => "text"),
B {' s$ S9 \0 d# D- P4 m Y. x$ O" \# `1 g% ], J
array( "name" => "</div></div>",' U! k# \+ O5 X) Z/ w
"type" => "close",! P4 z! o2 S# _: p
),7 J1 p8 P& i/ {7 h4 Q) V2 W* L
9 ^) g& O2 H% Y4 l: x" k/ Y
array( "name" => "Twitter Settings",; ]+ B% B* ~; A K
"type" => "heading",) D' z6 X% z( I# u$ g
),
9 m2 y2 J1 M8 ~! f
2 Q$ R2 G; W1 r array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
@4 n2 i7 a, R* e6 t7 u n' i "id" => $shortname."_twitter_activate",
+ X% }, D( k/ _$ @" D$ V* J3 E "type" => "select",; ^+ X$ d+ ?+ V! B
"std" => "No",
2 k$ [9 H- \) k, ?9 I "options" => array("No", "Yes")),0 v! l- K6 g9 g
" z; I$ x/ t0 D: h( S
array( "name" => "Insert Your Twitter ID here2 `4 y3 r0 {5 | E6 {
<br /><em>*leave blank if not necessary</em>
2 q7 g1 Z) o X! h8 _0 T9 ]/ d <br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",
( g. {' n7 `8 r0 W2 N( H "id" => $shortname."_twitter",
% I/ M( ] J* b0 I5 D "type" => "text",
5 p# x9 @% Y8 i S0 A "box" => "social",
9 u4 w/ w( w. r4 }* V) l "std" => "",
! E! G/ F( e- B ),
. F/ x5 y- ]6 s& j( _4 K% f9 d4 U
9 D/ d2 d% L" b' o0 q. O array( "name" => "Enter Twitter Feed Count here
# z1 ]- ]! Z2 e. p( l( n) s <br /><em>*leave blank if not necessary</em>
. f+ m/ R1 q& O% E) ]9 E <br /><em>*Enter How Many Twitter Feed To Display</em>",
+ i1 m9 Y+ W+ B8 x& A+ R1 m6 L "id" => $shortname."_twitter_count",
: M) j8 |0 `% z "type" => "text",
) u6 |9 k. T T8 n "box" => "social",
3 Q" x. p( c% h7 h9 ~9 ^& f "std" => "",
8 p7 r% P/ T, x7 e- J; d( z ),4 M3 D! e( _, R0 ^
3 T/ U( e& q0 W
array( "name" => "</div></div>",/ M; k6 o/ e" g' s @, t0 k. m
"type" => "close",+ |& [' S" D: [2 I) p8 ?' ^
),* ]1 G* K3 {9 V- z' G3 r
) A( t( }: X! ]$ O, F0 F! r- f
- j2 L# o2 g7 ?5 [* G2 Z5 i1 |' Z9 u
array( "name" => "125 x 125 Banners Advertisement Settings",
2 y4 W _1 G1 d "type" => "heading",
9 L( P8 q# n# a; A ),
2 o& a' _8 h9 `! T7 \ 3 S6 w3 @ m2 k g9 H+ t. c
array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
9 q& J8 u/ c5 u: c, ]% u "id" => $shortname."_sponsor_activate",
% W: R2 \0 O/ p- n! [ "type" => "select",
& f& n' y* @" @4 b- e4 x "std" => "No",
! z: G* l7 R: |/ |! @# o4 _. j. W "options" => array("No", "Yes")),2 Q) x% M d- Y% X4 y' Z1 y; X
Z9 e! |1 ?8 e3 `1 o- a5 F" {: i y
" f( M0 E$ x4 E8 u# T/ t array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",, N. _+ a$ V% X( C; S9 {
"id" => $shortname."_sponsor_banner_one",
7 q' o7 u+ A* t/ k% x' ?+ A) T "type" => "textarea",; h% f9 W9 B0 U, H8 p7 ?; v
"std" => "",5 d+ r( T! `8 z H
),
/ K# \4 D9 Y9 |* Q) v% H8 K- m9 S% \& b( X. x
array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",
a: k) } u2 K6 r2 O& y5 Y "id" => $shortname."_sponsor_banner_two",
9 L8 {- p: \- J$ ^7 K0 q' g "type" => "textarea",2 `) {* ]8 S1 G
"std" => "",1 x# d7 }9 Y3 I2 j0 a3 t( x! j
),
8 d" g. q% ~+ W1 a! [. I7 |+ o5 L9 |' N% R# g K
array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",
{% i: R) l9 L9 { "id" => $shortname."_sponsor_banner_three",
4 ?# C- ]4 x6 b6 @8 ?& L7 f "type" => "textarea",) o6 {$ N; A: S0 o8 l7 d
"std" => "",( r( h( j/ w% P4 _; B
),* D4 c5 w$ p- f' w8 v3 Q) d+ u
0 z* e( y1 b1 b5 D( Z0 q B* j! c8 o array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",
5 ~7 G% Y# H/ E! \# s% d "id" => $shortname."_sponsor_banner_four",7 H) E; R) N6 S2 m# R6 S
"type" => "textarea"," k0 O. M6 W! T* Y1 S
"std" => "",
' i5 J% @7 U5 x r! D )," i; }) Q( x1 n, P: K
7 p8 h# W8 x1 H' ]; }2 K array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",
8 T4 e0 d9 e" Z+ N, g" A6 V( k "id" => $shortname."_sponsor_banner_five",
6 u: [- N' Z" j0 b. A5 L "type" => "textarea",
! W) V7 z/ v. @2 U, w' i "std" => "",: W5 ]7 D) P) F8 O8 N; q; x/ `+ y
),
' J# {. v+ ?6 {6 B3 {& y
( u$ m" x$ O p9 q& `8 T array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",* f2 I+ X B2 y1 n7 D% F# o) n0 H
"id" => $shortname."_sponsor_banner_six",# C R7 B z8 p! Y1 W
"type" => "textarea",' M N3 j% r2 O+ j5 E
"std" => "",
7 ~+ P+ J" }6 E" @- b5 i ),) |. h+ C1 ~3 v0 p
: x3 l& ^9 E$ G/ h; m9 \8 X array( "name" => "</div></div>",; _' r( O2 r( m5 v
"type" => "close",
V* K( N" s2 A. V# X" ~4 G8 x ),, \4 Z" t7 E f: `! b
" f2 [) |( @( C; I
& _. J' Q9 \3 F
5 |$ M1 D4 S y) g);
! n4 n7 w" X, Q7 M: d% k
! t% X' P+ c) T$ pfunction mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {
1 W. S y4 _% d2 D! b$ A/ l+ A
echo "<div id=\"admin-options\"> ";- Y( _7 D- X* T- ~9 Q7 C4 y+ @
! t- |$ b6 v2 d$ @+ C* wglobal $themename, $shortname, $options;
; c% o4 C+ V9 M: Z E% Pif ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';
% ]. \3 M! ~) b0 i6 B! \# h+ Vif ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>'; ]& V& v& f, |* T
?>
; L$ L3 S. h! t( k8 p' U7 K2 ?' V, K" |% M
<h4><?php echo "$themename"; ?> Theme Options</h4>
0 l; u; Y j% B; m0 [: c
/ m. l. e* u5 E+ r+ w' x<div class="annouce">
: m0 c% ]! {1 n0 @- @<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>
; j9 n" a% V6 E, Q/ a<p>Don't Forget to <a href="http://feedburner.google.com/fb/a/mailverify?uri=MagPress&loc=en_US" title="MagPress Newsletter" target="_blank" rel="nofollow"><b>Subscribe Our Free NewsLetter</b></a> In Order To Receive Theme's Updates and Fixes.</p>
, J2 d) T$ a6 D7 `" a1 y</div>' F6 ^6 N& a, l3 b4 \( D+ E
4 c/ t& R6 h V8 N: T<form action="" method="post">. w" E0 T$ Z: |
0 m) ^- z% {* b* B9 a7 D$ |7 p<?php foreach ($options as $value) { ?>
3 s2 ]( W0 t2 j7 [( c) \1 r# e
* J+ J$ _1 v9 F% U<?php switch ( $value['type'] ) { case 'heading': ?>8 F j+ l4 H$ {0 `5 c: B' v$ ?' Q7 p
- h+ d9 ]; I7 ~8 Y- i4 B6 ~4 P) ^<div class="get-option">8 L' ], O/ r ?' L3 f5 G
+ \; c I P9 j0 h
<h2><?php echo $value['name']; ?></h2>
: N U+ g! Y6 }
F$ v: s; N5 S, g<div class="option-save">+ H% L2 d1 \2 R) h5 ~7 t
) ^) C) O0 c; |. H
<?php) s c6 G) [. _8 ^0 { m
break;5 p6 h, R% z. ~' W5 J. P6 B- P
case 'text':1 Z) ]1 n& g% D( G
?>' q# |' z+ U E. T
% I( w2 S* Y8 P# H' W& ?. A. ~& ?
<div class="description"><?php echo $value['name']; ?></div>7 P& X! e2 c2 R( P( V
<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (
6 ~+ V2 N0 o! l# k1 P* @: I6 J3 {( o- ^' c3 v) g# Z
get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>2 x4 d8 k- i# _
1 {9 Y$ T$ u P' c
<?php
) M: ?3 l8 O( N: t" I( Pbreak;* ?2 a! ^! P$ H+ V6 u7 ]" z+ E" m
case 'select':
. u4 A( a/ o ^1 v0 b?>$ T1 B, c+ i u6 e8 R1 V5 n
; w" \% @8 D- Q% g0 B# x2 E4 G( T/ \
<div class="description"><?php echo $value['name']; ?></div>
( ^% M6 R9 _3 e8 |6 d/ Y<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">
; M+ @9 e; ]7 o0 @9 b<?php foreach ($value['options'] as $option) { ?>( z/ S( k, A _: v0 W( N0 k% x
<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>
2 L1 w. d' ~% \$ ~* L4 X2 o8 p2 E6 a<?php } ?>
" E! r" v: o3 C4 X ` F</select>$ p4 _2 a9 K+ A9 S5 N, Y/ g* s
</p>
+ `- w" S. Z% D" B9 r2 ]" w- L s* p' j0 J% K
<?php6 J, U- _ R+ E% i3 O
break;7 [1 p- y" n2 u; L% h0 P
case 'textarea':# O3 t; Y0 R3 Q% B: t
$valuex = $value['id'];7 m& W4 e% y' L
$valuey = stripslashes($valuex);
; G( s. d, h& Y5 w( t$video_code = get_settings($valuey);
4 I, O- E$ }+ G0 k' B0 F?>
" `2 D5 ]3 ~1 k. b: V( @9 F# N; E7 O9 a, j3 O7 k0 G) o
<div class="description"><?php echo $value['name']; ?></div>
( U) Q; J( J0 c6 Y( U<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }
4 i1 E0 d! K4 k3 o) i* Y! L+ U J
# q& L* ~: ?6 I/ O, ~% @, Welse { echo $value['std']; } ?></textarea></p>- N/ m* R; U1 O9 Q) x
. S" L% A2 L3 X( t# l0 r
<?php* s7 B( p+ y- ]1 O. R
break;
1 z7 p% t; W' N2 `1 C, I% tcase 'close':- L, m* D( g. t" C$ b/ q
?>- j5 |4 F. a; e2 J4 R `
3 h7 s N! k5 N$ c D o& S<div class="clearfix"></div>
1 L5 H% ^% P* q" y; R- }2 ]</div><!-- OPTION SAVE END -->" e; o! {3 h F8 C) X
1 v9 Z% w! O9 _' d! `
<div class="clearfix"></div>
% Y7 H/ z9 e i* k( L: q</div><!-- GET OPTION END -->
# Q" E) }# Z" D* y9 f! W% d$ u% V; b/ B+ E' n0 B
<?php
8 C# g7 s( C* \break;
# `& B6 s" b; V# w. x+ N' c) m1 Zdefault;% @& S0 f( V! s) L. ~( h6 D# q
?>
1 T) L5 Z( T [4 o% W6 t) j [
' u. s! Y/ b9 W* [$ f2 G) R
- d9 V" B( m! }" H3 x6 ?9 Q( D<?php
5 n% Z1 N& ^3 Ibreak; } ?>; j3 @& a6 m# c! j! U# E
& Y! Q- M: A. g7 h. r2 @<?php } ?>
j+ Q: K9 y' W/ u D1 o
4 y' m) q! i, {! B<p class="save-p">, u0 D" |1 R" @; K% \- I& B
<input name="save" type="submit" class="sbutton" value="Save Options" />
8 i e9 j" |6 _% U- t! m<input type="hidden" name="action" value="save" />1 t& }. Q$ W. N
</p>
, t! D6 i& B7 E: @ e" e</form>
6 S4 ]' h1 M7 `
7 U. h% [3 r) {<form method="post"># q" C9 m" i& z7 m
<p class="save-p">
2 |3 _8 B/ |7 _% ~<input name="reset" type="submit" class="sbutton" value="Reset Options" />
3 m/ K B6 z, Q- y% r, b<input type="hidden" name="action" value="reset" />
2 Z9 M* p/ ?& j: v: t2 h6 r( |</p>
/ j) Q$ _; i% u- ]4 e4 r</form>
3 U# I9 ~% ~( Z8 J' p7 {# S2 z- w1 m% u+ V5 F9 o
</div><!-- ADMIN OPTIONS END -->
7 S$ Z Y) U- Q& Q; j$ |( @/ @
<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }
' n7 ]. |; I1 }" p* _$ H: s+ i% ^- ^& R. Q1 _" e
function mytheme_admin_register() {, a' A; U* Q& w/ S$ [. h: c' p0 G
global $themename, $shortname, $options;7 `- y) j+ B5 H
if ( $_GET['page'] == basename(__FILE__) ) {
, G5 N1 U. J, Y/ p$ i6 Z) H4 X& eif ( 'save' == $_REQUEST['action'] ) {
; h9 Y0 w8 Z7 m, `8 `foreach ($options as $value) {8 R) u# L5 P* Y; o
update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }+ h0 L$ [0 C9 z+ U3 |
foreach ($options as $value) {
8 D1 U* A! T, ], J' Hif( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }
- ?" o0 f. ?- D7 F* b7 F! w, A6 hheader("Location: themes.php?page=functions.php&saved=true");4 l. i( I! O! q1 e0 e
die;
' i6 }, { ]. `5 v ]3 X; r. R} else if( 'reset' == $_REQUEST['action'] ) {, B9 K, E. o. C
foreach ($options as $value) {% j/ m* \: s+ b
delete_option( $value['id'] ); }
9 |# O6 _5 r3 f- @& S. nheader("Location: themes.php?page=functions.php&reset=true");+ r) l. d1 r* D, B
die;5 P& L% a) ]% }) v% E) ^) z
} w$ g, t/ G7 U8 L
}& |/ n# B `7 u# E6 N: g- R
add_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');1 ~% z. V# T# j8 \' S
}
- N3 L# Z/ K6 e( p: ^" I' J8 I( O* b _- {; t" U4 z
function mytheme_admin_head() { ?>
7 G! k2 G) I# o& h4 F, i' O5 c<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />" H, H8 q$ V5 N# @: ~) Y
<?php }
/ B, o+ q7 f, n |
|