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