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