|
|

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