|

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