|
|

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