|
|
楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////, X/ i' H t5 V% M
// Theme Option
; T- t8 H9 ?' N& h! L, M$ A, B* j////////////////////////////////////////////////////////////////////////////////. k- y+ a* a; e+ l
- j+ \! [5 P" j$ q* K+ Y! E
$themename = "Zenx";" k2 _3 [7 P: d$ k
$shortname = str_replace(' ', '_', strtolower($themename));
/ w% L t+ g' I, g: L3 V. @( K8 \) y1 X
function get_theme_option($option)
0 R/ {. j) r$ N5 ?. ^{
! G4 g2 R4 Y; q7 f; r4 n; @ global $shortname;
5 S' Z' `: Q9 `8 H, R, J3 h return stripslashes(get_option($shortname . '_' . $option));# j+ e7 N6 o& L* J% H
}
% M8 e* a( n( m# P2 i* K
- O2 J; o4 n4 r, E7 y3 ~1 W% W4 yfunction get_theme_settings($option)
, d1 P5 M8 a. [4 t1 f8 X; Z- @{
$ G4 B, t: ` M: Y' Y return stripslashes(get_option($option));( T: Q8 O3 k2 ]: _
}
/ G" t( Q9 ?- B" ?: A, t2 @# ]$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");4 O( v' z3 R- k4 c& n) J P( ?& K
$wp_getcat = array();% Y, }5 z: J' K& ^( j1 F1 L ], X
foreach ($wp_dropdown_rd_admin as $category_list) {* U. ]# z7 g2 T0 v) E* {
$wp_getcat[$category_list->term_id] = $category_list->name;
5 S/ I, S6 h" \ M}
/ o) G9 L- m3 ?- ?$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");
: \( s( {, S5 G% D P- N A! E$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");
0 |, U; R: \% G, ^5 N( K$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");9 M' K& [& d0 ?5 Z) f1 g
/ w9 D U+ C# j# J" {3 V$options = array (
, d* {& P; K$ E' X# w' G7 j0 ~& ` j- r, @3 ~ A! Y' s
' J+ d! U. y8 _: \# O# f
array( "name" => "Blog Header Settings",' J, N3 f5 s0 k4 j5 U
"type" => "heading",
c* W/ B1 y* V, f7 M ),
( ~8 n7 T& O; f |9 b, c; \7 n
' m7 y: N& A b+ T0 [ array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",# X9 `, ?* U/ r. w2 }$ y
"id" => $shortname."_header_logo_activate",/ a6 S# j, T& D* f0 J6 z/ r
"type" => "select",: \5 H; X8 A9 @# f, W5 ^
"std" => "No",
; g0 _& ~) X5 k+ l7 C# z "options" => array("No", "Yes")),1 V( C( U0 L, L* y" H8 t
1 _2 d8 h2 s7 m O% V' R; C array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",8 q- h$ N7 \2 z' _% W7 s
"id" => $shortname."_logo_url",
- S! D. k1 q* o0 |' m# J( n "type" => "text",( e: x9 D. c. n8 [
"box" => "social",9 N5 e+ E& q0 i2 u$ b
"std" => "",4 k+ `* ] {$ \- i$ s! i- ?6 c
),
+ V4 U) Z' \/ E C8 N* ?& f1 g: c
0 p8 k# [# o) a5 h9 [ array( "name" => "Insert Header Banner HTML Code (Header)/ S) R, I$ K" P( G; g$ `' ?
<br /><em>*Recommended Size 468 x 60</em>& N! e' A2 X# H9 e p) j2 H
<br /><em>*leave blank if not use</em>",. T, ?+ u n% ^
"id" => $shortname."_header_banner",7 O8 L; h% O# V& |" V* u: u5 ~
"type" => "textarea",
& y5 g5 e' \* d$ G/ J( Q2 n "std" => "",: ?9 N0 K! X$ o. c0 r
),6 T0 z2 a% K/ {/ g
?2 E2 u9 _3 o5 i
array( "name" => "</div></div>",
# R+ i" H) [+ [) a/ L1 R "type" => "close",
' {% i, w% U! `, {% k1 ^ ),! B( c8 |2 E4 k" c4 Y. }: O3 d
" x9 I9 j7 ~- c6 R7 }$ q- f! X6 Z# {
1 K$ G% N5 X+ ~* b. @3 T array( "name" => "Header Navigation Settings",
9 y0 }# K# ]1 E1 q( Z# c "type" => "heading",
1 s8 ?, Y6 {! D% H ),- L- D8 @8 }5 u' i8 x7 t
' Y+ @% I: N4 W9 m, \ array( "name" => "Insert Page ID To Exclude On Header Navigation<br />
6 P- l6 A8 ]3 [* ?2 w <em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />3 K% i& Q6 v! c$ ~* H
<em>*Enter the page post ID number only</em><br />
' T% ~" B& e5 V# D" c2 X <em>*separate by comma</em><br />$ y, o+ _6 R; X
<em>*Exclude pages which you don't want to show on the header navigation</em>"," E& {/ S* x7 A3 H, X
"id" => $shortname."_header_page_navigation",
# {3 v3 z" a) q% } "type" => "text", ~) X6 {( W3 f9 {+ r
"std" => "",8 R8 {" ~% {* h
),
% L# `& U" n9 N- t( R
9 F% }* _8 u9 r+ u& C2 W array( "name" => "</div></div>",
- e8 G! ~; R4 c, l. h' O "type" => "close",& W+ G1 i& H2 X0 p# F
),
- S0 W4 g# [) Z, U0 \6 u" ` $ |& I' \9 U Z5 z" c+ t; w! J) m
1 k L0 a/ [/ U
array( "name" => "Post Auto Thumbnails Settings",: ~! ~+ I$ S# T- p5 F
"type" => "heading",
) s |* w$ k# Y9 k ),
- d! c1 z* B# R) x : Q% O1 A4 h! l9 Y
array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
; _( C j$ W' |, K% V "id" => $shortname."_timthumb_activate",
- e* N/ m6 v# L K "type" => "select",
8 S. E' n3 ~% a "std" => "No",; ^" p9 ^# c" Q* ?, Q I R3 l
"options" => array("No", "Yes")),
9 p5 q( S) }# R+ L3 X; v; p 9 c) u6 k. d9 S. E! P3 N, p; P: [
array( "name" => "If Timthumb is enabled, Please choose its cropping method",
& E( \+ \8 {6 W u6 Q "id" => $shortname."_timthumb_cropping",; f/ @$ Y. L9 h! P. G5 o* V* I
"type" => "select",
& _2 u Y0 b P "std" => "",
* A# q$ i" t! t. t- B- i "options" => $crop_position),
4 Y6 t8 K# c; h% a
( k/ j( O- Q' ~! s array( "name" => "Insert Width Of Thumbnail Image<br /> S* A" r5 U7 u, g% g
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />- z7 X6 n6 a2 E- V& L
<em>*Leave Blank To Use Default: 250</em><br />",
G o: J8 n C5 @6 Y. Y; |+ Z* m8 W- [ "id" => $shortname."_thumb_width", R8 O" h1 y: o- U3 w
"type" => "text",
7 ^. x% B. s8 }' J' t "std" => "",2 O* Y4 U1 W% H( X5 y
),% X. B: L0 I% E. R4 l/ X5 E
. b* a6 E2 y5 V$ N; @5 u* s5 [
array( "name" => "Insert Height Of Thumbnail Image<br />
6 s: b5 |' }) s* d: e8 i <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
) A- N% M1 i/ }* w/ h7 `- c" r <em>*Leave Blank To Use Default: 200</em><br />"," ^7 I- m5 S6 ], E) N
"id" => $shortname."_thumb_height",
* M1 F+ U8 `9 D7 R "type" => "text",
% e* I% H* F& l1 {# f/ [. K% j "std" => "",# A% z& G8 X# J2 N4 C! t
),
' w) R3 s4 E# h$ Q) E' h
8 ?/ {/ D8 @" P9 y6 T# o+ j& |5 G array( "name" => "</div></div>",0 x0 O5 N' u) D* }4 c2 m
"type" => "close",- Y! r* z5 H: f: \% U
),
. q Z$ _% ^/ z' i" y7 l& T
( D( R2 F, U5 g8 T6 f% n array( "name" => "Featured Content Slider Settings",
' Y# k( f, c* k6 x; J! ^. S "type" => "heading",: X% a8 h* \: ` n* r5 ]8 _- K
),! e- u6 `* f7 w$ Y& s) |
- k% L# o/ X4 ~ array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",( p: B9 V% Z' c9 U. y$ _
"id" => $shortname."_featured_activate",
: R0 j f% C) s4 s* D- m% v "type" => "select",% I% U$ x" p8 w: K0 d/ S s
"std" => "No",
* G2 h$ h! l. e/ r( W9 j4 o "options" => array("No", "Yes")),/ {. ^ v/ M B t
, D1 q! i9 T9 x3 c6 f" B
4 d. `7 S1 d ^ array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",* @9 D9 ~) ~' @
"id" => $shortname."_featured_category",6 G {$ l8 t8 z8 K5 V
"type" => "select",0 ~0 R* r" [6 u+ u. @9 B" v
"std" => "Choose a category:",
5 a' B# `; y1 a7 T "options" => $wp_getcat),
$ s% @9 U2 X) X' E7 C2 u6 w
8 \0 u' N' L- j* H; ^ array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",
3 U1 C4 i8 x! R. a. j "id" => $shortname."_featured_number",( J6 p- L3 u7 y- M# F
"type" => "select",
" W* w' x( P7 E; b "std" => "Number of post:",
2 O/ D& n1 G& e; h "options" => $number_entries),
: ^5 d' C) V0 i( e0 \2 i. m R5 r" q) I6 a: U2 k- ~
array( "name" => "</div></div>",
/ Z# q: F, @; c2 n2 l "type" => "close",
! S5 q {6 d$ Y8 V. Z; P d1 B ),( l$ `0 e5 ~ u4 ~
0 P C( q9 _" j( E
array( "name" => "Featured Category Settings",5 U$ ^. B( ^3 _" |3 }
"type" => "heading",
0 R" Z( T, ]! A1 B5 L5 I! H ),, Q; P6 o" H) [9 g) w2 C/ _
: C% J* V" L* u9 `; y array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",4 V1 ?" l2 N$ a6 J5 q; S
"id" => $shortname."_featured_category_activate",! G9 Z8 C1 a1 }8 |' k
"type" => "select",- G4 T, g' f" \$ Y
"std" => "No",) T' z8 ^( h: B# K
"options" => array("No", "Yes")),
8 @' ~# M: h8 s' S4 p$ W) h7 j: P 5 Y1 I) U6 f& s7 ?% n3 G% ~9 W
array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",
! v7 h8 c% W( q6 D' Z "id" => $shortname."_featured_category_id1",- V! o# p: k8 u) y& k
"type" => "select",6 p* K. Y9 O W. f; M, y. P
"std" => "Choose a category:",
- Y4 N+ f( t" T! A1 Z$ v' R8 B "options" => $wp_getcat),
. ~. [7 `! t3 q0 s4 K' S, ]. Z y
# T1 N9 V( w; Z array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",0 Y( j" P, f# U# G# M
"id" => $shortname."_featured_number1",2 T' }3 m# ~: P4 \
"type" => "select",
3 n. U& I8 d9 e' }. ~1 j; o "std" => "Number of post:", R6 g/ {5 S3 z& v: m9 \1 u
"options" => $number_entries),+ T* T+ w7 N$ i G
3 a- O4 N9 F6 y% [ array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",8 s! ?3 v1 m! @3 l2 T
"id" => $shortname."_featured_category_id2",
, `/ q$ S0 E- w/ O+ a8 i/ v "type" => "select",
! s @! _0 b( H% y "std" => "Choose a category:",# H0 M( g& \, B- Y; S+ J
"options" => $wp_getcat),
. ~7 O5 \! t5 n( o5 y: R
1 V8 I& Q4 c1 Y" h8 \( D2 L array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
o& C8 g5 D" e! ^/ s "id" => $shortname."_featured_number2",& X; K: I) j1 a4 I2 _
"type" => "select",
7 T ^7 Q3 G) ~ "std" => "Number of post:",
0 b% ^8 }9 A! o "options" => $number_entries),' i% D, K# p {: u) N
% O4 q3 T6 V' _8 x: A9 f5 N' b2 t+ g! N
% t% u4 I" B' c9 c6 A% P array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
2 j4 M3 F% T3 |! P5 ^/ X- i "id" => $shortname."_featured_category_id3", f8 p; m/ M( s0 M- v, k& S0 R
"type" => "select", ]! }& C( [9 `. ? f# M( x0 Q
"std" => "Choose a category:",+ n3 n. N) b5 E4 Z& z5 _# S
"options" => $wp_getcat),2 t1 d$ H0 Y$ x7 J
+ {8 _' s* ]: X* m" U: U6 y array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
6 e3 l" k4 T6 z( O K* `" w3 k1 c "id" => $shortname."_featured_number3",
1 o0 @5 O, v) ]6 G "type" => "select",
( R3 @5 V: Z$ k0 _" D "std" => "Number of post:",0 G2 [2 h, R" i; J) K
"options" => $number_entries),' y0 h& L0 \* J+ ~0 [+ x
0 P: u2 e X9 A: J! |% P; b/ D7 V" g. n6 \8 x5 j3 n2 B
array( "name" => "</div></div>",
; o& o5 |2 ^# m6 ^ "type" => "close",$ P9 Z; |* \5 u: p8 ?2 j% o+ v
)," B4 X {: Q- R& n- ?
6 [ h# u! T3 Z& ^! Y1 w
* I* D$ m! k7 X& \ array( "name" => "Google Adsense & Analytics Settings",8 J& g3 R9 Q' U
"type" => "heading",
0 F' L- ^" D# c- m ),5 q' |* _/ F @* q
# a! V! n( g2 C; Y$ J# J3 C array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",& ]7 T! p8 X5 t
"id" => $shortname."_adsense_loop_activate",
2 `5 g' a9 g- V3 i+ X. Q( \ "type" => "select",5 e6 M4 ^' j# O
"std" => "Disable",
- O/ J6 L5 e9 O( a7 h: |4 Q "options" => array("Disable", "Enable")),
5 f. J0 e2 }" ^! r
+ [0 v/ h/ C9 q" H# \ array( "name" => "Insert Google Adsense Code For Loops Here<br />
# [+ l; U* q4 r, _ <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
8 \9 y+ u5 Q- K W8 L/ N" ~" ` "id" => $shortname."_adsense_loop",
5 P, `. t0 D. | "type" => "textarea",2 a* U% s3 l5 N# O" s3 y
"std" => "",. c) c1 u3 j& f$ n: w5 R
),
6 h; X* K( g' N0 _# w3 f1 p/ L1 P; n% |, A2 Z# A
array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",. W8 f8 O$ I4 U; r7 i& F
"id" => $shortname."_adsense_single_activate",0 {5 h% j6 v' k" _. y8 d5 n9 o
"type" => "select",
$ N9 i+ S5 v9 w: \0 N3 h5 [ "std" => "Disable",; S+ D# l" S% C4 W0 ^6 [
"options" => array("Disable", "Enable")),
4 d0 G6 `9 |2 w8 }0 I/ |$ ]) Z1 Q2 |3 m# Y
array( "name" => "Insert Google Adsense Code For Single Page Here<br />& E% |. e& _7 J( r, x
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
" f# f) \( g; a' ~$ Y, i "id" => $shortname."_adsense_single",
% Q6 X" s! X3 g8 p f$ w "type" => "textarea",
1 Z7 ?; E# W) h" T8 s/ |4 W "std" => "",
& ]% ? H( s% Y0 q2 V ),$ H9 p% e# [; I) ]2 e
z& f" T7 c! W: p* s# Y
; Y/ X! z1 @0 O, d- G% }! N array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",
9 w, J9 `: A/ H, q: j9 |( K "id" => $shortname."_google_analytics",* A8 n) M z) @+ s
"type" => "textarea",
8 Y; T0 ~4 @; x5 ^4 R" d "std" => "",
; L! B# V* z+ p0 U$ ^ ),! y0 ] i! u# F4 i& t
% C' \5 c( M6 w9 @7 h0 m
array( "name" => "</div></div>",. Q- Q6 A; |' L2 c( e
"type" => "close",
# Z# D( l" U( W [1 D2 @" A* c ),) l' R5 x* ]/ ]0 l
9 q8 R+ b4 W* o+ d+ f p+ q * o6 e& U( M2 ^* s$ j
array( "name" => "AddThis Social Bookmarking Settings",8 P+ ?) \6 N$ j# }1 L4 P0 W
"type" => "heading",& ?! w8 R( ^, m# y* Z9 G/ x1 ?
),; Y; K, N C9 T0 `
# m2 r& u2 K1 `
array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>
4 J8 p0 _* ]: B6 N( i# |. x9 R <br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",
! @: L- [) k2 O( F) `8 C "id" => $shortname."_addthis",( Y+ W7 r" ~9 m. r
"type" => "text",
. a k" }8 {, N4 l0 \' X3 s0 N* n "box" => "social",/ m) q7 y& B# m* B
"std" => "",
! W3 T$ j- N4 c( i" d7 N; j ),1 ]% R* B0 A, M; \! `
% n4 t# b& x* s1 u" O array( "name" => "</div></div>",* v1 l8 W! b5 R8 ]0 ^
"type" => "close",
2 Q- q2 A- y9 ]: W$ \# ]9 M ),/ x, ?5 x- X- T) Y" B; J9 a Q
8 {6 C [3 @* v5 [, e7 V# ] 5 {- B O* K5 {
. T$ C$ A( h5 H% j array( "name" => "YouTube Video Settings",
. p: O6 W" p& G& d "type" => "heading",
1 o) e0 I0 N" _8 e) P( f. i ),
! L9 d6 f0 q2 b" u& P$ R: T. z' @& A- F$ j6 ^5 P
array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
: ]- R7 @9 e! _4 {/ l "id" => $shortname."_emvideo_activate",' [7 }, `3 }" _9 e0 p. Y
"type" => "select",- Y5 c6 O$ T0 O1 }
"std" => "No",1 ~+ q+ \) O4 ~& @& O/ |. X6 c2 Q4 X
"options" => array("No", "Yes")),: E3 H2 E# P9 l$ x3 n: N% V5 b
+ s! a& s$ I- ~+ r! f% O
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>",
7 w6 Z3 Y) D9 B "id" => $shortname."_emvideo",; v' @+ Y# M+ W' |# S
"std" => "",4 `2 l% \ R' i3 q, C7 F; ~
"type" => "text"),
, l2 g/ h! c' y, R6 V ^' H: K% E( l2 e7 |( }
array( "name" => "</div></div>",
4 I: |/ [, e$ a1 p "type" => "close",: L% t* ^, q& q8 g
),, q9 A9 X- _; b8 n& h, L
" a. ^% z/ W/ C+ t4 s+ {. j$ v
array( "name" => "Twitter Settings", e9 t" E: a# h: g7 x9 D
"type" => "heading",. z6 L0 z8 m# h
),) T: }9 J& C) C
0 [5 R6 n( M1 q0 X
array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",. P- r& K5 O. \& T3 T# M
"id" => $shortname."_twitter_activate",& y6 F& s9 n9 @0 [0 P4 }! f( `8 H
"type" => "select"," N. p1 ^9 q% H: l# Y8 Z
"std" => "No",* p3 `& D3 n) B' {6 S; O
"options" => array("No", "Yes")),
/ H" P4 z" e4 v+ C5 c2 A+ f. Z3 _+ g! d
array( "name" => "Insert Your Twitter ID here; V1 O' Q( J6 M! P
<br /><em>*leave blank if not necessary</em>
7 {! F. P/ r$ u |7 ?5 H: p' Q# @ <br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>"," y# i v, E' R) ~6 u3 H6 w$ V( \
"id" => $shortname."_twitter",9 R* U$ ]3 c7 d% Y6 r5 s
"type" => "text",3 O; X9 N! q/ u1 x% V" I# T+ D
"box" => "social",
; r3 J* I4 L5 B9 U7 |1 w "std" => "",
- `9 B$ T) N$ [ ),
6 D- V+ _$ h- u" c% l0 N/ e2 Q |' O
array( "name" => "Enter Twitter Feed Count here! J1 w- ]9 D) O) h
<br /><em>*leave blank if not necessary</em>- v1 l2 ^' A5 s: h4 Q
<br /><em>*Enter How Many Twitter Feed To Display</em>",# Z$ I* U0 B+ D
"id" => $shortname."_twitter_count",% `: D. J: B# d" o" _
"type" => "text",* |0 C% o6 \& V# A0 t& s3 Z8 k
"box" => "social",
, @" K+ E; T4 n: M7 G/ u9 q "std" => "",
5 o$ L& h* c" r5 U, |9 }5 | ),
& x6 }: z, G t9 h' L' n0 a9 F6 ~- p0 F8 l0 }! W/ R: }8 Z
array( "name" => "</div></div>",5 Q( P8 l' s, K: |+ O# N% w
"type" => "close",
, C1 @% O% Q& a' H ),$ \8 c% l/ ^7 l2 G7 a9 D
, @$ m* Q& \. U4 N8 s
6 G+ F) ~( g5 y& o3 q0 {) U
array( "name" => "125 x 125 Banners Advertisement Settings",: S1 h; M# E z8 n# F, [- K2 F$ m2 H
"type" => "heading",
: ], ? N5 D3 ^ ),7 V( i% z# K e+ m9 G& S
7 r0 U) _& |! o+ K: ?
array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",/ Z3 k- J+ `$ G$ U0 R
"id" => $shortname."_sponsor_activate",5 T; ^% C6 s. d6 Q" V
"type" => "select",' h1 m( H/ _. v2 u0 w0 I% D; v
"std" => "No",
6 }# x" p' w* \4 A9 k* S "options" => array("No", "Yes")),
9 Z5 T+ U8 e* I6 c: \' ? 9 }& E/ a- X6 l |) Y6 B
, }4 Y" P+ d6 c5 x% o( ^" _/ u
array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",
" i2 r; ]% W. G( y' Y5 o( h9 } "id" => $shortname."_sponsor_banner_one",, c4 d/ k" }( H) H+ L
"type" => "textarea",1 @( W1 `8 c$ s# o& I4 _- \
"std" => "",9 h$ \; \$ U+ f( A8 L# p0 W
), 1 c3 O6 y% @2 V9 ?- U) n
( g/ g2 }, {* r' e% [- u& i
array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",; I0 c" R: @9 F$ m, L6 M* f
"id" => $shortname."_sponsor_banner_two",% h; f8 C+ \7 q9 Y: j+ }
"type" => "textarea",# Y% w3 F% K' x% J) H8 k
"std" => "",4 ~. s) C4 t6 W7 b2 @; ?
),
; l8 F, _' s% y- \( X$ g; Z
* E, U `9 c& n array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",
n3 q! w+ Z) ?6 ` "id" => $shortname."_sponsor_banner_three",
6 ?+ e1 H( I& V. ? "type" => "textarea",1 r# c9 S# B! Q- Y4 W. q
"std" => "",
3 T5 W; y4 _$ g. K; B+ x. S ),
* p: m) g5 N: W& r1 z! ^9 H! N0 q3 C8 p' T- m% n
array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",
$ y6 o# D4 x9 { z: Q "id" => $shortname."_sponsor_banner_four", A; F- S: J: v1 |7 r) p
"type" => "textarea",
8 a& G5 T0 X' L "std" => "",- f5 J( \: r/ X
),
9 R& Z2 Y9 w& Y: y, B+ Z* Q2 Y2 I& g5 k' z. I
array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",
, j9 ?* i4 u! _& I "id" => $shortname."_sponsor_banner_five",
0 K" n& ^/ J) O/ {7 ?7 o8 X "type" => "textarea",
7 J F- X" A7 n6 T "std" => "",8 s! ^+ b0 ?2 |
),: ~% p8 F+ C& Z5 V$ ^% j" s
% \6 l- m: K+ `/ b. Y array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",1 z* B8 A( @9 v6 F7 [* X
"id" => $shortname."_sponsor_banner_six",, x& w* J) E& Q U2 k, z, i2 Y$ b
"type" => "textarea",
; F# R4 L+ b( E" `. _0 p2 m, k0 G& A "std" => "",9 {: j9 n4 b! }
),
- S4 |5 B" ~+ M! Z2 r( ]- Q- R8 A- d3 ]7 \
array( "name" => "</div></div>",1 Y; ]9 u9 Z i9 `* W: ^* S1 ?: t, y) f4 }
"type" => "close",; h% A ^8 V0 ?$ R5 R1 R% e9 v Y, j
),. _# }2 I8 D5 B8 m
. C+ k" _( h) M, p5 ^" }0 u/ p
8 [6 `7 L e6 n5 ^& j- O7 I' d: ]
);
/ z0 ?- p& D0 Z
0 {7 O( k% z7 W# {6 A% Ffunction mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {; t$ [$ ]: Y& n& _. ]: W
& X: O1 \1 ]$ x& `7 P# I4 eecho "<div id=\"admin-options\"> ";
0 |: U, l2 \0 ~0 ^8 B( V# K& I \# W# z! y+ {
global $themename, $shortname, $options;
; i. H6 B* N9 X, ]6 Q0 Nif ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';9 Z! f8 N/ P2 K I- b" p. K
if ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';
9 d' y$ W1 F% i/ Z& S$ ^?>
2 u T1 t! t% \. A! x5 o( V. T7 f& {2 W
<h4><?php echo "$themename"; ?> Theme Options</h4>6 _3 d p( h' _9 f" K
5 U1 @% N# f; {, t" Z<div class="annouce">
% u9 K4 f8 F* l: \' V<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>2 h7 M2 ^/ M1 i/ F
<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>$ o# N6 w P% S' {
</div>
1 E' d0 W! q* t" @/ _1 A
/ N K$ l. t8 Z- s; y, g<form action="" method="post">
2 v6 C( c& j9 K0 o1 P" e, G) J. V: P7 R& `; K/ n q1 B
<?php foreach ($options as $value) { ?>$ G% y% I2 d9 Z( Z% ?% S3 B
, C0 Y6 E$ b4 [4 [
<?php switch ( $value['type'] ) { case 'heading': ?># {+ c7 R1 `+ g/ e
1 ^* _* f% ]5 z/ M<div class="get-option"># D7 V# Z3 ]* W* ]
3 [" X: y$ _9 _- Q
<h2><?php echo $value['name']; ?></h2>
: E; Q( T- Y7 h( Y2 {8 ?" B( g8 d7 h5 e( G0 i) X3 h% c. C
<div class="option-save">
: ]5 X+ N& X9 P" x" O; `
6 y) {% C! J4 c<?php
& a: N9 {+ ]/ ~% g% g9 mbreak;
& }) y! c. J- t/ [1 _1 y! Dcase 'text':
5 y, e: Q1 ]6 d8 r! @?>7 H( m/ u5 X& f1 V# W+ M
+ ^* x0 Z6 ]5 q5 Z/ `% T
<div class="description"><?php echo $value['name']; ?></div>
; E5 K. Z+ ?0 u<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (
, u. W# ]8 M/ _, `
, o. Y0 S$ j6 H: r/ ~3 Mget_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>
) Q9 U! J, b! k( {5 N8 [ W; C1 \$ M& _7 k- k: D
<?php
- t3 j* J; T0 } M4 d" \break;
) b' F# B1 z% b5 t: h3 ycase 'select':
2 T5 G6 r, c+ l* L" m; H/ {% G?>+ R' U' r# t4 }) v9 Z- p
- v3 _6 R, F6 [% q( k: r+ W<div class="description"><?php echo $value['name']; ?></div>$ |, l3 X0 S6 `5 k9 w/ W
<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">
- a0 k1 j) ?6 u" \$ r8 s/ S; I {( v<?php foreach ($value['options'] as $option) { ?>
/ X- E9 S3 J' W0 w( e; g<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>5 @9 ` {4 x b
<?php } ?>2 M1 l f. v# n5 W% Q
</select>4 c [$ P% ]+ ]& ]2 q( C
</p>* v+ q: H; I9 j* u, x# d( V
2 `+ d& O- |! q; ^2 N: ?<?php1 c1 v" e) U# a4 O: T8 d3 x
break;3 p* T8 w9 a4 Y# l! Z
case 'textarea':
) C$ z% N4 `! T$valuex = $value['id'];1 L. ]7 ~$ ~: v( D, F% S) _" h
$valuey = stripslashes($valuex);
, _/ h5 z; C# k; R; {/ M: E( G! x' i$video_code = get_settings($valuey);- j6 t8 M* A- R9 w
?>
- J* n8 ~6 [5 I- x/ |. A' T1 s' C
<div class="description"><?php echo $value['name']; ?></div>0 S' K7 _2 A1 t/ l- o% `) x8 d
<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }
6 F- J+ T2 s h0 z; S
/ l) ^5 Y7 K, N: Ielse { echo $value['std']; } ?></textarea></p>
& L6 \% t0 |& b* x" }0 D V( ^" d2 H5 B# C
<?php) a6 I5 u; h) C
break;
% d3 s6 S7 T8 o% w3 D: @" t" r' Tcase 'close':
/ c, p/ m1 F% x9 F?>6 s% e [4 W" W$ j
$ p) l2 E# L3 k
<div class="clearfix"></div> j7 y% _; P/ l' S! z# Z' ?
</div><!-- OPTION SAVE END -->) p% M. X- [+ r* r7 Q4 ?9 [8 k
/ v0 g+ w1 Z$ m/ B
<div class="clearfix"></div>% s0 e/ P5 c) X8 E3 ?' Y0 F
</div><!-- GET OPTION END -->
& f h( {1 R3 B0 R2 f; f; z/ S! v& b5 b( T; e" ~+ {
<?php
; c. @. A4 V8 [3 L" ebreak;( {" F1 Z; U9 G$ \ }
default;
$ y `! |+ P) u' j4 T% c3 N?>
4 `* x, m4 V# c$ G. p* U2 ?# [# y- x7 O) B4 E; r3 F
) g4 P% X9 a e" i<?php
# }' R% i% r- Dbreak; } ?>
, m1 T8 g. Y! X' O6 }9 F: G5 o; l
& k" T8 \+ I2 H+ w; ^1 T4 j<?php } ?>: `; @/ L& G3 m5 R
* g! V E$ W, _) R. O+ }* ?3 ]* R( B
<p class="save-p">
5 Z: W4 H; k V<input name="save" type="submit" class="sbutton" value="Save Options" />5 k9 S# a0 Y# K2 G
<input type="hidden" name="action" value="save" />
) _" A3 G3 U! P# J/ q</p>- p2 z @9 O* a) Y
</form>
5 L) p) s$ f$ ]/ |- K
! F' L7 r* N$ P3 f9 J% B$ H<form method="post">
! l0 [& V/ E. z' H4 o- y<p class="save-p">+ z! g4 c6 ]6 _( ^8 j
<input name="reset" type="submit" class="sbutton" value="Reset Options" />
# K7 `4 ~+ p. I5 R' R* H* h<input type="hidden" name="action" value="reset" />
- j0 ? Q' r% C$ R) k/ b3 M0 y& A</p>6 ^+ o& i4 a0 T, |
</form>
+ ?( b% @. S+ z# ^3 G
+ u8 M% w/ s3 R' h: w, k z5 q0 p</div><!-- ADMIN OPTIONS END -->
$ A% u/ P4 w' j. B2 R
0 L1 H" F* {, b% p0 O<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }& ]& ]; \1 ^6 \+ |* m# Q, |: G7 n
) X Y9 p# T. c& _
function mytheme_admin_register() {( m" a* A9 T5 j7 k8 ? U
global $themename, $shortname, $options;& W9 Q: D6 x+ e) Q0 n$ l
if ( $_GET['page'] == basename(__FILE__) ) {
1 c; U$ c$ h2 M+ l; ?if ( 'save' == $_REQUEST['action'] ) {2 Z0 |4 S2 l) r; y$ k
foreach ($options as $value) {
7 }/ j9 N. j. ?0 K- H7 h2 X; `update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }6 Z3 V6 R$ t% n, V. }
foreach ($options as $value) {
2 A5 A1 B" g) q! zif( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }
0 l* F( ^" G* R# wheader("Location: themes.php?page=functions.php&saved=true");4 B" a! U6 O8 H& R9 y( N6 {! Q
die;
7 H6 l8 q3 I( Y7 w7 e} else if( 'reset' == $_REQUEST['action'] ) {7 k8 I( U G! T+ ?
foreach ($options as $value) {5 y7 Z8 t9 z& i: `
delete_option( $value['id'] ); }( i' m4 D9 ?# k5 Y0 `+ i; ^
header("Location: themes.php?page=functions.php&reset=true");
+ q& J) c! l7 A, T& s0 Hdie;
1 W- ]: S; i- b! B' P}
' D6 E4 N, M! j1 G' m3 z4 i# p}
1 F; z5 n: p" x6 d! Uadd_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');
' e9 d0 x5 E) F; R}3 m B* k7 ?' a: N' _' B1 p, _0 J
0 L. L2 o0 n" w5 e3 k+ @3 l
function mytheme_admin_head() { ?>
6 t( ~$ I2 I% E- n<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />4 G U3 @ e, T0 u
<?php }7 O! M1 Z" {, Y% G
|
|