|
|

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