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