|
|

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