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