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