|

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