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