|
|

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